OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: cpt.Hawkeyez on 23 Jan 2003, 18:05:11
-
Okay Im not sure about this but I cam created a white flare and then I need to keep it in a position in unison with a west soldier named frank so it looks like he as a flashlight on his head. Now how do you write the loop that keeps the flare with frank? I already know the position where I want the flare at so how do I do it.
Thanks
CymPaTheeY
-
I hope and assume that you created the flare within a script. If so, you just need a loop to keep setting the flare's position.
Use the following script as an example and modify as necessary:
_flare = "flare" camCreate (getPos frank)
#Loop
_flare setPos (getPos frank)
goto "Loop"
That's it! You may want to add a condition that will exit the script, such as if you allow Frank to turn off the "flashlight".
-
thanks I figured it out on my own but thanks for the help i did this
#start
_flare = camCreate "flare" [getpos frank this select 0, getpos frank this select 1, (getpos frank this selct 2)+1.7]
~0.01
_counter this selct 0
#loop1
_flare [getpos frank this select 0, getpos frank this select 1, (getpos frank this selct 2)+1.7]
_flare setvelocity = [0,0,1]
~0.20
_counter + 1
?_counter == 80 goto "start"
exit
having trouble with the counters though
can you help on that
-
This should work...
_flare = "flare" camCreate [getpos frank select 0, getpos frank select 1, (getpos frank select 2)+1.7]
flashlightOn = true
#loop
_flare setPos [getpos frank select 0, getpos frank select 1, (getpos frank select 2)+1.7]
~0.01
if (flashlightOn) then {goto "loop"}
Just set "flashlightOn = false" to stop the script...
-
well yeah except the only thing is that the flare burns out 17 seconds after it is created.