I am trying to change the terrain in a rect when the map starts via triggers. The map is 128 x 256, with two regions that are to be identical in size and shape, so the area of terrain I'm trying to change is a little less than 128 x 128. I do not want to do it manually via the WE, because then I have to limit the amount of tiles I can use. My first attempt looked like this:
Trigger:
Spirit Realm Terrain OLD
Events
Conditions
Actions

Visibility - Disable black mask

Visibility - Disable fog of war

For each (Integer A) from ((Integer((Min X of RealmSpirit <gen>))) / 96) to ((Integer((Max X of RealmSpirit <gen>))) / 96), do (Actions)


Loop - Actions



Set X = ((Integer A) x 96)



For each (Integer B) from ((Integer((Min Y of RealmSpirit <gen>))) / 96) to ((Integer((Max Y of RealmSpirit <gen>))) / 96), do (Actions)




Loop - Actions





Set Y = ((Integer B) x 96)





Set int_TrigCount = (int_TrigCount + 1)





If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Dirt) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Dirt using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)





If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Rough Dirt) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Rough Dirt using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)





If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Grassy Dirt) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Light Dirt using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)





If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Rock) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Flat Stones using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)





If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Grass) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Small Bricks using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)





If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Dark Grass) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Large Bricks using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)
The A For Loop is for the X coord, and the B loop for the Y coord. I have it divide by 96 and then multiply by 96 in order to cut down the loops (it only needs to change the terrain every 96 or so "measurements").
The good thing here is that the terrain changes are done seemingly instantaneously (I'll explain that shortly). The problem, however, is that the loop only seems to run around 1150 times, and to complete the region it would have to run about 24,000. It runs through the A loop only thrice, so there are three vertical lines of the correct terrain, the rest is left unchanged.
So I assumed there was a limit on the amount of times the For Loop can run. I then decided to create a manual for loop.
Trigger:
Spirit Realm Terrain
Events

Time - Elapsed game time is 0.01 seconds
Conditions
Actions

Wait 0.00 seconds

If (All Conditions are True) then do (Then Actions) else do (Else Actions)


If - Conditions



X Greater than (Integer((Min X of RealmSpirit <gen>)))



Y Greater than (Integer((Min Y of RealmSpirit <gen>)))


Then - Actions



If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Dirt) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Dirt using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)



If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Rough Dirt) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Rough Dirt using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)



If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Grassy Dirt) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Light Dirt using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)



If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Rock) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Flat Stones using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)



If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Grass) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Small Bricks using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)



If ((Terrain type at (Point((Real(X)), (Real(Y))))) Equal to Lordaeron Summer - Dark Grass) then do (Environment - Change terrain type at (Point((Real(X)), (Real(Y)))) to Black Citadel - Large Bricks using variation -1 in an area of size 1 and shape Circle) else do (Do nothing)



Set Y = (Y - 96)



Trigger - Run (This trigger) (checking conditions)


Else - Actions



If (All Conditions are True) then do (Then Actions) else do (Else Actions)




If - Conditions





X Greater than (Integer((Min X of RealmSpirit <gen>)))





Y Less than or equal to (Integer((Min Y of RealmSpirit <gen>)))




Then - Actions





Set X = (X - 96)





Set Y = (Integer((Max Y of RealmSpirit <gen>)))





Trigger - Run (This trigger) (checking conditions)




Else - Actions





Game - Display to (All players) the text: TERRAIN-FACE CHANGE COMPLETE
This way, the loop does not unexpectedly end itself. However, the Wait action causes the trigger to delay enough that it would take about five minutes for the entire region to be correctly changed. If I remove the Wait Action, the game crashes the moment this trigger runs. Either way presents a problem. I understand if need be I can just run separate for loops, doing things in sections, but it just seems odd that the loop is limited like that.
I am willing to use either of these triggers if there is a solution to either problem.