| 11-21-2003, 10:09 PM | #1 |
My hero has a spell that creates a status effect on a target unit, based on triggers. The target is acquired by "issued an order' event, and the effect applied by "finishes casting an ability." Then, I want the trigger to wait X number of seconds, and remove the status effect ability from the unit. The problem is that I can't trust the unit variable, because the hero might use it on a second unit before the first's status effect wears off. Is there a practical means of fixing this? |
| 11-22-2003, 12:35 AM | #2 |
use a local variable. Custom Text: local unit udg_StatusTarget Set StatusTarget = <target> Apply effect to StatusTarget Wait X seconds Remove effect from StatusTarget alternatively, you could make the local variable for the effect itself, and kill it after X seconds. Check this out for a more detailed answer: Lord Vexorian's Local Values Tutorial |
| 11-22-2003, 12:42 AM | #3 |
Just a side note on RicFaith's code, it is prolly better to use a timer instead of a wait if you want to use this in a multiplayer map, wait commands can be un reliable for long and sometimes even short durations. Neo_Genesis |
| 11-22-2003, 01:00 AM | #4 |
Wow, thanks! I'll try this out. Now I know a handful of Jass, whee! EDIT: A very basic JASS question; the code didn't compile because it was expecting the end of a line. How do I put one in? |
