I'd like to have my map set up where the player controls one hero and can order it to move and use abilities and whatnot, but cannot choose the target of the hero's weapon attacks.
This would be just like in the WC3 map Battle Tanks, where the heroes simply fire at nearby units but can direct abilities at specific targets.
Any ideas on how to achieve this effect? Is there some field under Weapon that determines how the target is acquired and where you could toggle off the player control?
I would not use a weapon. Instead, you could use a comination effects
For instance
A unit purchases a weapon.
You apply a persistent effect corrosponding to that weapon. The period durations should be the weapon cooldown, and it should just have 65535 periods. As a periodic validator, you check that the unit still have the weapon.
This persistent then call a search area effect, which finds an enemy, and calls a launch missile effect which on impact, calls a damage effect.
I haven't tested it, but I belive it should work (except adding multiple weapons of the same type might be problematic if you will be able to remove them again).
Otherwise, you could scrap the persistent, and use a trigger instead to apply the search area effect.
There is also another way depending on your controls.
If you are using standard starcraft2 controls then SBeier's reply is probably best suited. But, if you are using wasd controls, flag your unit as unselectable. This way you arent able to give the unit a command based on its abilities data. This ofcourse only works if you dont mind setting up your units abilities and such with triggers.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'd like to have my map set up where the player controls one hero and can order it to move and use abilities and whatnot, but cannot choose the target of the hero's weapon attacks.
This would be just like in the WC3 map Battle Tanks, where the heroes simply fire at nearby units but can direct abilities at specific targets.
Any ideas on how to achieve this effect? Is there some field under Weapon that determines how the target is acquired and where you could toggle off the player control?
I would not use a weapon. Instead, you could use a comination effects
For instance
A unit purchases a weapon.
You apply a persistent effect corrosponding to that weapon. The period durations should be the weapon cooldown, and it should just have 65535 periods. As a periodic validator, you check that the unit still have the weapon.
This persistent then call a search area effect, which finds an enemy, and calls a launch missile effect which on impact, calls a damage effect.
I haven't tested it, but I belive it should work (except adding multiple weapons of the same type might be problematic if you will be able to remove them again).
Otherwise, you could scrap the persistent, and use a trigger instead to apply the search area effect.
There is also another way depending on your controls.
If you are using standard starcraft2 controls then SBeier's reply is probably best suited. But, if you are using wasd controls, flag your unit as unselectable. This way you arent able to give the unit a command based on its abilities data. This ofcourse only works if you dont mind setting up your units abilities and such with triggers.