• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Using an Array Timer for more than 1 trigger

Status
Not open for further replies.
Level 2
Joined
Aug 11, 2009
Messages
22
My question is: how can i create a functional and effective trigger system, which creates resurrection timers for every dead hero. from this hp i learned that using "Unit dies" then "Wait" , "Revive Unit" is neither effective nor it always deletes the timer window if using "Destroy Last Created Timer Window" caus of overwritten variables. So i created a trigger which looks like this:
Revive
Ereignisse
Einheit - A unit Stirbt
Bedingungen
((Triggering unit) is Ein Held) Gleich True
Aktionen
Set HeroOwnerArray[(Player number of (Owner of (Triggering unit)))] = (Owner of (Triggering unit))
Set DeadHeroArray[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
((Owner of (Triggering unit)) Aktuelles Holz) Größer gleich (Hero level of (Triggering unit))
'THEN'-Aktionen
Countdown-Timer - Start ReviveArray[(Player number of (Owner of (Triggering unit)))] as a Einmalig timer that will expire in (((Real((Hero level of (Triggering unit)))) / 2.00) + 2.00) seconds
Spieler - Add (-1 x (Hero level of (Triggering unit))) to (Owner of (Triggering unit)) Aktuelles Holz
'ELSE'-Aktionen
Countdown-Timer - Start ReviveArray[(Player number of (Owner of (Triggering unit)))] as a Einmalig timer that will expire in ((Real((Hero level of (Triggering unit)))) + 4.00) seconds


Countdown-Timer - Create a timer window for (Last started timer) with title Resurrection in:
Set ReviveWindowArray[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
Countdown-Timer - Verbergen ReviveWindowArray[(Player number of (Owner of (Triggering unit)))]
Countdown-Timer - Zeigen ReviveWindowArray[(Player number of (Owner of (Triggering unit)))] for (Owner of (Triggering unit))


I hope you guys understand it since some words in it are german (shouldnt be so hard, though ;) )

my problem is: if i create a new trigger: "Timer expires" i dont know what to do. if i use my TimerArray i have to set the index too. but i just dont get it how to import the index from the other trigger since every variable from the 1. trigger is an array and therefore requires another index. i actually found a wellworking trigger, but my problem is: its in jass which i really cant handle... copying the trigger wouldnt be a problem but i want some more actions to it (e.g. random spawns, different respawn time for heroes with lumber etc).
please help me either by posting a solution to this or showing me another way of creating an effective and nonleaking resurrection trigger
ty
(p.s. new to hive and dont know how to import pictures... sorry for that)
 
Last edited:
Status
Not open for further replies.
Top