• 🏆 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] Adding abilities to group issue

Status
Not open for further replies.
Level 11
Joined
Aug 11, 2009
Messages
594
What the triggers are supposed to do is add some random passives to a group of units that spawn at the beginning of the map. However, only the first group recieves their random abilities, the next group gets none. I will post all the triggers below. Would be very grateful if anyone could find the problem.

--- SPAWNING TRIGGERS ---

  • Spawn Elites 1 DF
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • -------- The Dark Forest --------
      • Set Integer_Randomizer = (Random integer number between 1 and 2)
      • Set Unit_EliteSpawn = Unit_EliteType[Integer_Randomizer]
      • Set Integer_Randomizer = (Random integer number between 1 and 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Randomizer Equal to Integer_NoSpawn
        • Then - Actions
          • Trigger - Run Spawn Elites 1 DF <gen> (checking conditions)
        • Else - Actions
          • Set Integer_NoSpawn = Integer_Randomizer
          • For each (Integer A) from 1 to 3, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Unit_EliteSpawn for Player 1 (Red) at Point_DFEliteSpawn[Integer_Randomizer] facing Default building facing degrees
              • Unit Group - Add (Last created unit) to UnitGroup_Elite[1]
          • Set Integer_EliteGroup = 1
          • Trigger - Run Set Affix 1 <gen> (checking conditions)
  • Spawn Elites 2 DF
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • -------- The Dark Forest --------
      • Set Integer_Randomizer = (Random integer number between 1 and 2)
      • Set Unit_EliteSpawn = Unit_EliteType[Integer_Randomizer]
      • Set Integer_Randomizer = (Random integer number between 1 and 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Randomizer Equal to Integer_NoSpawn
        • Then - Actions
          • Trigger - Run Spawn Elites 2 DF <gen> (checking conditions)
        • Else - Actions
          • Set Integer_NoSpawn = 0
          • For each (Integer A) from 1 to 3, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Unit_EliteSpawn for Player 1 (Red) at Point_DFEliteSpawn[Integer_Randomizer] facing Default building facing degrees
              • Unit Group - Add (Last created unit) to UnitGroup_Elite[2]
          • Set Integer_EliteGroup = 2
          • Trigger - Run Set Affix 1 <gen> (checking conditions)
--- ABILITY TRIGGERS ---

  • Set Affix 1
    • Events
    • Conditions
    • Actions
      • Set Integer_Randomizer = (Random integer number between 1 and 8)
      • Set Ability_EliteAffix2[1] = Ability_EliteAffix[Integer_Randomizer]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Ability_EliteAffix2[1] Equal to War Stomp (Neutral Hostile 1)
        • Then - Actions
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
          • Set Ability_EliteAffix[Integer_Randomizer] = War Stomp (Neutral Hostile 1)
          • Unit Group - Pick every unit in UnitGroup_Elite[Integer_EliteGroup] and do (Actions)
            • Loop - Actions
              • Unit - Add Ability_EliteAffix2[Integer_Randomizer] to (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Difficulty_Nightmare Equal to True
                  • Difficulty_Hell Equal to True
                  • Difficulty_Inferno Equal to True
            • Then - Actions
              • Trigger - Run Set Affix 2 <gen> (checking conditions)
            • Else - Actions
              • Trigger - Run Reset Affixes <gen> (checking conditions)
  • Set Affix 2
    • Events
    • Conditions
    • Actions
      • Set Integer_Randomizer = (Random integer number between 1 and 8)
      • Set Ability_EliteAffix2[2] = Ability_EliteAffix[Integer_Randomizer]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Ability_EliteAffix2[2] Equal to War Stomp (Neutral Hostile 1)
        • Then - Actions
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
          • Set Ability_EliteAffix[Integer_Randomizer] = War Stomp (Neutral Hostile 1)
          • Unit Group - Pick every unit in UnitGroup_Elite[Integer_EliteGroup] and do (Actions)
            • Loop - Actions
              • Unit - Add Ability_EliteAffix2[2] to (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Difficulty_Hell Equal to True
                  • Difficulty_Inferno Equal to True
            • Then - Actions
              • Trigger - Run Set Affix 3 <gen> (checking conditions)
            • Else - Actions
              • Trigger - Run Reset Affixes <gen> (checking conditions)
  • Set Affix 3
    • Events
    • Conditions
    • Actions
      • Set Integer_Randomizer = (Random integer number between 1 and 8)
      • Set Ability_EliteAffix2[3] = Ability_EliteAffix[Integer_Randomizer]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Ability_EliteAffix2[3] Equal to War Stomp (Neutral Hostile 1)
        • Then - Actions
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
          • Set Ability_EliteAffix[Integer_Randomizer] = War Stomp (Neutral Hostile 1)
          • Unit Group - Pick every unit in UnitGroup_Elite[Integer_EliteGroup] and do (Actions)
            • Loop - Actions
              • Unit - Add Ability_EliteAffix2[3] to (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Difficulty_Inferno Equal to True
            • Then - Actions
              • Trigger - Run Set Affix 4 <gen> (checking conditions)
            • Else - Actions
              • Trigger - Run Reset Affixes <gen> (checking conditions)
  • Set Affix 4
    • Events
    • Conditions
    • Actions
      • Set Integer_Randomizer = (Random integer number between 1 and 8)
      • Set Ability_EliteAffix2[4] = Ability_EliteAffix[Integer_Randomizer]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Ability_EliteAffix2[4] Equal to War Stomp (Neutral Hostile 1)
        • Then - Actions
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
          • Unit Group - Pick every unit in UnitGroup_Elite[Integer_EliteGroup] and do (Actions)
            • Loop - Actions
              • Unit - Add Ability_EliteAffix2[4] to (Picked unit)
          • Trigger - Run Reset Affixes <gen> (checking conditions)
  • Reset Affixes
    • Events
    • Conditions
    • Actions
      • Set Ability_EliteAffix[1] = Deflect [Elite Affix]
      • Set Ability_EliteAffix[2] = Fast [Elite Affix]
      • Set Ability_EliteAffix[3] = Fiery Soul [Elite Affix]
      • Set Ability_EliteAffix[4] = Might [Elite Affix]
      • Set Ability_EliteAffix[5] = Reflect [Elite Affix]
      • Set Ability_EliteAffix[6] = Stoneskin [Elite Affix]
      • Set Ability_EliteAffix[7] = Vampiric [Elite Affix]
      • Set Ability_EliteAffix[8] = Frozen Soul [Elite Affix]
Thanks for any help on this, +rep ofc.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Level 11
Joined
Aug 11, 2009
Messages
594
How do I check the random number?
I replaced Integer A with my own variable, didnt solve the problem.
Made a debugg check and everything runs as it should. So there must be some problem with identifying the group or something?
 
Level 11
Joined
Aug 11, 2009
Messages
594
That solved it! Thanks alot!
Do you perhaps know how to make it more random? Since it seems random number between x and y always gives the same numbers :/
 
Status
Not open for further replies.
Top