xPheRe
New Member
- Reaction score
- 43
Days ago I'd needed a loop to iterate over 16384 values.
So I wrote this code
I was surprised when I executed it. The loop never reached the end.
I've tried to make the trigger writes on screen a message every time it processed 128 values to look at what index it hangs, so I wrote
It processed until 6528 and then ends. The map was running, but the loop hadn't end succesfully.
So I try to remove the message and call a polled wait instead.
Instead of DisplayTimedTextToForce... I wrote
Incredibly, it worked. It's a lot slower (even changing the 128 value to a 2048, because with 4096 I have the same problem) but it works...
There's anybody out there that can explain this weird behaviour to me????
It's annoying me :banghead:
So I wrote this code
Code:
local integer idx = 0
loop
exitwhen idx >= 16384
(do stuff)
set idx = idx + 1
endloop
I've tried to make the trigger writes on screen a message every time it processed 128 values to look at what index it hangs, so I wrote
Code:
local integer i = 0
local integer idx = 0
loop
loop
exitwhen i >= 128
exitwhen idx >= 16384
(do stuff)
set idx = idx + 1
set i = i + 1
endloop
exitwhen idx >= 16384
call DisplayTimedTextToForce(GetPlayersAll(), 5.00, I2S(idx))
set i = 0
endloop
So I try to remove the message and call a polled wait instead.
Instead of DisplayTimedTextToForce... I wrote
Code:
call PolledWait(0.01)
There's anybody out there that can explain this weird behaviour to me????
It's annoying me :banghead: