Game Development Community

Jet/Turbo on (Flying) Vehicles

by Josiah Wang · 06/29/2005 (11:18 pm) · 6 comments

Many thanks to Mike Kuklinski for pointing me in the right direction

anyways, this involves only a few simple changes. It requires that you have a vehicle (duh.) I've only tested this with a flying vehicle, but I'm hoping it'll work with other types as well.

First we'll make this remappable to the player by adding it to the options dialog. In yourgame/client/scripts/optionsDlg.cs, somewhere near the other $Remap's around line 250ish:

$RemapName[$RemapCount]= "Turbo";
$RemapCmd[$RemapCount] = "mouseTurbo";
$RemapCount++;


Next, we have to create a function to have it activate the turbo code. Lucky for us, it's already built in. Simply add this to your default.bind.cs (I added this to the mouse triggers section around line 144ish, but i think it'll work anywhere)

//TurboThingieMaBobber
moveMap.bind( mouse, button1, mouseTurbo );

function mouseTurbo(%val)
{
   $mvTriggerCount3++;
}

Note that $mvTriggerCount3++ is referring to move->trigger[3] in the code, in case you're wondering...also, you can change the bind mappings to anything you want.

Anyways, just make sure your vehicle has enough energy before you activate, or else it won't work...

#1
06/30/2005 (12:36 am)
It is also possible to rewrite, in the code, the thruster functions for this, so it doesn't require energy, etc.

However, as far as I can tell, perfect and very clean implementation of vehicle thrusters.

Nice Job :).
#2
06/30/2005 (4:52 pm)
Oh wow, this was posted like a few months late O_.
#3
07/01/2005 (8:10 am)
How would you map this to another key besides the mouse? I know this is a simple thing but I've not had luck getting this assigned to any other key besides the mouse buttons. Could someone give changes to map the Turbo to something like 'b'?
#4
07/04/2005 (10:04 am)
Hrms...perhaps try:

moveMap.bind( keyboard, b, mouseTurbo );

in yourgame/client/scripts/default.bind.cs instead? You could also rename mouseTurbo in the code to something like bTurbo instead...
#5
04/15/2006 (10:01 pm)
Great.. great.. this is what I'm looking for..... thanks :)
#6
04/21/2006 (7:30 am)
How does the trigger effect "activate" the thruster/turbo in code?

And on another topic... how many triggers are there?