• 🏆 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!

[Trigger] Several identical triggers, used at the same time.

Status
Not open for further replies.
Level 6
Joined
May 31, 2008
Messages
218
I'm wondering about this trigger:
  • Income region Cape of Elonar
    • Events
      • Time - Every 180.00 seconds of game time
    • Conditions
      • (Owner of Region capitol 0150 <gen>) Not equal to Neutral Hostile
    • Actions
      • Set food_point[0] = (Position of Food Income 0148 <gen>)
      • Set gold_point[0] = (Position of Gold Income 0147 <gen>)
      • Set gold_point[1] = (Position of Gold Income 0149 <gen>)
      • Set regional_point[0] = (Position of Region capitol 0150 <gen>)
      • Set wood_point[0] = (Position of Wood Income 0146 <gen>)
      • If ((Owner of Food Income 0148 <gen>) Equal to (Owner of Region capitol 0150 <gen>)) then do (Unit - Create 2 Food Horse for (Owner of Region capitol 0150 <gen>) at food_point[0] facing regional_point[0]) else do (If (((Owner of Food Income 0148 <gen>) is an ally of (Owner of Region capitol 0150 <gen>)) Equal to True) then do (Unit - Create 2 Food Horse for (Owner of Food Income 0148 <gen>) at food_point[0] facing Default building facing degrees) else do (Do nothing))
      • Unit Group - Order (Last created unit group) to Move To regional_point[0]
      • If ((Owner of Gold Income 0149 <gen>) Equal to (Owner of Region capitol 0150 <gen>)) then do (Unit - Create 2 Gold Horse for (Owner of Region capitol 0150 <gen>) at gold_point[1] facing gold_point[0]) else do (If (((Owner of Gold Income 0149 <gen>) is an ally of (Owner of Region capitol 0150 <gen>)) Equal to True) then do (Unit - Create 2 Gold Horse for (Owner of Gold Income 0149 <gen>) at gold_point[1] facing Default building facing degrees) else do (Do nothing))
      • Unit Group - Order (Last created unit group) to Move To regional_point[0]
      • If ((Owner of Gold Income 0147 <gen>) Equal to (Owner of Region capitol 0150 <gen>)) then do (Unit - Create 2 Gold Horse for (Owner of Region capitol 0150 <gen>) at gold_point[0] facing gold_point[0]) else do (If (((Owner of Gold Income 0147 <gen>) is an ally of (Owner of Region capitol 0150 <gen>)) Equal to True) then do (Unit - Create 2 Gold Horse for (Owner of Gold Income 0147 <gen>) at gold_point[0] facing Default building facing degrees) else do (Do nothing))
      • Unit Group - Order (Last created unit group) to Move To regional_point[0]
      • If ((Owner of Wood Income 0146 <gen>) Equal to (Owner of Region capitol 0150 <gen>)) then do (Unit - Create 2 Wood Horse for (Owner of Region capitol 0150 <gen>) at wood_point[0] facing Gate_pos[0]) else do (If (((Owner of Wood Income 0146 <gen>) is an ally of (Owner of Region capitol 0150 <gen>)) Equal to True) then do (Unit - Create 2 Wood Horse for (Owner of Wood Income 0146 <gen>) at wood_point[0] facing Default building facing degrees) else do (Do nothing))
      • Unit Group - Order (Last created unit group) to Move To regional_point[0]
      • Custom script: call RemoveLocation (udg_gold_point[0])
      • Custom script: call RemoveLocation (udg_food_point[0])
      • Custom script: call RemoveLocation (udg_regional_point[0])
      • Custom script: call RemoveLocation (udg_wood_point[0])
      • Custom script: call RemoveLocation (udg_gold_point[1])
The first question is if the last created unit might cause problems since the units might not be created in enough time and therefore gaining the second move order and then sometimes going to the wrong place(i have several almost identical triggers like this but with different order points)

The second question are if like 40+ of these triggers with just different units set in the variables and different places they walk to, can interfere with each other. They also got the same time when they are used, that is each 180 seconds. I probably change this later so i get no lagg.
 
Level 6
Joined
May 31, 2008
Messages
218
1. No, everything in a trigger happens instantly (providing you have no waits)
2. No, they won't interfere with each other

Why do you have loads of different triggers all happening at exactly the same time? You may as well just put all the actions in the same trigger...

