Posted by Just another Oldbie on 2/21/2005, 6:07 pm, in reply to "problems with a loop" while(condition) do(commands) Condition is not True or False. Condition is a command such as ... Check tag (15) == True To use such a command in a while loop you would write: script, sleeploop,begin However, this will wind up becoming what programmers know as a "Hard Loop" or "Endless Loop" unless you eventually set Tag 15 to false at some point, ending the loop. I thought the wait tags may be the problem for hindering the hero from moving at first, but in reality they shouldn't have anything to do with the problem. Maybe it had something to do with the incorrect condition in the while loop? If by Autorun you meant that you have it set as the "every step" script on the map, then don't do that. This script should only be triggered once, not multiple times. I hope this made sense! If you are still having problems please give me a little more detail on the problem and I will maybe be able to help some more. --Previous Message--
68.57.245.187
I don't know exactly what you mean by Autorun, so please go into my detail if my answer below doesn't solve your problem. Anyway, you're using the while loop incorrectly. The structure is as follows:
while(Check tag (15)==True) do,begin
Set tag (13, off)
wait (10 * (random (2, 10)))
set tag (13, on)
wait (10 * (random (2,10)))
end
end
: Iīm trying to make a script to turn on and off a given
: tag from time to time. could someone help? That is the
: script that I made and use as a Autorun script of the
: map. I donīt know why but when the map start, the
: player stops acting...
:
: script, sleeploop, begin
: while (true) do, begin
: Set tag (13, off)
: wait (10 * (random (2, 10)))
: set tag (13, on)
: wait (10 * (random (2,10)))
: end
: end
:
Message Thread:
![]()
« Back to thread