OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Raptorsaurus on 09 Sep 2006, 06:04:02

Title: Moveing Objects using SetPos
Post by: Raptorsaurus 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
Title: Re: Moveing Objects using SetPos
Post by: DeanosBeano 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 . :)
 
Title: Re: Moveing Objects using SetPos
Post by: Raptorsaurus on 11 Sep 2006, 20:52:12
I am working on a version that does a parpolic trajectory.