Hadezown
TH.net Regular
- Reaction score
- 5
So the nested loops cause massive delay whenever I run this trigger every second or so on bnet with only me in the game. When I run the trigger off of bnet there is no delay, which I don't really understand.
When I host it on bnet it doesn't cause fps lag, its more like that 1 second delay you get after clicking.
Anyway I was wondering if there's a way to simplify my code so it doesn't cause this delay, but keep the format intact.
If your wondering what my code does it basically makes explosions like a checker board at 1 second intervals. The 1's explode first then the 2's explode next. The trigger above explodes the 2's. I have a similar trigger to explode the 1's.
1212121
2121212
1212121
2121212
1212121
2121212
First nested For Loop explodes these 2's:
1212121
2121212
1212121
2121212
1212121
2121212
Second nested For Loop explodes the other 2's.
When I host it on bnet it doesn't cause fps lag, its more like that 1 second delay you get after clicking.
Anyway I was wondering if there's a way to simplify my code so it doesn't cause this delay, but keep the format intact.
Code:
Events
Time - GM_Timer2 expires
Actions
For each (Integer AA_Integer) from 1 to 4, do (Actions)
Loop - Actions
For each (Integer AA_Integer2) from 1 to 3, do (Actions)
Loop - Actions
Set AA_Point2 = (Center of GH3 spawn1 <gen>)
Set AA_Point = (AA_Point2 offset by ((-256.00 + (256.00 x (Real(AA_Integer)))), (-256.00 + (256.00 x (Real(AA_Integer2))))))
Unit - Create 1 GH3 explosion obstical for Player 9 (Gray) at AA_Point facing 270.00 degrees
Unit - Add a 0.10 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_AA_Point)
Custom script: call RemoveLocation(udg_AA_Point2)
For each (Integer AA_Integer) from 1 to 3, do (Actions)
Loop - Actions
For each (Integer AA_Integer2) from 1 to 3, do (Actions)
Loop - Actions
Set AA_Point2 = (Center of GH3 spawn2 <gen>)
Set AA_Point = (AA_Point2 offset by ((-256.00 + (256.00 x (Real(AA_Integer)))), (-256.00 + (256.00 x (Real(AA_Integer2))))))
Unit - Create 1 GH3 explosion obstical for Player 9 (Gray) at AA_Point facing 270.00 degrees
Unit - Add a 0.10 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_AA_Point)
Custom script: call RemoveLocation(udg_AA_Point2)
If your wondering what my code does it basically makes explosions like a checker board at 1 second intervals. The 1's explode first then the 2's explode next. The trigger above explodes the 2's. I have a similar trigger to explode the 1's.
1212121
2121212
1212121
2121212
1212121
2121212
First nested For Loop explodes these 2's:
1212121
2121212
1212121
2121212
1212121
2121212
Second nested For Loop explodes the other 2's.