This is going to be a little hard to explain but ill try. I'm trying to make it so when I click a position on the map I move to it, if its a unit I clicked I attack it. However if I'm attacking a unit already, and I click the map away from him I want to move away not keep attacking, keep in mind this is all done with just left click. Also when I click to attack him, I attack once, not until he dies.
Basically to make it simple its pretty much like diablos left click, you run when you click but if a monster was there you attacked it, and there was no auto attack there either, and if you clicked away, you ran away. So far the problem is
I set left click to be move= I cant attack units, even if I click them for my point
If I set my left click to be move= yay my left click attacks the monster, or I just walked to a location, but the problem is once I attack a mob, I can't stop attacking if I click away nothing happens because of how attack move works in sc2
hopefully I explained it good enough, pretty much I want diablo stylee attacking/clicking
If ur using a trigger, cant you just make an If/then/else action that checks whether you clicked a unit? If you didnt click a unit, it orders move, and if you did, it orders attack? And since the "attack" would then always be directed at a unit, it will also move to another unit if you're already attacking one (since you're not attack moving but focus-firing, kinda)
I'm not sure if you can stop auto attacking so that it's one attack per click, however you could create a new 'Attack' ability that does attack once, like a normal ability, then remove the normal attack ability from a unit (which should stop him auto attacking).
After this you just create a trigger to respond to click events, and if he does click a unit you actually order him to use your new attack abiltity.
Otherwise you can look into the behavior of the normal attack and see if it can be changed, you can possible make it behave more like a normal targetted abiltity.
@KratsAU: Go
After this you just create a trigger to respond to click events, and if he does click a unit you actually order him to use your new attack ability. How do I do this part?
Well you need to either detect the Mouse Pressed event, or detect the Selection (something like Player Selects a Unit) in a trigger.
Since you are using the left mouse button I'm not sure how it will work, you might need an additional trigger so that the player can't actually deselect the main hero/unit. Should be possible though afaik.
In the bottom left hand corner you will see a thing called "Weapons"
In there it should have the default weapon. Click it. For Tosh it's"Tosh - AGR-28 Guass Rifle"
Right hand side, scroll down to "Weapon Options" Double Click.
Up the top is ticked "Can Initiate Attack" Take off the tick and save it.
Now do a happy dance!
And if you want to stop him from fleeing when attacked, just go to the Data editor / units, find your unit, then in the right side it's got "Behavior response". Set it to "No response"
Now I just have to work out how to initiate it on click
Ok in the end I added "Ghost Hold Fire" Ability, and gave it a command panel button. Same with weapons free. Then I have right mouse initiate hold fire ability.
Left mouse then deselects the selected unit, selects my hero, then initiates command to attack triggering unit, and initiates weapons free, waits one second, and then goes back to hold fire. You can adjust the wait time to allow one single shot before it goes back to weapons free
I'm doing something along the same lines but I have ran into a different problem. I want it so if someone left clicks and they hold down the left mouse button the unit will continue to follow the mouse. What I am having trouble with is figuring out how to detect where the mouse actually is rather than where it clicks. Also if someone left clicks and holds the selection box appears and I don't know where to look to have it disabled.
This is going to be a little hard to explain but ill try. I'm trying to make it so when I click a position on the map I move to it, if its a unit I clicked I attack it. However if I'm attacking a unit already, and I click the map away from him I want to move away not keep attacking, keep in mind this is all done with just left click. Also when I click to attack him, I attack once, not until he dies.
Basically to make it simple its pretty much like diablos left click, you run when you click but if a monster was there you attacked it, and there was no auto attack there either, and if you clicked away, you ran away. So far the problem is
I set left click to be move= I cant attack units, even if I click them for my point If I set my left click to be move= yay my left click attacks the monster, or I just walked to a location, but the problem is once I attack a mob, I can't stop attacking if I click away nothing happens because of how attack move works in sc2
hopefully I explained it good enough, pretty much I want diablo stylee attacking/clicking
@threeleven: Go
If ur using a trigger, cant you just make an If/then/else action that checks whether you clicked a unit? If you didnt click a unit, it orders move, and if you did, it orders attack? And since the "attack" would then always be directed at a unit, it will also move to another unit if you're already attacking one (since you're not attack moving but focus-firing, kinda)
@TheAlmaity: Go
thats what I thinking but I cant figure out how to get that condition of if I clicked a unit or not how would I do that?
Using the Data Editor I think there is some kind of Search Effect that initiates auto-attacks, I'm not sure about this though.
The Ghost and Phantom Unit have a command for dont use auto attack.
@Caipa: Go
If you mean holdfire, that dont help me
@threeleven: Go
any ideas?
@threeleven: Go
If you know how to do that if/then statement can you post it?
I'm not sure if you can stop auto attacking so that it's one attack per click, however you could create a new 'Attack' ability that does attack once, like a normal ability, then remove the normal attack ability from a unit (which should stop him auto attacking).
After this you just create a trigger to respond to click events, and if he does click a unit you actually order him to use your new attack abiltity.
Otherwise you can look into the behavior of the normal attack and see if it can be changed, you can possible make it behave more like a normal targetted abiltity.
@KratsAU: Go After this you just create a trigger to respond to click events, and if he does click a unit you actually order him to use your new attack ability. How do I do this part?
Well you need to either detect the Mouse Pressed event, or detect the Selection (something like Player Selects a Unit) in a trigger.
Since you are using the left mouse button I'm not sure how it will work, you might need an additional trigger so that the player can't actually deselect the main hero/unit. Should be possible though afaik.
Happy dance!!
Data Editor / Units
Find your unit
In the bottom left hand corner you will see a thing called "Weapons"
In there it should have the default weapon. Click it. For Tosh it's"Tosh - AGR-28 Guass Rifle"
Right hand side, scroll down to "Weapon Options" Double Click.
Up the top is ticked "Can Initiate Attack" Take off the tick and save it.
Now do a happy dance!
And if you want to stop him from fleeing when attacked, just go to the Data editor / units, find your unit, then in the right side it's got "Behavior response". Set it to "No response"
Now I just have to work out how to initiate it on click
Ok in the end I added "Ghost Hold Fire" Ability, and gave it a command panel button. Same with weapons free. Then I have right mouse initiate hold fire ability.
Left mouse then deselects the selected unit, selects my hero, then initiates command to attack triggering unit, and initiates weapons free, waits one second, and then goes back to hold fire. You can adjust the wait time to allow one single shot before it goes back to weapons free
I'm doing something along the same lines but I have ran into a different problem. I want it so if someone left clicks and they hold down the left mouse button the unit will continue to follow the mouse. What I am having trouble with is figuring out how to detect where the mouse actually is rather than where it clicks. Also if someone left clicks and holds the selection box appears and I don't know where to look to have it disabled.
@Tradnan: Go
You can't do this yet, possibly in the 1.2 patch it will be in, as they said they will allow us to get the mouse X/Y coordinates.
@KratsAU: Go
That's a shame. I guess I'll have to wait a while before I can implement what I want to do.