• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Lot of simple triggers or one complicated?

Status
Not open for further replies.
Level 3
Joined
Jul 7, 2009
Messages
45
Well this is the question. Is is better to have triggers sepperate into simple ones like this example:

  • Trigger 1
    • Events
      • Unit - A unit owned by Player 1 (Red) Gains a level
    • Conditions
      • (Hero level of (Leveling Hero)) Equal to 5
    • Actions
      • Unit - Remove Heal (stage 1) from Storage Area 0000 <gen>
      • Unit - Add Heal (stage 2) to Storage Area 0000 <gen>
      • Trigger - Turn off (This trigger)
  • Trigger 2
    • Events
      • Unit - A unit owned by Player 1 (Red) Gains a level
    • Conditions
      • (Hero level of (Leveling Hero)) Equal to 10
    • Actions
      • Unit - Remove Heal (stage 2) from Storage Area 0000 <gen>
      • Unit - Add Heal (stage 3) to Storage Area 0000 <gen>
      • Trigger - Turn off (This trigger)
Or to have both triggers in one like this:

  • Only Trigger
    • Events
      • Unit - A unit owned by Player 1 (Red) Gains a level
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero level of (Leveling Hero)) Equal to 5
        • Then - Actions
          • Unit - Remove Heal (stage 1) from Storage Area 0000 <gen>
          • Unit - Add Heal (stage 2) to Storage Area 0000 <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Leveling Hero)) Equal to 10
            • Then - Actions
              • Unit - Remove Heal (stage 2) from Storage Area 0000 <gen>
              • Unit - Add Heal (stage 3) to Storage Area 0000 <gen>
            • Else - Actions


Does that make any difference?
 
I personally like it in one trigger, it gets confusing when you have a bunch of triggers doing practically the same thing, but for a different person, unit, etc..
 
Last edited:
Moin moin =)

I know only, that the map has a bigger size when you do every time a single trigger instead of combine them. I made a test map with 10 single triggers (event, condition, action) [16,9 kb] and a test map with one trigger and 10 if - then - else [15,9 kb].

Also I think it's faster if you have 2 trigger in 1 instead of having 2 different triggers, because the if you do an action in game, the game checks if one of the trigger match the current action and this would be faster if only one trigger is executed instead of two and more.

The only thing I can say for sure is that it's better to have one initialization trigger instead of more triggers with the map initialization event!

Greetings and Peace
Dr. Boom
 
Status
Not open for further replies.
Back
Top