| 05-30-2003, 03:28 AM | #1 |
I'm working on an aos type map. when the hero dies i want it to revive ( 10 x hero level ) seconds. but my triggers are not working and i cant figure out why...plz help trigger 1 ---Events--- Unit owned by Player 2 is revived etc... to player 12 --Conditions--- Triggering unit is a hero = true --Actions-- countdown timer - start heroTimer[Player numer of (triggering player))] as a one shot timer that will expire in (10.0 x Real((Hero level of (triggering unit))) trigger 2 --Events-- heroTimer[2] expires --Actions-- Hero instantly Revive Hero[2] at [region] <-- hero[array] set at hero selection. i have other triggers for the consequtive array values thru 12. that is what i have...but it dosnt work... if anyone knows why its not working plz let me know...thanks.... |
| 05-30-2003, 03:46 AM | #2 |
Guest | You might want to try something more simple, like: EVENT: Unit - A unit owned by Player X Dies CONDITIONS Boolean - (Dying Unit is (a Hero)) Equal to True ACTIONS Wait - Wait (Real((Hero Level of (Dying Unit))) X 10.00 seconds) Hero - Instantly revive (Dying Unit), at center of Region X, Hide/Show revive animation. Hope that helps. |
| 05-30-2003, 03:48 AM | #3 |
i was thinking about that, but i wasnt sure with wait times and multiplayer... but if i only have that one wait....will it work? |
| 05-30-2003, 03:52 AM | #4 |
Guest | It should, yes. I've got the same trigger (More actions though) running in a map with no problems. If that fails, you can use the If/Then/Else action to create 10 different Wait times in the same trigger. Ex: - If Hero Level of Dying Unit is Equal to 1, then Wait 10 seconds, else do nothing. - If Hero Level of Dying Unit is Equal to 2, then Wait 20 seconds, else do nothing. And then add the Reive trigger at the end of them all. |
| 05-31-2003, 12:46 PM | #5 |
Nagohisa's method WONT work (i think) first off.. create new variables (type=integer) name it P1gainLvL, P2gainLvL, etc. 1 -event: unit- a unit owned by player1 red gains a lvl -condition: (trigger unit)is a hero equals to true -action: set P1gainLvL = (P1gainLvL +1) 2. repeate for P2gainLvL and others as necessary 3. -event: unit- a unit owned by player1 red dies -condition: (tirgger unit) is a hero equals to true -action: wait (P1gainLvL * {input ur time here}) hero- instant revive at (region) show revil graphics. 4. repeate for P2gainLvL and others as necessary. I personally like to use this wait of 17sec (lvl1) 24sec(lvl2) 31sec (lvl3)etc.. instead of the usual wait 7,14,21,28sec.. I feel low lvl are not penlized enough for wait time as it should be. To achive this I use the following method -action: wait (10+(P1gainLvL *7)seconds. *EDIT* now that I've reread Nagohisa's method. I DONT think his will work. *REEDIT* now that I've understand what array is used for. I would recommend use array but since I havent acually test it using the array method. I'll just leave the example I have listed it above. Its long way but it works. |
| 05-31-2003, 01:24 PM | #6 |
Be sure to use ARRAYS and not single variables for the LVL gain. |
| 05-31-2003, 01:48 PM | #7 |
I dont understand why you would need to use Array in this particular case. Care to enlighten me Dead-Insider?? My trigger works fine without the array. |
| 05-31-2003, 02:10 PM | #8 |
Guest | dead is right. your ways works but you have 10 variables where you would have 1 with an array. obviously this is better. also, while your way works it requires triggers that arent really needed, why have a trigger to find what you can get in an action inside the trigger? unless you use hero levels for a bunch of stuff. |
| 05-31-2003, 02:54 PM | #9 |
oh my... I think I finally understand what array does.. too bad i've already created and used my method (without array) so much work... I though I knew how array works but thx to you M.Jumbo I think I finally understand. damn.. I wish I figure this out sooner. No wonder I have so many integers lol. I must have like 50-60 it was such a pain to go though all of them :( thx though.. *Edit* when i said integers I meant variable also reedited my previous post(the one with the solution) |
| 05-31-2003, 02:56 PM | #10 |
The reason is very simple : While he starts a trigger sleep action (WAIT) , the game will wait the amount of time required before he revives "Dying Unit" The problem is that between the beginning and the end of the wait, the trigger sleeps but the game goes on, then if any other unit dies, it will change the "Dying" Unit in question. Then it won't revive the right unit when the triggers goes off sleep. There is only one easy workaround this : Store the dying unit in a local before the wait starts variable . What you must do is convert your trigger in custom text. Then First, just after the line "function Trig_*Your Trigger Name*_Actions", add this one : local unit TempUnit = GetDyingUnit() Then, in the last line of that function, just before endfuntion, replace GetDyingUnit() with TempUnit You would be done. If you don't manage to do this, convert your trigger to custom text, post that ct version here and i'll modify it for you. Regards |
