Home   Help Search Login Register  

Author Topic: GetPOS Update me Please (forgot)  (Read 501 times)

0 Members and 2 Guests are viewing this topic.

cpt.Hawkeyez

  • Guest
GetPOS Update me Please (forgot)
« 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

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:GetPOS Update me Please (forgot)
« Reply #1 on: 23 Jan 2003, 19:03:14 »
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:

Code: [Select]
_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".
Ranger

cpt.Hawkeyez

  • Guest
Re:GetPOS Update me Please (forgot)
« Reply #2 on: 23 Jan 2003, 20:26:46 »
thanks I figured it out on my own but thanks for the help i did this

Code: [Select]
#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
« Last Edit: 23 Jan 2003, 20:28:00 by CymPaTheeY »

Liquid_Silence

  • Guest
Re:GetPOS Update me Please (forgot)
« Reply #3 on: 24 Jan 2003, 04:30:55 »
This should work...

Code: [Select]
_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...

cpt.Hawkeyez

  • Guest
Re:GetPOS Update me Please (forgot)
« Reply #4 on: 25 Jan 2003, 04:15:58 »
well yeah except the only thing is that the flare burns out 17 seconds after it is created.