For simplicity, but yes i could add them to the same. And that condition, it's different for different triggers, but i guess i could fix that. But does it really matter if they are in same trigger or in 40 different?
 
Level 6
Joined
May 31, 2008
Messages
218
It doesn't really matter I guess, but wouldn't that solve any problems you might have?

The problem i have is this:
  • Income region City of Deadpeak
    • Events
      • Time - Every 180.00 seconds of game time
    • Conditions
      • (Owner of Region capitol 0221 <gen>) Not equal to Neutral Hostile
    • Actions
      • Set regional_point[21] = (Position of Region capitol 0221 <gen>)
      • Set income_jump[5] = (Center of Income jump north1 <gen>)
      • Set wood_point[21] = (Position of Wood Income 0225 <gen>)
      • Set food_point[21] = (Position of Food Income 0222 <gen>)
      • Set gold_point[42] = (Position of Gold Income 0223 <gen>)
      • Set gold_point[43] = (Position of Gold Income 0224 <gen>)
      • If ((Owner of Gold Income 0223 <gen>) Equal to (Owner of Region capitol 0221 <gen>)) then do (Unit - Create 2 Gold Horse for (Owner of Region capitol 0221 <gen>) at gold_point[42] facing gold_point[0]) else do (If (((Owner of Gold Income 0223 <gen>) is an ally of (Owner of Region capitol 0221 <gen>)) Equal to True) then do (Unit - Create 2 Gold Horse for (Owner of Gold Income 0223 <gen>) at gold_point[42] facing Gate_pos[1]) else do (Do nothing))
      • Unit Group - Order (Last created unit group) to Move To regional_point[21]
      • If ((Owner of Gold Income 0224 <gen>) Equal to (Owner of Region capitol 0221 <gen>)) then do (Unit - Create 2 Gold Horse for (Owner of Region capitol 0221 <gen>) at gold_point[43] facing gold_point[0]) else do (If (((Owner of Gold Income 0224 <gen>) is an ally of (Owner of Region capitol 0221 <gen>)) Equal to True) then do (Unit - Create 2 Gold Horse for (Owner of Gold Income 0224 <gen>) at gold_point[43] facing Gate_pos[1]) else do (Do nothing))
      • Unit Group - Order (Last created unit group) to Move To income_jump[5]
      • If ((Owner of Food Income 0222 <gen>) Equal to (Owner of Region capitol 0221 <gen>)) then do (Unit - Create 2 Food Horse for (Owner of Region capitol 0221 <gen>) at food_point[21] facing regional_point[0]) else do (If (((Owner of Food Income 0222 <gen>) is an ally of (Owner of Region capitol 0221 <gen>)) Equal to True) then do (Unit - Create 2 Food Horse for (Owner of Food Income 0222 <gen>) at food_point[21] facing Default building facing degrees) else do (Do nothing)
      • Unit Group - Order (Last created unit group) to Move To regional_point[21]
      • If ((Owner of Wood Income 0225 <gen>) Equal to (Owner of Region capitol 0221 <gen>)) then do (Unit - Create 2 Wood Horse for (Owner of Region capitol 0221 <gen>) at wood_point[21] facing Gate_pos[0]) else do (If (((Owner of Wood Income 0225 <gen>) is an ally of (Owner of Region capitol 0221 <gen>)) Equal to True) then do (Unit - Create 2 Wood Horse for (Owner of Wood Income 0225 <gen>) at wood_point[21] facing Default building facing degrees) else do (Do nothing)
      • Unit Group - Order (Last created unit group) to Move To income_jump[5]
      • Custom script: call RemoveLocation (udg_gold_point[42])
      • Custom script: call RemoveLocation (udg_food_point[21])
      • Custom script: call RemoveLocation (udg_regional_point[21])
      • Custom script: call RemoveLocation (udg_wood_point[21])
      • Custom script: call RemoveLocation (udg_gold_point[43])
      • Custom script: call RemoveLocation (udg_income_jump[5])
As you see there are 2 different places that the units are given orders to move to. The problem is that the first 2 created units that are created at gold income 0223 and then are supposed to move to regional point 21 starts moving towards income_jump 5.
The same thing happens for the units created at the food income, they do not follow the given orders to move to regional point 21 instead they move towards income_jump 5. I am not sure why this happens as sometimes it just happens the first time they are created. But i have to look at this more really to see any pattern. But could i add an wait between the 4 parts of the trigger?(Each part are when 2 units are created and give order to move the the regionalpoint or the income jump.)
 
Level 6
Joined
May 31, 2008
Messages
218
Hmm that's kinda hard to read. Please change it to if-then-else do multiple actions.

Oki, i just change the first trigger, the second ones are almost the same but you just need to know the basic outline of the trigger.

  • Income region City of Deadpeak
    • Events
      • Time - Every 180.00 seconds of game time
    • Conditions
      • (Owner of Region capitol 0221 <gen>) Not equal to Neutral Hostile
    • Actions
      • Set regional_point[21] = (Position of Region capitol 0221 <gen>)
      • Set income_jump[5] = (Center of Income jump north1 <gen>)
      • Set wood_point[21] = (Position of Wood Income 0225 <gen>)
      • Set food_point[21] = (Position of Food Income 0222 <gen>)
      • Set gold_point[42] = (Position of Gold Income 0223 <gen>)
      • Set gold_point[43] = (Position of Gold Income 0224 <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of Gold Income 0223 <gen>) Equal to (Owner of Region capitol 0221 <gen>)
        • Then - Actions
          • Unit - Create 2 Gold Horse for (Owner of Region capitol 0221 <gen>) at gold_point[42] facing Default building facing degrees
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of Gold Income 0223 <gen>) is an ally of (Owner of Region capitol 0221 <gen>)) Equal to True
            • Then - Actions
              • Unit - Create 2 Gold Horse for (Owner of Gold Income 0223 <gen>) at gold_point[42] facing Default building facing degrees
            • Else - Actions
              • Do nothing
      • Unit Group - Order (Last created unit group) to Move To regional_point[21]
      • If ((Owner of Gold Income 0224 <gen>) Equal to (Owner of Region capitol 0221 <gen>)) then do (Unit - Create 2 Gold Horse for (Owner of Region capitol 0221 <gen>) at gold_point[43] facing gold_point[0]) else do (If (((Owner of Gold Income 0224 <gen>) is an ally of (Owner of Region capitol 0221 <gen>)) Equal to True) then do (Unit - Create 2 Gold Horse for (Owner of Gold Income 0224 <gen>) at gold_point[43] facing Gate_pos[1]) else do (Do nothing))
      • Unit Group - Order (Last created unit group) to Move To income_jump[5]
      • If ((Owner of Food Income 0222 <gen>) Equal to (Owner of Region capitol 0221 <gen>)) then do (Unit - Create 2 Food Horse for (Owner of Region capitol 0221 <gen>) at food_point[21] facing regional_point[0]) else do (If (((Owner of Food Income 0222 <gen>) is an ally of (Owner of Region capitol 0221 <gen>)) Equal to True) then do (Unit - Create 2 Food Horse for (Owner of Food Income 0222 <gen>) at food_point[21] facing Default building facing degrees) else do (Do nothing)
      • Unit Group - Order (Last created unit group) to Move To regional_point[21]
      • If ((Owner of Wood Income 0225 <gen>) Equal to (Owner of Region capitol 0221 <gen>)) then do (Unit - Create 2 Wood Horse for (Owner of Region capitol 0221 <gen>) at wood_point[21] facing Gate_pos[0]) else do (If (((Owner of Wood Income 0225 <gen>) is an ally of (Owner of Region capitol 0221 <gen>)) Equal to True) then do (Unit - Create 2 Wood Horse for (Owner of Wood Income 0225 <gen>) at wood_point[21] facing Default building facing degrees) else do (Do nothing)
      • Unit Group - Order (Last created unit group) to Move To income_jump[5]
      • Custom script: call RemoveLocation (udg_gold_point[42])
      • Custom script: call RemoveLocation (udg_food_point[21])
      • Custom script: call RemoveLocation (udg_regional_point[21])
      • Custom script: call RemoveLocation (udg_wood_point[21])
      • Custom script: call RemoveLocation (udg_gold_point[43])
      • Custom script: call RemoveLocation (udg_income_jump[5])
 
Level 6
Joined
May 31, 2008
Messages
218
when that do nothing happens (AKA there is no last created unit group) it will just order the units created in the previous if-then-else to move to that point.

Then i guess the problem with units walking to other points are just random or created by something else : /
 
Status
Not open for further replies.
Top