| 03-02-2010, 09:20 PM | #1 |
^That's my problem for tl;dr-ers. Long version: I have a spell that causes units to do... things while the owning player can only watch and cry (or heal them or something). Until now I used to change the ownership of the unit (to Neutral Victim, to be more precise), but I realized that this screws up being targeted by: - Automatic enemies' attacks - Friendly and enemy spells (auto-casts, AoE, Chain spells, spells with no target etc.) I could always make Neutral Victim enemy for the owner of the caster and ally for the owner of the unit, but I can't avoid problems if this spell is cast by both the players, or even by all of the 12 players in a short amount of time. Unfortunately, the only alternative I know to changing ownership is the yucky 'Aloc' (Locust), that makes the unit immortal and unselectable, hides its health bar, disables its collision (thus also pathability and GetUnitXYZWhatever()) and cancels its formation value. So... ideas? Systems? Scripts? Abilities? |
| 03-02-2010, 09:36 PM | #2 |
Add ward classification at runtime and catch smart order. Ward blacks out the command card, so the unit can only be issued right click orders, which you catch by trigger and reissue the previous order (eventually using RisingDusks LastOrder system or storing the orders manually) |
| 03-03-2010, 11:28 AM | #3 | |
Quote:
(Cookie, btw =D) EDIT: Okie, either it doesn't work or I didn't understand how to set a unit as a Ward... can you post some code? |
| 03-03-2010, 11:58 AM | #4 |
0_O setting ward classification at runtime does not seem to work, at least there is no UNIT_TYPE_WARD or something in the constants (did not know this, sorry). Maybe you have to set it in the object editor manually (if you need it temporarily, try using chaos from a non-ward version to a ward version of the same unit) |
| 03-03-2010, 12:14 PM | #5 | ||
Quote:
Quote:
EDIT: Problem solved. |
