This is an odd little problem, and I just spent 2 hours debugging a previous one, so I'm a little spent. I thought maybe someone here would have a good idea before I ripped my map apart looking for it.
((by the way, for future reference...do not make your dummy units have the "float" movement type, as when you make them near water they will sometimes appear in weird spots. It took me 2 hours to find out why my spear was being thrown from 30 feet away toward the water))
Here's my problem:
I have a dummy unit called "net thrower" who pops up when I need him to cast Ensnare on an enemy unit: tempDamageShip (in this case, a neutral passive unit). It works fine, except that the dummy unit hangs around a bit after he is needed. So I put an expiration timer on him. When I do that...the dummy unit no longer casts on the target. I put the expiration timer to 60 seconds, and it still prevents him from casting on the target. "u" is a different unit that triggers the ensnare. Here's the code in the trigger:
I imagine I can work around this by playing with the object data (give him negative hp regen) but I thought the pros used expiration timers a lot...and this bug seems like something I ought to know.
EDIT: apparently it has something to do with the fact that the dummy NetCaster was for Neutral Hostile...when I made it Neutral Passive it no longer refuses its order.
((by the way, for future reference...do not make your dummy units have the "float" movement type, as when you make them near water they will sometimes appear in weird spots. It took me 2 hours to find out why my spear was being thrown from 30 feet away toward the water))
Here's my problem:
I have a dummy unit called "net thrower" who pops up when I need him to cast Ensnare on an enemy unit: tempDamageShip (in this case, a neutral passive unit). It works fine, except that the dummy unit hangs around a bit after he is needed. So I put an expiration timer on him. When I do that...the dummy unit no longer casts on the target. I put the expiration timer to 60 seconds, and it still prevents him from casting on the target. "u" is a different unit that triggers the ensnare. Here's the code in the trigger:
- Unit - Create 1 _NetCaster for Neutral Hostile at tempPoint facing Default building facing degrees
- Unit - Order (Last created unit) to Orc Raider - Ensnare tempDamagedShip
- Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
- Unit - Add a 0.01 second Generic expiration timer to u
- Custom script: call RemoveLocation (udg_tempPoint)
- Skip remaining actions
I imagine I can work around this by playing with the object data (give him negative hp regen) but I thought the pros used expiration timers a lot...and this bug seems like something I ought to know.
EDIT: apparently it has something to do with the fact that the dummy NetCaster was for Neutral Hostile...when I made it Neutral Passive it no longer refuses its order.