OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: loki72 on 15 May 2008, 01:46:05
-
greetings,
how does one count the times a loop has been fired off? and when it has looped 12x.. it moves on?
i.e. i'd like to have a cut scene with the time changes from 12pm to 12am.. but i don't want it at once.
edit: and will this change the time for all? i can get it to kinda work.. but it will not release from the loop
something like?
#loop
~.05
_x = _x +1
skiptime 1
? _x >= 12 : goto "next"
goto "loop"
#next
blah blah
thx
-
#loop
~.05
_x = _x +1
skiptime 1
? _x >= 12 : goto "next"
goto "loop"
#next
blah blah
i think you need to define x before the loops start
so
_x=0
#loop
~.05
_x = _x +1
skiptime 1
? _x >= 12 : goto "next"
goto "loop"
#next
blah blah
#EDIT: No need to quote the entire previous post you're replying to... h-
-
:clap:
works great.. thanks for helping.
here is a nice looking time change:
whatever.sqs
; start the time acc
_x=0
#loop
~.04
_x = _x +1
skiptime .0625
? _x >= 195 : goto "next"
goto "loop"
#next
;script continues from here
-
use SQF :D
_x = 0;
while {_x < 12 } do
{
//do whatever you think is necessary but don't forget the following line
_x = _x + 1;
};
or use the for-loop
for [{_x= 0},{_x <12},{_x = _x + 1}] do
{
//again do whatever you like...and nothing more:D
};
-
weird how you can say the same thing 3 ways.. no wonder scripting has such a steep learning curve. :blink:
i have to agree that .sqf is nicer than .sqs.. but the whole 'grouping' and the brackets is still a bit beyond my level of understanding.
what is the difference between { } and [ ] in the way it is recognized?