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

Title: Vehicle tracking without all that otha stuff
Post by: max_killer_payne on 11 Jul 2003, 19:56:48
I havent tried this yet, but in theory wouldnt this work?

Code: [Select]
#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.
Title: Re:Vehicle tracking without all that otha stuff
Post by: Blanco on 11 Jul 2003, 23:19:41
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
Quote
_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...

       
Title: Re:Vehicle tracking without all that otha stuff
Post by: max_killer_payne on 11 Jul 2003, 23:25:21
cheers for that Blanco
Title: Re:Vehicle tracking without all that otha stuff
Post by: Blanco on 12 Jul 2003, 00:41:36
Hmm I made it difficult...it's the same but U don't need that 0.0001 thingy I think

try :
Quote
_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...

Title: Re:Vehicle tracking without all that otha stuff
Post by: max_killer_payne on 12 Jul 2003, 09:41:18
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.
Title: Re:Vehicle tracking without all that otha stuff
Post by: Blanco on 12 Jul 2003, 19:51:19
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...

Quote
_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

Quote
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
Quote
_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.