Hi, I'm having a strange problem with a loop trigger I made recently, the idea is as follows:
10 trees are spawned randomly across the map at initialization, those 10 trees will spawn another 100 trees each, one after the one, forming a chain to simulate a randomly generated forest.
To do this, I used a Loop from 1 to 10 and another inside it from 1 to 100, this worked correctly and I can generate random forests across the map.
The problem was when I tried to add additional biomes to the loop, so that at begining, it will create 10 Summer Trees, 10 Snowy Trees, 10 Barrens Trees, etc, etc, and thus generate a biome for each.
For some reason, this didn't work, and instead, only the Lordaeron Summer biome was generated, and a very small fraction of the snow biome, as if the loop was diminishing, none of the other biomes was generated, I'll paste the triggers below to show how it works, any idea for why is it doing that would be appreciated!
10 trees are spawned randomly across the map at initialization, those 10 trees will spawn another 100 trees each, one after the one, forming a chain to simulate a randomly generated forest.
To do this, I used a Loop from 1 to 10 and another inside it from 1 to 100, this worked correctly and I can generate random forests across the map.
The problem was when I tried to add additional biomes to the loop, so that at begining, it will create 10 Summer Trees, 10 Snowy Trees, 10 Barrens Trees, etc, etc, and thus generate a biome for each.
For some reason, this didn't work, and instead, only the Lordaeron Summer biome was generated, and a very small fraction of the snow biome, as if the loop was diminishing, none of the other biomes was generated, I'll paste the triggers below to show how it works, any idea for why is it doing that would be appreciated!
-
Initialization
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Set BiomeType[1] = Summer Tree Wall
-
Set BiomeType[2] = Snowy Tree Wall
-
Set BiomeType[3] = Barrens Tree Wall
-
Set BiomeType[4] = Fall Tree Wall
-
Set BiomeType[5] = Ruins Tree Wall
-
Set BiomeType[6] = Ashenvale Tree Wall
-
Set TerrainType1[1] = Lordaeron Summer - Grass
-
Set TerrainType1[2] = Lordaeron Winter - Snow
-
Set TerrainType1[3] = Barrens - Desert
-
Set TerrainType1[4] = Lordaeron Fall - Grass
-
Set TerrainType1[5] = Sunken Ruins - Sand
-
Set TerrainType1[6] = Ashenvale - Grass
-
Set TerrainType2[1] = Lordaeron Summer - Dark Grass
-
Set TerrainType2[2] = Lordaeron Winter - Grassy Snow
-
Set TerrainType2[3] = Barrens - Dark Desert
-
Set TerrainType2[4] = Lordaeron Fall - Grassy Dirt
-
Set TerrainType2[5] = Sunken Ruins - Dirt
-
Set TerrainType2[6] = Ashenvale - Leaves
-
-
-
For each (Integer C) from 1 to 6, do (Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to (Random integer number between 7 and 15), do (Actions)
-
Loop - Actions
-
Set RandomLocation = (Random point in (Playable map area))
-
Destructible - Create a BiomeType[C] at RandomLocation facing (Random angle) with scale (Random real number between 0.80 and 1.20) and variation (Random integer number between 0 and 9)
-
For each (Integer B) from 1 to (Random integer number between 75 and 150), do (Actions)
-
Loop - Actions
-
Set LastLocation = ((Position of (Last created destructible)) offset by (Random real number between 150.00 and 200.00) towards (Random angle) degrees)
-
Set TreeChance = (Random integer number between 1 and 100)
-
-
If (TreeChance Greater than 35) then do (Destructible - Create a BiomeType[C] at LastLocation facing (Random angle) with scale (Random real number between 0.80 and 1.20) and variation (Random integer number between 0 and 9)) else do (Do nothing)
-
Environment - Change terrain type at LastLocation to TerrainType1[C] using variation -1 in an area of size (Random integer number between 2 and 5) and shape Circle
-
Environment - Change terrain type at LastLocation to TerrainType2[C] using variation -1 in an area of size (Random integer number between 2 and 4) and shape Circle
-
-
-
-
-
-
-
-
Custom script: call RemoveLocation (udg_LastLocation)
-
Custom script: call RemoveLocation (udg_RandomLocation)