• 🏆 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 does not happen

TDO

TDO

Level 1
Joined
Feb 1, 2024
Messages
1
I'm making a map with pirates. The pirates come from the center island and do pirate Raids in the player's Islands, but only if they have a "Hotel de ville" or a "Donjon", because otherwise they wouldn't be able to defend.
To do this, i used Unity Groups and made it select all unities into each of the player islands, then only if the unity was of type Hotel de ville OR if it was of type Donjon, it would summon a random number of Pirate Ships and Frigates then select a random region to attack between two regions (per island)

I added a cheat code to Test these pirate Raids, wich was /TestWave, but when i test it, literally nothing happens.
Also, i know about memory leaks and all that stuff but i know it's not related to that, because literally nothing happens.
I also added a Hotel de Ville to the Red Island, and i am not the Pirate Leader.

Heres the trigger :
  • PirateWavesStep1
    • Evénements
      • Temps - Every 450.00 seconds of game time
      • Joueur - Joueur 1 (Rouge) types a chat message containing /TestWave as Résultat équivalent
    • Conditions
    • Actions
      • Groupe unité - Pick every unit in (Units in RedIsland <gen>) and do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Unit-type of (Picked unit)) Egal à Hotel de ville) or ((Unit-type of (Picked unit)) Egal à Donjon)
              • (Owner of (Picked unit)) Différent de PirateLeader
            • Alors - Actions
              • Set Strongold[1] = (Picked unit)
              • For each (Integer A) from 0 to (Random integer number between 2 and 4), do (Actions)
                • Boucle - Actions
                  • Wait 1.50 seconds
                  • Unité - Create 1 Navire Pirate for Joueur 9 (gris) at (Position of Chantier Naval des pirates 0048 <gen>) facing Orientation bâtiment par défaut degrees
                  • Groupe unité - Add (Last created unit) to Pillards[1]
              • For each (Integer A) from 0 to (Random integer number between 3 and 4), do (Actions)
                • Boucle - Actions
                  • Wait 1.50 seconds
                  • Unité - Create 1 Frégate Pirate for Joueur 9 (gris) at (Position of Chantier Naval des pirates 0048 <gen>) facing Orientation bâtiment par défaut degrees
                  • Groupe unité - Add (Last created unit) to Pillards[1]
              • Set LieuAbbordage = (Random integer number between 0 and 1)
              • Wait 10.00 seconds
              • Groupe unité - Pick every unit in Pillards[1] and do (If (LieuAbbordage Egal à 0) then do (Unité - Order (Picked unit) to Avancer vers (Random point in AbbordageRedA <gen>)) else do (Unité - Order (Picked unit) to Avancer vers (Random point in AbbordageRedB <gen>)))
            • Sinon - Actions
              • Do nothing
      • Groupe unité - Pick every unit in (Units in BlueIsland <gen>) and do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Unit-type of (Picked unit)) Egal à Hotel de ville) or ((Unit-type of (Picked unit)) Egal à Donjon)
              • (Owner of (Picked unit)) Différent de PirateLeader
            • Alors - Actions
              • Set Strongold[2] = (Picked unit)
              • For each (Integer A) from (Random integer number between 0 and 0) to (Random integer number between 1 and 3), do (Actions)
                • Boucle - Actions
                  • Wait 1.50 seconds
                  • Unité - Create 1 Navire Pirate for Joueur 9 (gris) at (Position of Chantier Naval des pirates 0142 <gen>) facing Orientation bâtiment par défaut degrees
                  • Groupe unité - Add (Last created unit) to Pillards[2]
              • For each (Integer A) from (Random integer number between 0 and 0) to (Random integer number between 2 and 4), do (Actions)
                • Boucle - Actions
                  • Wait 1.50 seconds
                  • Unité - Create 1 Frégate Pirate for Joueur 9 (gris) at (Position of Chantier Naval des pirates 0142 <gen>) facing Orientation bâtiment par défaut degrees
                  • Groupe unité - Add (Last created unit) to Pillards[2]
              • Wait 5.00 seconds
              • Groupe unité - Pick every unit in Pillards[2] and do (If (LieuAbbordage Egal à 0) then do (Unité - Order (Picked unit) to Avancer vers (Random point in AbbordageBlueA <gen>)) else do (Unité - Order (Picked unit) to Avancer vers (Random point in AbbordageBlueB <gen>)))
              • Set LieuAbbordage = (Random integer number between 0 and 1)
            • Sinon - Actions
              • Do nothing
      • Groupe unité - Pick every unit in (Units in CyanIsland <gen>) and do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Unit-type of (Picked unit)) Egal à Hotel de ville) or ((Unit-type of (Picked unit)) Egal à Donjon)
              • (Owner of (Picked unit)) Différent de PirateLeader
            • Alors - Actions
              • Set Strongold[3] = (Picked unit)
              • For each (Integer A) from (Random integer number between 0 and 0) to (Random integer number between 1 and 3), do (Actions)
                • Boucle - Actions
                  • Wait 1.50 seconds
                  • Unité - Create 1 Navire Pirate for Joueur 9 (gris) at (Position of Chantier Naval des pirates 0142 <gen>) facing Orientation bâtiment par défaut degrees
                  • Groupe unité - Add (Last created unit) to Pillards[3]
              • For each (Integer A) from (Random integer number between 0 and 0) to (Random integer number between 2 and 4), do (Actions)
                • Boucle - Actions
                  • Wait 1.50 seconds
                  • Unité - Create 1 Frégate Pirate for Joueur 9 (gris) at (Position of Chantier Naval des pirates 0142 <gen>) facing Orientation bâtiment par défaut degrees
                  • Groupe unité - Add (Last created unit) to Pillards[3]
              • Wait 5.00 seconds
              • Groupe unité - Pick every unit in Pillards[3] and do (If (LieuAbbordage Egal à 0) then do (Unité - Order (Picked unit) to Avancer vers (Random point in AbbordageCyanA <gen>)) else do (Unité - Order (Picked unit) to Avancer vers (Random point in AbbordageCyanB <gen>)))
              • Set LieuAbbordage = (Random integer number between 0 and 1)
            • Sinon - Actions
              • Do nothing
      • Groupe unité - Pick every unit in (Units in PurpleIsland <gen>) and do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Unit-type of (Picked unit)) Egal à Hotel de ville) or ((Unit-type of (Picked unit)) Egal à Donjon)
              • (Owner of (Picked unit)) Différent de PirateLeader
            • Alors - Actions
              • Set Strongold[4] = (Picked unit)
              • For each (Integer A) from (Random integer number between 0 and 0) to (Random integer number between 1 and 3), do (Actions)
                • Boucle - Actions
                  • Wait 1.50 seconds
                  • Unité - Create 1 Navire Pirate for Joueur 9 (gris) at (Position of Chantier Naval des pirates 0048 <gen>) facing Orientation bâtiment par défaut degrees
                  • Groupe unité - Add (Last created unit) to Pillards[4]
              • For each (Integer A) from (Random integer number between 0 and 0) to (Random integer number between 2 and 4), do (Actions)
                • Boucle - Actions
                  • Wait 1.50 seconds
                  • Unité - Create 1 Frégate Pirate for Joueur 9 (gris) at (Position of Chantier Naval des pirates 0048 <gen>) facing Orientation bâtiment par défaut degrees
                  • Groupe unité - Add (Last created unit) to Pillards[4]
              • Wait 5.00 seconds
              • Groupe unité - Pick every unit in Pillards[4] and do (If (LieuAbbordage Egal à 0) then do (Unité - Order (Picked unit) to Avancer vers (Random point in AbbordagePurpleA <gen>)) else do (Unité - Order (Picked unit) to Avancer vers (Random point in AbbordagePurpleB <gen>)))
              • Set LieuAbbordage = (Random integer number between 0 and 1)
            • Sinon - Actions
              • Do nothing
 
Level 24
Joined
Jun 26, 2020
Messages
1,853
The game literally tells you that you shouldn't use Waits inside that "Pick Every Unit" actions:
1706825119756.png
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
In addition to the above:
  • Waits inside of loops are bad ideas unless you use a unique integer variable for that specific loop only. Multiple such loops happening simultaneously can interfere with each other's loop bounds and current loop index.
  • Do Nothing is pointless and should never be used
  • Random integer number between 0 and 0 is funny
  • You are creating a lot of memory leaks. When testing this doesn't matter but you should know about it for the long term: Things That Leak
 
Top