• 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] +REP Seemingly flawless triggers wont work

Status
Not open for further replies.
Okay, so in my map I have four spawn points that spawn units.
Each point has it's own trigger to spawn the units.
Inside the trigger it adds the spawned units to a group.
Another trigger than calls all of the groups and gives them orders depending on what is going on in the map.
Only one of the groups responds to it's orders.
I am very confused.
I think the problem has to do with assigning the groups.
Here are the triggers:


  • ORC DOCK 1
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SPAWNraider Equal to True
            • Then - Actions
              • Custom script: set bj_forLoopAIndex = 1
              • Unit - Create 2 Grunt for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add all units of (Last created unit group) to ORCgroup[(Integer A)]
              • Unit - Create 1 Raider for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add (Last created unit) to ORCgroup[(Integer A)]
              • Unit - Create 1 Forest Troll Berserker for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add (Last created unit) to ORCgroup[(Integer A)]
            • Else - Actions
              • Custom script: set bj_forLoopAIndex = 1
              • Unit - Create 3 Grunt for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add all units of (Last created unit group) to ORCgroup[(Integer A)]
              • Unit - Create 1 Forest Troll Berserker for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add (Last created unit) to ORCgroup[(Integer A)]
        • Else - Actions


  • ORC DOCK 2
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SPAWNogre Equal to True
            • Then - Actions
              • Custom script: set bj_forLoopAIndex = 2
              • Unit - Create 3 Grunt for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add all units of (Last created unit group) to ORCgroup[(Integer A)]
              • Unit - Create 1 Stonemaul Ogre for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add (Last created unit) to ORCgroup[(Integer A)]
            • Else - Actions
              • Custom script: set bj_forLoopAIndex = 2
              • Unit - Create 4 Grunt for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add all units of (Last created unit group) to ORCgroup[(Integer A)]
        • Else - Actions


  • ORC DOCK 3
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SPAWNogre Equal to True
            • Then - Actions
              • Custom script: set bj_forLoopAIndex = 3
              • Unit - Create 3 Grunt for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add all units of (Last created unit group) to ORCgroup[(Integer A)]
              • Unit - Create 1 Stonemaul Ogre for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add (Last created unit) to ORCgroup[(Integer A)]
            • Else - Actions
              • Custom script: set bj_forLoopAIndex = 3
              • Unit - Create 4 Grunt for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add all units of (Last created unit group) to ORCgroup[(Integer A)]
        • Else - Actions


  • ORC DOCK 4
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SPAWNraider Equal to True
            • Then - Actions
              • Custom script: set bj_forLoopAIndex = 4
              • Unit - Create 2 Grunt for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add all units of (Last created unit group) to ORCgroup[(Integer A)]
              • Unit - Create 1 Raider for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add (Last created unit) to ORCgroup[(Integer A)]
              • Unit - Create 1 Forest Troll Berserker for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add (Last created unit) to ORCgroup[(Integer A)]
            • Else - Actions
              • Custom script: set bj_forLoopAIndex = 4
              • Unit - Create 3 Grunt for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add all units of (Last created unit group) to ORCgroup[(Integer A)]
              • Unit - Create 1 Forest Troll Berserker for WaveOwner at (Random point in DOCKlandings[(Integer A)]) facing 90.00 degrees
              • Unit Group - Add (Last created unit) to ORCgroup[(Integer A)]
        • Else - Actions


It spawns the units for all the spawn zones.
But the units do not respond to the issued orders.
Here is the trigger that orders all the spawn zones to attack:

  • REORDER
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit Group - Order ORCgroup[(Integer A)] to Attack-Move To ORCOrders[(Integer A)]

For some reason this works perfectly with the first group, but not the others.
What exactly is going wrong here? Seems to me it should work just fine.
I have even tried replacing all the (Integer A) in the triggers to the actual numbers, not even that worked.
If anyone can find what is going wrong here I will +REP you.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
I think it might be the "add last created unit group" to unitgroup. Creating N units at once doesn't always work as intended (idk why), but instead, make a loop and create the same unittype multiply types, and add them one by one.

I would also want to inform you, that your triggers leak. Random point in DOCKlandings[(Integer A)]) leaks a point every time you use it, and will not be destroyed by itself, thus adding lagging issues to the map when playing, mostly in multiplayer. Use a temporary variable point and assign the "random point" there. Once you are done with it, destroy it by: Custom script: call RemoveLocation( udg_InsertVariableNameHere )

Edit: And the hive rules says 24 hours to bump, unlessand should provide something more to help the user who reads the thread to know mor about the problem.
Well:
1. Hive Workshop users are permitted to bump their own threads.
2. Threads bumps must include new details and / or information, not just simply a word or vague comment.
3. Threads cannot be bumped within 48 hours of the most recent post.
4. Posts that violate these rules may be deleted by moderators without warning.
5. Threads that consistently violate these rules may be closed after the author has been warned.
 
Level 3
Joined
Feb 13, 2008
Messages
65
Are you aware that you have two if/then/else statements at the beginning of each trigger and the first one is completely superfluous and might/will cause issues in the future.

I think that what keeps on happening is that whatever trigger you have that activates the other 4 keeps on hitting the "else" actions in your first trigger. You probably need to recode the logic behind these triggers
 
Onix noob, I never used a loop, set bj_forLoopAIndex just sets (Integer A) to what I want it, easier CnP :D

The ORCorders point isn't the issue, at the beginning of the map they all have the same orders.

I changed the groups to different group variables instead of a group array and that seemed to work. This makes it more difficult to edit and create more spawns though.
Does not make sense as to why it would not work as an array.
And thanks for the leak spot Eccho, I will patch that up.

Woo 500th post! :D <- just for your signature onix ;)
 
Status
Not open for further replies.
Top