| 05-12-2008, 07:37 PM | #1 |
id like to keep track of a units life , that is created during the game when i want to make an event 'unit life' in gui i cannot choose a global unit variable, but only choose a unit that is on the map. converting to text this becomes 'TriggerRegisterUnitLifeEvent(...)', i can put a global variable there and the game will not create an error msg when i start the map, however the trigger will simply not fire. Bug? doesnt work in roc? of course one could simply make a trigger that checks the units life regularly every 10 seconds e.g., but i feel that there should be an easier, way by using the "$%& TriggerRegisterUnitLifeEvent function ... any ideas? ty |
| 05-12-2008, 07:52 PM | #2 |
There is no way to create this event with variables... |
| 05-12-2008, 08:00 PM | #3 |
that means i have to create a trigger that checks all the time and once the condition is satisfied it fires another trigger? ... that sux and it sounds to me like it will eat lots of game recources if you use that on lots of units plus it doesnt make sense to have this for units that are there in the beginning but not for ones that are created during the game no ? ... |
| 05-12-2008, 08:40 PM | #4 |
You have to call TriggerRegisterUnitLifeEvent once the unit is created and a variable points to it. If you use GUI, simply use the Trigger - Add New Event action to add a 'Unit - Life' event to an already existent trigger that initially has no events. That trigger should act as if it were to catch a 'Unit - Life' event. Keep in mind that you must do this each time you want trace a particular unit's HP. This means that modifying the global variable used to add the such event won't do anything to the trigger unless you repeat the whole procedure. Note: I'm not sure whether it will leak or not if you happen to add more of these events as units die, but you could dynamically create and destroy the triggers if you used JASS. |
| 05-13-2008, 02:36 AM | #5 |
Trigger: Trigger: Setup
![]() Conditions
|
| 05-13-2008, 04:54 PM | #6 |
that looks like a tft feature...cant find that in gui i got it running now with checking dynamically every n secs, not sure how stable that is though... thanx 4 help ppl |
