HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Loop Limit

06-12-2005, 10:22 PM#1
Zandose
Hi. Is there a limit to how many times you can run a loop? The looping im using only goes to 2648 then stops.

Code:
Set Temp_Integer = 0
For each (Integer A) from 1 to 32, do (Actions)
    Loop - Actions
        For each (Integer B) from 1 to 512, do (Actions)
            Loop - Actions
                Game - Display to (All players) the text: (String(Temp_Integer))
                Set Temp_Integer = (Temp_Integer + 1)
                Game Cache - Store (Random integer number between 1 and 7) as (String(Temp_Integer)) of TerrainType in GameCache[1]
                Game Cache - Store (Random integer number between 1 and 3) as (String(Temp_Integer)) of TerrainSize in GameCache[1]
Game Cache - Store Temp_Integer as 0 of TerrainTotal in GameCache[1]
06-12-2005, 10:34 PM#2
Vexorian
Too much time without waits in the same thread cause it to crash.

You would have to use a separated thread, or much better optimize the thing you've done.

Executing a trigger creates a new thread, also ExecuteFunc does
06-13-2005, 01:25 AM#3
Zandose
Quote:
Originally Posted by Lord Vexorian
Too much time without waits in the same thread cause it to crash.

You would have to use a separated thread, or much better optimize the thing you've done.

Executing a trigger creates a new thread, also ExecuteFunc does

Thank you. I forgot to use the wait. But optimize what I got? I don't know how to do that.
06-13-2005, 12:08 PM#4
iNfraNe
you didnt forget to use wait ;) waits would work but it would take forever to complete the task, which you want immediatly.

What you should do is put those looped actions in a new trigger and run the trigger from the loop.

Code:
for each a blabla
    for each b blabla
        trigger - run weird trigger
06-13-2005, 02:32 PM#5
Zandose
Quote:
Originally Posted by toot
you didnt forget to use wait ;) waits would work but it would take forever to complete the task, which you want immediatly.

What you should do is put those looped actions in a new trigger and run the trigger from the loop.

Code:
for each a blabla
    for each b blabla
        trigger - run weird trigger

I think I understand. Never thought of doing it that way. Buy then again I don't know as much as Vex does. :) Thank you.