OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: greg147 on 27 Feb 2005, 17:47:36

Title: addAction and setvelocity
Post by: greg147 on 27 Feb 2005, 17:47:36
Hi all,

I think this is kinda advanced, so I put it here  ;)

What i'm trying to do is when the player enters a trigger, an extra action comes up on the action menu. Then, when the player selects it, the vehicle he is riding in speeds up slightly, and veers sharply to the right, off the road.

Is this possible at all  :P

If so, how do I do it?

Thanks
Title: Re:addAction and setvelocity
Post by: AK-Chester on 28 Feb 2005, 21:12:39
Dunno if I got you right, but this sounds pretty much like a turbo-/nitro-boost  (http://www.ofpec.com/editors/resource_view.php?id=283) thingy? There is also something like this in the buggy addon (http://ofp.gamezone.cz/index.php?showthis=5306) by Sebastian Müller. You'd have to use some additional math to get the "drift to one side" effect though.
Title: Re:addAction and setvelocity
Post by: Triggerhappy on 28 Feb 2005, 22:14:00
giving it the action isn't hard, its making it veer off to the side
you'll have to combined velocity and direction changed at pretty exact timing

as in:

setvelocity [whatever based on direction of car to change it]
setdir (getdir car) + 2
~.5
repeat
Title: Re:addAction and setvelocity
Post by: greg147 on 28 Feb 2005, 22:39:40
Aha, i'll try both of those  ;D

At the moment I was making do with this:

Code: [Select]
car1 setvelocity [-18,22,2]
That seemed to work fine, but it looked like the car had slid on ice  ;)