Home   Help Search Login Register  

Author Topic: addAction and setvelocity  (Read 626 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
addAction and setvelocity
« 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
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

AK-Chester

  • Guest
Re:addAction and setvelocity
« Reply #1 on: 28 Feb 2005, 21:12:39 »
Dunno if I got you right, but this sounds pretty much like a turbo-/nitro-boost thingy? There is also something like this in the buggy addon by Sebastian Müller. You'd have to use some additional math to get the "drift to one side" effect though.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:addAction and setvelocity
« Reply #2 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

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:addAction and setvelocity
« Reply #3 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  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB