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

WE Random generator broke in my map.

Status
Not open for further replies.
Basicaly Random loc in rect and random integer between x and y always proc the same result in one of my trigger no matter how many time I test it.
There's a lot of random in this trigger.
I generate random size terrain tile in random location in rect with loop integer.
It also generate a random number of unit between x and y for each unit type.
There also a random integer variable between x and y to play a different battle music based on the result.

The result is always the same.Same number of units and also the exact same tile pattern and same music.Not only the trigger always proc the same result in a game but it proc the same result as the other game in every game even if I restart.But that's this trigger only.
Some other trigger proc different random result.

Is it because I have too much random in one trigger or that occurs too many at the same time?

Here's my Trigger
  • Battle engage
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Player Army
    • Actions
      • Trigger - Turn off Combat system <gen>
      • Unit - Hide Castle 0002 <gen>
      • Trigger - Turn off (This trigger)
      • Trigger - Turn off Army select <gen>
      • Set AttackerArmy = (Attacking unit)
      • Unit Group - Remove AttackerArmy from CreepGroup
      • Unit Group - Pick every unit in CreepGroup and do (Unit - Remove (Picked unit) from the game)
      • Unit - Change ownership of Player Army 0114 <gen> to Player 5 (Yellow) and Retain color
      • Unit - Order AttackerArmy to Attack Player Army 0114 <gen>
      • Unit - Order Player Army 0114 <gen> to Attack AttackerArmy
      • Cinematic - Turn cinematic mode On for (All players)
      • Camera - Pan camera for Player 3 (Teal) to (Position of (Triggering unit)) over 0.00 seconds
      • Cinematic - Fade out over 1.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Unit - Add Battling (Neutral) to (Triggering unit)
      • Sound - Play OrcBarracksWhat1 <gen> at 100.00% volume, attached to Player Army 0114 <gen>
      • Wait 1.50 game-time seconds
      • Unit - Pause Player Army 0114 <gen>
      • Set TerrainType[2] = (Position of Player Army 0114 <gen>)
      • Environment - Change terrain type at TerrainType[1] to (Terrain type at TerrainType[2]) using variation -1 in an area of size 20 and shape Square
      • Environment - Change terrain type at spawnloc to (Terrain type at TerrainType[2]) using variation -1 in an area of size 20 and shape Square
      • Environment - Change terrain type at spawnloc2 to (Terrain type at TerrainType[2]) using variation -1 in an area of size 20 and shape Square
      • Trigger - Run RandomTerrain <gen> (checking conditions)
      • Unit - Create 1 Castle for Player 1 (Red) at CastlePoint[1] facing Default building facing degrees
      • Set CastleUnit[1] = (Last created unit)
      • Selection - Clear selection for Player 3 (Teal)
      • Trigger - Run Random army <gen> (checking conditions)
      • Set BattleTheme = (Random integer number between 1 and 3)
      • Sound - Clear the music list
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BattleTheme Equal to 1
        • Then - Actions
          • Sound - Play 18_the_yutaka___battle_10 <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BattleTheme Equal to 2
            • Then - Actions
              • Sound - Play 21_aggressive___battle_13 <gen>
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BattleTheme Equal to 3
                • Then - Actions
                  • Sound - Play 16_dances___battle_8 <gen>
                • Else - Actions
      • Camera - Pan camera for Player 3 (Teal) to spawnloc over 0.00 seconds
      • Camera - Set the camera bounds for Player 3 (Teal) to Battlefield 1 <gen>
      • Wait 0.50 game-time seconds
      • Cinematic - Fade in over 0.50 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Turn cinematic mode Off for (All players)
      • Trigger - Run Army Spawn timer <gen> (ignoring conditions)
      • Countdown Timer - Start Spawntimer as a Repeating timer that will expire in 30.00 seconds
      • Countdown Timer - Show Spawntimerwindow
  • RandomTerrain
    • Events
    • Conditions
    • Actions
      • For each (Integer TerrainInteger) from 3 to 17, do (Actions)
        • Loop - Actions
          • Set TerrainType[TerrainInteger] = (Random point in Battlefield 1 <gen>)
          • Set TileSizeInteger[TerrainInteger] = (Random integer number between 1 and 5)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TerrainType[2]) Equal to Ashenvale - Dirt
            • Then - Actions
              • Environment - Change terrain type at TerrainType[TerrainInteger] to Ashenvale - Grass using variation -1 in an area of size TileSizeInteger[TerrainInteger] and shape Circle
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain type at TerrainType[2]) Equal to Sunken Ruins - Sand
                • Then - Actions
                  • Environment - Change terrain type at TerrainType[TerrainInteger] to Barrens - Desert using variation -1 in an area of size TileSizeInteger[TerrainInteger] and shape Circle
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain type at TerrainType[2]) Equal to Ashenvale - Grassy Dirt
                    • Then - Actions
                      • Environment - Change terrain type at TerrainType[TerrainInteger] to Ashenvale - Leaves using variation -1 in an area of size TileSizeInteger[TerrainInteger] and shape Circle
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Terrain type at TerrainType[2]) Equal to Ashenvale - Leaves
                        • Then - Actions
                          • Environment - Change terrain type at TerrainType[TerrainInteger] to Ashenvale - Lumpy Grass using variation -1 in an area of size TileSizeInteger[TerrainInteger] and shape Circle
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Terrain type at TerrainType[2]) Equal to Village - Cobble Path
                            • Then - Actions
                              • Environment - Change terrain type at TerrainType[TerrainInteger] to Village - Stone Path using variation -1 in an area of size TileSizeInteger[TerrainInteger] and shape Circle
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Terrain type at TerrainType[2]) Equal to Ashenvale - Rough Dirt
                                • Then - Actions
                                  • Environment - Change terrain type at TerrainType[TerrainInteger] to Ashenvale - Rock using variation -1 in an area of size TileSizeInteger[TerrainInteger] and shape Circle
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Terrain type at TerrainType[2]) Equal to Ashenvale - Grass
                                    • Then - Actions
                                      • Environment - Change terrain type at TerrainType[TerrainInteger] to Ashenvale - Grassy Dirt using variation -1 in an area of size TileSizeInteger[TerrainInteger] and shape Circle
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Terrain type at TerrainType[2]) Equal to Northrend - Rocky Snow
                                        • Then - Actions
                                          • Environment - Change terrain type at TerrainType[TerrainInteger] to Lordaeron Winter - Snow using variation -1 in an area of size TileSizeInteger[TerrainInteger] and shape Circle
                                        • Else - Actions
          • Custom script: call RemoveLocation( udg_TerrainType[udg_TerrainInteger] )
          • Custom script: call RemoveLocation( udg_TerrainType[2] )
  • Random army
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to Tribal Army
        • Then - Actions
          • Unit - Create 1 Fortress for Player 2 (Blue) at CastlePoint[2] facing Default building facing degrees
          • Set CastleUnit[2] = (Last created unit)
          • Unit - Create (Random integer number between 4 and 6) Orc Axeman for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 3 and 6) Wolf rider for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 2 and 4) Hawk Scout for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 1 and 2) Orc Warlock for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 0 and 3) Wyvern Rider for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 1 and 2) Behemot Rider for Player 4 (Purple) at EnemyBase facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to Tyrant Army
        • Then - Actions
          • Unit - Create 1 Necropolis for Player 2 (Blue) at CastlePoint[2] facing Default building facing degrees
          • Set CastleUnit[2] = (Last created unit)
          • Unit - Create (Random integer number between 1 and 2) Nightmare for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 1 and 3) Horror for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 2 and 4) Necromancer for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 4 and 8) Ghoul for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 4 and 6) Undead Archer for Player 4 (Purple) at EnemyBase facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to Kobold Army
        • Then - Actions
          • Unit - Create 1 War Camp for Player 2 (Blue) at CastlePoint[2] facing Default building facing degrees
          • Set CastleUnit[2] = (Last created unit)
          • Unit - Create (Random integer number between 3 and 6) Kobold for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 1 and 2) Kobold Slaver for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 0 and 3) Kobold Tunneler for Player 4 (Purple) at EnemyBase facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to Bandit Army
        • Then - Actions
          • Unit - Create 1 War Camp for Player 2 (Blue) at CastlePoint[2] facing Default building facing degrees
          • Set CastleUnit[2] = (Last created unit)
          • Unit - Create (Random integer number between 4 and 6) Manticor Rider for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 2 and 4) Centaur Amazone for Player 4 (Purple) at EnemyBase facing Default building facing degrees
          • Unit - Create (Random integer number between 3 and 6) Spear Thrower for Player 4 (Purple) at EnemyBase facing Default building facing degrees
        • Else - Actions
 
Nah, it's purposefully made this way when testing the map from the editor because randomness would hinder reproducing scenarios while debugging. You can however disable this functionality >File >Preferences >Test Map >[ ] Use Fixed Random Seed
That's not that.It occured when playing with WE closed and that option is not even checked in my WE.
 
Status
Not open for further replies.
Top