OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Abe on 20 Sep 2005, 01:19:37

Title: "Empty" Scud Missiles.
Post by: Abe on 20 Sep 2005, 01:19:37
This is probably stupidly simple, but why are there three variables for the "setvelocity" command?
I've downloaded the EU Addons, and I'm trying to make an "empty" Scud Missile fly into some units, but the three variables has really thrown me (nothing different happends when I change them).

Also, is there any way to mute the sound on certain units (If the scud is set to fly it has a helicopter sound with it - can I get rid of this?)

Thanx for the help.
Title: Re:"Empty" Scud Missiles.
Post by: Pilot on 20 Sep 2005, 01:39:08
The three variables are for three directions.  The first variable is the east-west velocity, the second north-south and the third up-down.  These velocities are in relation to the map, not the unit.  If a northern velocity is applied to the unit, the unit will go north no matter what direction it's facing.

-Student Pilot
Title: Re:"Empty" Scud Missiles.
Post by: Triggerhappy on 20 Sep 2005, 04:33:35
also when things are on the ground setvelocity tends not to work well, try setposing it .2 m above the ground before setting the velocity
Title: Re:"Empty" Scud Missiles.
Post by: Pilot on 20 Sep 2005, 05:40:54
Yes, I have found the setvelocity command to be buggy.  Sometimes objects wouldn't move till I shot them ::)

-Student Pilot
Title: Re:"Empty" Scud Missiles.
Post by: macguba on 20 Sep 2005, 11:59:34
Velocity is a vector.  It has magnitude and direction.    If you try to describe a velocity, you can't do it with fewer than three quantities.   "100mph, bearing 045 degrees, climbing at 10 degrees."    It turns out that the simplest way to handles these three quantities is by resolving them into 3 component vectors in the way Student Pilot describes.

Speed is a scalar.  It has only magnitude, no direction.   For example, "90mph".  

setVelocity is a buggy command and the scud missile itself is not a a proper object.   You may run into all kinds of problems.
Title: Re:"Empty" Scud Missiles.
Post by: Abe on 20 Sep 2005, 16:26:38
Thanx for the help.
I'm off to try it out....