• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] How to simplify a trigger with player bumber

Status
Not open for further replies.
Level 1
Joined
May 22, 2010
Messages
2
Hello everyone. I’d like to ask for help about how to simplify my trigger.

When activates, this ability adds a number of units into a group for a duration, separated by their respective player numbers.
(Assuming 2 or more players playing the same type of Hero)
These groups will be cleared when their respective duration expires.

So I set my trigger up like this:

trigger.jpg

and so on…

Is there any way to simplify it?
I just wonder; if there are more actions involving player numbers, this trigger would be extremely long and complicated to edit after.

Thank you so much for help.
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
Yes, there is an easier way: use loops.

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • For each (Integer Loop_var) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for Abil_Timer[Loop_var]) Equal to 0.00
            • Then - Actions
              • Unit Group - Remove all units from UnitGroup[Loop_var]
            • Else - Actions
Loop_var is integer variable.

Also, do not use "Do nothing" unless necessary. That function really does nothing but take your PCs resources.

However this will also fire for timers which already finished expiration. I had similar problem regarding multiple timers firing one trigger and we solved it by using hashtable. Check this thread: http://www.hiveworkshop.com/forums/world-editor-help-zone-98/finding-out-timer-fired-trigger-246239/
 
Status
Not open for further replies.
Top