View Full Version : Veh/Vwp Tutorial (The NotePad Business)

ZH@o YuN
01-24-2004, 04:59 PM
Making a usable vehicle in-game:

This tutorial is assuming you have already made the vehicle model and are ready to make it into a playable vehicle. .Veh file are best made in Notepad, so just create a new .txt

file for now. I will be calling the example vehicle "F-22" (don't ask why :wink:)

The .VEH file

The file starts with the vehicle name, followed by a bracket, and the vehicle name again after "name" (NOTE: the name of the vehicle at the top of the file and the name in the

"name" entry MUST be the same, or the vehicle will not work):
name F-22
Afterwards, you need to add the following entries to your vehicle:
type The type of the vehicle. Acceptable types are:
numHands How many hands the rider will use to pilot this
vehicle. This determines what weapons the rider
can use while flying this vehicle - 0 means they can
use two-handed weapons, 1 means they can use
one-handed weapons, and 0 is no weapons at all.
lookPitch This determines how far you can look up/down
when you are riding this vehicle. Defaults to 90
(directly up/down) when not used. I recommend
you don't use this entry. Note that this is not the
entire radius of view! 90 = 90 up and 90 down.
lookYaw This determines how far you can look left or right in
front of the ship. Recommended: 45.
length How long the tracing box for the vehicle is. Ships
use hit detection based on an invisible box around
them, not their actual model. Make sure you get
this right, or you'll be hitting walls from miles away,
or seeing your wings going through the walls
without taking damage.
width How wide the tracing box for the vehicle is.
height How high the tracing box for the vehicle is.
centerOfGravity How far in/out from the center of the
model the center of gravity will be. Basically, this is
the point that the camera is locked on to when you
turn your mouse, and the point which the vehicle
turns about. If you set this too far foward, your
vehicle will be swining around its front when it
turns, the same goes for other directions. Stated as
X Y Z - eg. "-0.222 0 0" (used for most ships made
by Raven, so I would guess that this is the
recommended setting)
speedMax The maximum speed this vehicle can reach while
the accelerator is pressed.
turboSpeed The speed this vehicle will reach when
the turbo is pressed.
speedMin Minimum speed the vehicle can travel at. If it is
above 0, once the vehicle starts, it will never
completely stop. Also, if the number is below 0, the
vehicle can travel in reverse.
SpeedIdle (CURRENTLY NOT FUNCTIONING!)The vehicle will
slow down to this speed when the rider lets go of
the accelerator. Set it to the same as speedMax if
you don't want to keep the accelerator held down to
fly at the best speed.
acceleration How fast this vehicle will reach its
maximum speed. If i knew what the units for speed
were called in this game I would easily tell you
what the numbers mean on this entry, but I don't,
so I'll try to explain it. If we call the speed units
Zph, then the acceleration entry will determine how
many Zphs the speed will increase by every
millisecond (1000 milliseconds in 1 second). Raven
set their ships to around 20, so it would take less
than a second for their ships to reach max speed. If
you want your ship to take, say, 2 seconds to reach
their maximum speed of 2000, you should use an
acceleration of 1.
decelIdle (CURRENTLY NOT FUNCTIONING!)How fast the
vehicle's speed drops to the speedIdle speed.
strafePerc The speed that you can strafe at, judging by your
current speed. 1.0 means you can strafe at the
same speed as you are flying forward, 0.5 is half
the speed, and 0 is no strafing at all.
bankingSpeed How fast the vehicle automatically
rolls/pitches when it is turning.
rollLimit How much, in degeres, the vehicle will roll when it
strafes. On a test vehicle I used 360, and it did a
full barrel roll every time it strafed, looked pretty
cool :) Use 0 if you want the vehicle to just slide
left/right when you strafe.
pitchLimit Has less of a use now since the patch, since you
can only look 90 degrees up for down, so the
vehicle can only pitch as far as you can look.
Amount in degrees the vehicle can pitch. Before the
patch you could use this to enable your ship to do
backflips and aerobatics by setting it to 360.
braking How fast the vehicle slows down/stops when you
press back/decelerate.
turningSpeed How fast your vehicle will turn towards
your mouse. I can't seem to figure out the actual
measurements for this entry... 10 seems to make it
turn really fast, and the X-Wing has a default of 4.2.
turnWhenStopped Determines whether or not the vehicle
can turn while it is stationary. NOTE: This only
applies to SP (Single Player)
traction How much the vehicle slides when you turn. This
doesn't seem to affect MP.
friction How much control the vehicle has over itself and its
speed. A low number will cause the vehicle to slide
a lot and accelerate slower. Again, this doesn't
seem to affect MP.
maxSlope The maximum angle this vehicle can climb. Put it on
90 to climb walls with a tauntaun! :D
mass How big and fat this vehicle is. Affects the
force/knockback that a vehicle has when it hits
armor Total health of the vehicle. (Same HP system as
toughness Determines how damage is taken by the vehicle
when it is hit. 1.0 is full damage, 0.5 is half
damage, etc. 0 is just silly, because it makes the
vehicle invincible.
model The model to use for the vehicle. Make sure your
vehicle is in the "models/players/" folder, and just
use its name. ie. models/players/F-22, model entry
= F-22.
skin What skin to use for the model. If the vehicle
doesn't have any .skin files, just use "default". If
you have a .skin file, it must always begin
with "model_". For example, "model_blue.skin" =
riderAnim Animation the rider uses when he is riding the
vehicle, ie. BOTH_VS_IDLE.
soundOn This is the sound it makes when you enter the
vehicle. Full path must be given.
soundLoop Sound the vehicle is always playing when it's flying.
Basically use this entry for the engine sounds.
soundOff Sound to play when the rider exits the vehicle.
exhaustFX Effect file played from the *exhaust bolts on your
vehicle. No full path needed, just start from effects,
and leave out the .efx bit at the end,
ie. "ships/exhaust".
trailFX Effect played from the *trail bolts on your vehicle.
Raven disabled these on their ships, and removed
the wingtrail.efx file. In one of my vehicle mods, I
have made a new wingtrail effect and redone the
trails in each ship. It's quite a nice effect, I have no
idea why it was removed.
impactFX Effect played when the vehicle hits something.
Usually ships/scrape_sparks.
explodeFX Effect played when the vehicle explodes. Try to use
an effect that has a built-in sound, as you can't
choose what sound the vehicle makes when it blows
gravity How much gravity the vehicle has. Setting this to 0
will make the ship unable to land, but you will be
able to go at any speed, including 0, wthout
dropping from the sky. Default is 800 (normal
game gravity).
hoverHeight Height of which the vehicle hovers
above the ground. If you set it to 0, the vehicle will
move along the floor like a car or walker.
hoverStrength How hard it pushes off the ground every
time it falls below its hoverHeight. I changed this on
the swoops, because they hit the ground and stop
way too often...
waterProof Sub-marine vehicles! 1 means the
vehicle can move under water, 0 means it will get
stuck or sink.
bouyancy How high the vehicle floats in the water. 1 means
you can fly freely in the water without sinking or
floating up. numbers below 1 mean you will sink if
you don't fly upwards as you move, numbers above
1 mean you will float to the surface if you don't
push yourself down.
fuelMax Amount of fuel the vehicle can hold (not used in
any ships so far, could add some nice realism to
the game :))
fuelRate How quickly the fuel is used up while moving.
visibility I'm not entirely sure about this one... In the
template I found in ext_data/vehicles, it says "for
sight alerts".
loudness Same as visibility... Template says "for sound
These two entries may decide how easily they are
detected by NPCs, but I'm not sure... It would be
best to leave these out of your veh files.
explosionRadius Range of the damage coming from the
vehicle's explosion when it dies.
explosionDamage Damage coming from the vehicle's
death explosion.
maxPassengers How many passengers this vehicle can
hold. Just set it to 8 or something, anyone should
be able to ride in someone else's ship for fun :D
hideRider Whether or not the rider of the vehicle is drawn.
Use this to hide pilots if you're making a ship.
killRiderOnDeath If set to 1, the pilot will die immediately
if the vehicle dies.
flammable Whether or not the vehicle will set on fire for a set
time (explosionDelay) before it explodes.
explosionDelay How long to wait for the vehicle to
explode after its health is depleted.
cameraOverride If set to 1, the following entries apply to
the camera when you ride the vehicle:
cameraRange Same as cg_thirdPersonRange, sets how far
away from the vehicle the camera will be. Default =
cameraVertOffset Same as cg_thirdPersonVertOffset, sets
how high/low the camera is from the center of the
vehicle. Default = 0.
cameraHorzOffset Same as cg_thirdPersonHorzOffset, sets
how far to the left/right the camera is from the
center of the vehicle. Default = 0.
cameraFOV Same as cg_fov, sets your Field of
Vision. This is how much you can see around you.
Default = 80 (you can see 80 degrees in front of
cameraAlpha How much to fade the vehicle when it's
in front of your screen and blocking your crosshair.
This doesn't seem to work on foggy maps, so I
suggest you leave this as 0.
landingHeight How high off the ground the vehicle has
to be before it can fly. Also how low the vehicle is
before it starts the landing animation.

weap1 Primary weapon (all weapons are specified in .vwp files)
weap1Delay Delay between shots, in milliseconds.
weap1Aim Whether the weapon aims by itself when you are
close to enemies.
weap1AmmoMax Maximum ammo this weapon can hold.
weap1AmmoRechargeMS How fast this weapon regains
ammo. Leave this entry out if you want limited
ammo for a weapon, ie. missiles.
weap1Link Whether or not this weapon can be linked to fire all
muzzles at once (bind <key> +button2)

You can do the same for weap2 for the secondary weapon. Remember, you can never have more than 2 weapons!

The .VWP File

VWP files begin in the same way as VEH files - name once at the top, and then name after the "name" entry.

Here we go...
<weapon name>
name <weapon name>. Name of the weapon.
projectile Whether or not this is a projectile. If 1, the shot will
bump into things like ships while it is moving; it
won't bounce off though.
hasGravity Whether or not the projectile is affected
by gravity
(only if projectile = 1)
ionWeapon If 1, this weapon will make the target
ship lose control for a second every time it hits.
muzzleFX Path to effect for the flash when the weapon fires.
shotFX Shot effect.
ImpactFX Effect to play when the projectile hits.
g2MarkShaderHandle Shader to use for the mark a projectile
makes after it hits.
g2MarkSize Size of the mark.
loopSound Sound the projectile makes as it is flying.
speed Speed of projectile.
homing If 1, the projectile will lock on, and will fly directly
at the target ship. If it's anything below 1, it will
only fly partially towards the ship, and follow it
more than directly smash it. ie. 0.5 = only turns
half as much toward the target than it would
lockOnTime Time it takes in seconds to lock on. If
you set it to 0, it will lock on immediately.
damage Damage dealt by a direct hit.
splashDamage How much damage is done by the splash
of the explosion.
splashRadius Radius of the explosion.
ammoPerShot How much ammo each shot takes.
health If 1 or more, the projectile becomes shootable and
will take this much damage before exploding.
width Width of projectile.
height Height of projectile.
lifetime How long the projectile will fly for before it
explodeOnExpire If 1, the projectile will explode when its
lifetime runs out.

Alright, that's it! I hope you've learned a lot from this, and made your vehicle playable!

Lil Killa
01-26-2004, 01:03 AM
This should be stickied..