Home   Help Search Login Register  

Author Topic: Moveing Objects using SetPos  (Read 1984 times)

0 Members and 1 Guest are viewing this topic.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Moveing Objects using SetPos
« on: 09 Sep 2006, 06:04:02 »
Here is a script and function that allows objects that do not respond to setVelocity to be moved using setPos. The script is setPosMove.sqs and the function is MovePos.sqf.  The comments in the these explain how to use them and what each parameter does. In the demo, a fire is used to simulate a small meteor. Camp fires cannot be setVelocitied, but using the MovePos function with the setPosMove script, the fire streaks down from the sky and strikes the truck. The script "explode.sqs" is just for eye candy. It makes the truck expload.  Play the demo mission first, then use and modify these as you see fit for your application.

Note: The MovePos.sqf function makes the movement paths relative to sea level. This permits linear movement even over varying terrain features. One could call the movePos function twice, once to affect the horizontal movement and once the affect the verticle movement. The horizontal speed could be constant, while the verticle speed would accelerate according to the force of gravity. The end effect would be an apparent parabolic path. Mybe I will do that later on. :D
« Last Edit: 09 Sep 2006, 17:36:23 by Raptorsaurus »

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Moveing Objects using SetPos
« Reply #1 on: 10 Sep 2006, 23:19:05 »
 Very nice little script m8, altho it has come alittle to late for me , i think maybe people who come later may find alot of use for this.
 i like the fact you have made definable the start and end destinations. for me ,i would have needed an arc so objects dont fly so straight. but anyway i fixed that.
  thanks anyway i liked the efficiency of it,maybe i will blow the windows out my destructable car with it . :)
 
I love ofp

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Moveing Objects using SetPos
« Reply #2 on: 11 Sep 2006, 20:52:12 »
I am working on a version that does a parpolic trajectory.