OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: max_killer_payne on 11 Jul 2003, 19:56:48
-
I havent tried this yet, but in theory wouldnt this work?
#loop
_cam camsettarget plane
_cam camsetrelpos [0,50,50]
_cam camcommit 0
@camcommitted _cam
goto "loop"
And one more question how can I end a loop after say 20 seconds?
EDIT: Just tried it out works fine real smooth. You don't need to use the select 0 commands nemore. All I need now is to how to make the loop end once a time limit has expired.
-
I don't think U can if U want it that smooth, cos delay is 0
maybe U can make it as short as possible like 0.0001
_c = 0
#loop
_cam camsettarget plane
_cam camsetrelpos [0,50,50]
_cam camcommit 0
_c = _c + 0.0001
?(_c > 0.002) : goto "stopcam"
goto "loop"
#stopcam
_cam camsettarget... and so on...
cos 0.0001 * 20(sec) = 0.002 :)
Or run a another counterscript in your camscript and use a bolean... :-\
Hmmm. I like to know this too...
-
cheers for that Blanco
-
Hmm I made it difficult...it's the same but U don't need that 0.0001 thingy I think
try :
_c = 0
#loop
_cam camsettarget plane
_cam camsetrelpos [0,50,50]
_cam camcommit 0
_c = _c + 1
?(_c > 20) : goto "stopcam"
goto "loop"
#stopcam
_cam camsettarget... and so on...
Hmmm, actually U can make it smooooth...
-
I just got up, had to get up early, wanna get me hair cut. I'll report back in a coupla hours when ive tested this all out.
-
i tested it b4 u, nope doesn't work.
I must be a bit confused last night, cos I forgot the delay...
OK, new try...
_c = 0
#loop
_cam camsettarget plane
_cam camsetrelpos [0,50,50]
_cam camcommit 0.0001
_c = _c + 0.0001
?(_c > 0.002) : goto "stopcam"
goto "loop"
#stopcam
_cam camsettarget... and so on...
or
camscript.sqs
stopcam = false
[] exec "counter.sqs"
#loop
_cam camsettarget plane
_cam camsetrelpos [0,50,50]
_cam camcommit 0
?stopcam: goto "endit"
goto "loop"
#endit
_cam camsettarget ...blablabla
run another counterscript within your camscript
counter.sqs
_c = 0
#loop
_c=_c+1
~1
?(_c == 20) : Stopcam = true
goto "loop"
Run the counterscript b4 the loop in the camscript, not in it!
When _c reach 20: stopcam = true and your loop stops in your camscript. In that way you can keep your camcommit 0
that makes it smoooth...
Sorry for the bad English, hope it helps.