Vehicle scripts

All vehicles are defined in the vehicle scripts. This article explains the vehicle parameters. See another article for general scripting guidelines.

Vehicle scripts can be quite long so complete examples are not included. See existing scripts for reference.

Vehicle parameters and keywords

new_vehicle starts a new vehicle definition. It's followed by the vehicle number. Possible numbers are 1 to 255. Number 0 may work but may cause glitches.
modify_vehicle starts a vehicle modifier
end ends these

General

enable can be used to enable the vehicle for a faction by default.

model defines the vehicle type. Available models are:

  • tank is an ordinary tank
  • plane is an aeroplane (most bombers are planes too)
  • heli is a helicopter
  • ufo is a scout
  • glider is like plane but it does not pitch. Gigant is the only glider in the stock unit set.
  • zeppelin is like plane but it does not pitch or roll. Examples are Zeppelin and XO1 Quadda.
  • car is a ground unit like tank but it cannot turn in place. It also leans when turning. The only car in the stock unit set is Rock Sled.
  • robo is a host station. Host stations have many specific parameters.
  • gun is a gun turret. Turrets are mounted on host stations and buildings. Radar station antennas are also “guns”. Guns have some specific parameters.

name defines the vehicle name. Names should contain underscores instead of spaces. Note that language.dll overrides this.

wireframe defines the vehicle “preview” wireframe which is displayed in the HUD.
hud_wireframe
wpn_wireframe_1
wpn_wireframe_2
mg_wireframe
These define various parts of the HUD, such as sights.

vo_type defines the voiceover. See this article for more information about voiceovers.

Physics and durability

energy is the energy of the vehicle. It affects the durability of the vehicle and determines the cost of creation. This value is divided by 100 to get the value seen in the game. The energy cost is 2x that value.
shield is the armor of the vehicle. It's a percentage value which reduces the damage caused by weapons.
mass is the mass of the vehicle. It affects the acceleration and knockback properties of the vehicle.
force is the forward-driving force. It affects acceleration and top speed.
maxrot is the maximum turning rate. Setting this too low for helicopters may cause problems.
airconst is the aerodynamic drag constant. It affects acceleration and especially top speed.
height is the flying height. FIXME (needs more information)
radius is a radius of some kind FIXME 
overeof is the position of the vehicle when it's sitting on the ground FIXME
vwr_radius
vwr_overeof
These are related to the viewer/camera position. FIXME

Action distances and radar

FIXME verify and update these

adist_sect
adist_bact
These are attack distances of some kind. “Sect” may be related to sector and “bact” might mean a vehicle.

sdist_sect
sdist_bact
These are other action distances.

radar defines the radar range in sectors.

Models and appearance

FIXME these may be incorrect, verify these

vp_normal is the appearance of the vehicle when it's moving.
vp_fire is the appearance when firing
vp_wait is the appearance when the vehicle is idle
vp_dead is the appearance of the vehicle when it's dying
vp_megadeth is the appearance when the dead vehicle hits the ground
vp_genesis is the appearance of the vehicle when it's being spawned

The model numbers define the model that is loaded from SET.BAS package. See visproto.lst file for a list of models.

type_icon defines the vehicle icon which is seen on the map and in the creation menu and squadron manager. See another article for information about icons.

Palettes and shaking

FIXME this needs lots of updating and more info

The first part of each keyword defines whether it's “palette” or “shaking”. The second part defines the action with which the effect is applied. The last part is the parameter. slot parameters might be related to the slots defined in level files. mag0 and mag1 parameters are magnitudes, x, y and z may form a direction vector, time parameter is the duration and mute parameter is unknown.

pal_explode_slot
pal_explode_mag0
pal_explode_mag1
pal_explode_time

shk_explode_slot
shk_explode_mag0
shk_explode_mag1
shk_explode_time
shk_explode_x
shk_explode_y
shk_explode_z
shk_explode_mute

Host station-specific palettes/shaking

NOTE: These are only seen in use with host stations. It's not known if they work with other types of units. It's also not known if there are more such parameters.

pal_build_slot
pal_build_time

shk_build_slot
shk_build_time

pal_normal_slot
pal_normal_mag0
pal_normal_mag1

pal_beamin_slot
pal_beamin_mag0
pal_beamin_mag1
pal_beamin_time

shk_beamin_slot
shk_beamin_mag0
shk_beamin_mag1
shk_beamin_time

pal_beamout_slot
pal_beamout_mag0
pal_beamout_mag1
pal_beamout_time

shk_beamout_slot
shk_beamout_mag0
shk_beamout_mag1
shk_beamout_time

Destruction effects

dest_fx define the destruction effects. Example:

dest_fx = megadeth_42_0_-20_0	
dest_fx = megadeth_46_-20_0_20
dest_fx = megadeth_46_20_0_20
dest_fx = megadeth_46_0_0_0
dest_fx = death_42_0_-20_0	
dest_fx = death_43_-20_30_20

death and megadeth apply in different situations. FIXME
The first number is the effect model/unit (defined as a vehicle, usually in BRUCH.scr).
The other numbers are the coordinates where the effect is played.

Weapons

NOTE: Host station weapons are not defined here.
NOTE: Scouts do not usually have weapons. Scouts with weapons are glitchy.

weapon defines the primary weapon of the vehicle. The number points to weapon scripts. See Weapon scripts article
num_weapons defines the number of weapons, i.e. the number of simultaneous shots. It's 1 if not defined.

gun_angle is a firing angle of some sort. FIXME
gun_radius is an unused parameter. It's not known if it works. FIXME 

mgun defines the machine gun. It points to weapon scripts. Machine guns are “special” type weapons. See this article for information about machine guns.
gun_power defines the machine gun firepower. Note that machine gun power is defined per vehicle!

kill_after_shot is used to create a suicide vehicle. If set to 1, the vehicle dies after shooting. It's not known FIXME if higher values allow more shots. Serp and Blue Spore are examples of suicide vehicles. This parameter is omitted from non-suicide vehicles.

kamikaze is a special suicide bomb function which is used by Rock Sled. Unlike normal weapons, it does splash damage and it can be only triggered by the player. The value defines the energy of the blast.

fire_x
fire_y
fire_z
These are coordinates that define something related to firing. Possibly the location (relative to the vehicle) where the projectile is spawned. FIXME

Ratings

These define the suitability ratings of the vehicle against different targets. They are very important because the AI uses these ratings to determine what vehicles to use. The ratings range from 1 to 10. They can be also seen in the creation menu.

job_fightrobo suitability against host stations
job_fightflyer suitability against planes and bombers
job_fighthelicopter suitability against helicopters
job_fighttank suitability against tanks
job_conquer suitability for conquering sectors
job_reconnoitre suitability for reconnaissance

Host station-specific parameters

FIXME this section needs some more information

NOTE: These are for host stations only.
NOTE: Also see host-station specific sounds and palettes/shaking.

General parameters

robo_does_twist When used, the station spins when controlled by computer. (Player-controlled stations never spin.)
robo_does_flux When used, the station slowly moves up and down when controlled by computer.
NOTE: These two parameters do not have a value! See existing scripts for reference.

robo_data_slot This is an unknown parameter. FIXME

Camera options

robo_viewer_x
robo_viewer_y
robo_viewer_z
The location of the station viewer/camera.

robo_viewer_max_up
robo_viewer_max_down
robo_viewer_max_side
The maximum turning angles of the camera.

Gun turrets

robo_num_guns defines the number of turrets. It's set before the turret definitions.

NOTE: The turret definitions do not have an ending keyword so they should be in a strict order and the turrets should be numbered correctly. See existing scripts for reference.

robo_act_gun starts a turret definition. Its value is the ordinal number of the turret.

robo_gun_pos_x
robo_gun_pos_y
robo_gun_pos_z
Location of the turret relative to the station.

robo_gun_dir_x
robo_gun_dir_y
robo_gun_dir_z
Default direction vector of the gun when the station is spawned.
NOTE: The maximum turning angles are defined per turret unit, not here!

robo_gun_type defines the turret unit which is a vehicle. The turrets are “gun” type vehicles. Using other types is possible but may cause glitches.

robo_gun_name defines the gun name. It's not very important.

Collision boxes

robo_coll_num defines the number of collision boxes (actually spheres). It's set before the collision box definitions.

NOTE: The collision box definitions do not have an ending keyword so they should be in a strict order and should be numbered correctly. See existing scripts for reference.

robo_coll_act starts a collision box definition. Its value is the ordinal number of the box.

robo_coll_x
robo_coll_y
robo_coll_z
Location of the collision box relative to the station.

robo_coll_radius is the radius of the box (sphere).

Gun-specific parameters

NOTE: These are only for “gun” type units that are used as host station guns, flak turrets and radars.

gun_type defines the turret type. Possible types are:

  • flak used with flak turrets
  • dummy used with radars

The difference between these two types is unknown.

gun_side_angle defines the maximum turning angle around Y-axis.
gun_up_angle defines the maximum turning angle upwards.
gun_down_angle defines the maximum turning angle downwards.
A full circle seems to be 3200 units.

Effect model specific parameters

NOTE: The destruction effect models are defined as vehicles, usually in BRUCH.scr. They have some specific parameters and lack many others. The vehicle type of all stock effect models is either plane or heli.

pal_goingdown_slot
pal_goingdown_mag0
pal_goingdown_mag1
These define a palette of some kind. The “goingdown” palette is only seen with effect models.

scale_fx probably defines a shrink/enlarge animation.

scale_fx =  0.1_5_2_2000_225_225_225_225_226_226_227

FIXME The format of the sequence is not known for sure but it might be: First three numbers define the location (x,y,z), fourth number is time in milliseconds and the remaining numbers point to models in SET.BAS.

Sounds

NOTE: Sounds are often defined in a separate file (ssnd.scr). They can be defined in the main script as well.
NOTE: The voiceover (radio messages) are not defined here.

max_pitch is probably used to limit the pitch when the vehicle accelerates. FIXME It's sometimes set without using the equality sign (“=”) but it's not known if it's valid to do so.

The sound definitions are pretty self-explaining. Sample defines the audio file. Check existing scripts for reference.

snd_normal_sample
snd_normal_pitch
snd_normal_volume

snd_wait_sample
snd_wait_pitch
snd_wait_volume

snd_fire_sample
snd_fire_pitch
snd_fire_volume

snd_explode_sample
snd_explode_pitch
snd_explode_volume

snd_genesis_sample
snd_genesis_pitch
snd_genesis_volume

snd_crashvhcl_sample
snd_crashvhcl_pitch
snd_crashvhcl_volume

snd_crashland_sample
snd_crashland_pitch
snd_crashland_volume

snd_goingdown_sample
snd_goingdown_pitch
snd_goingdown_volume

snd_beamin_sample
snd_beamin_volume
snd_beamin_pitch seems to be unused

NOTE: The following sounds seem to be host station-specific.

snd_beamout_sample
snd_beamout_volume
snd_beamout_pitch seems to be unused

snd_build_sample
snd_build_volume
snd_build_pitch seems to be unused

Modifier keywords

These are used to increase/decrease certain values instead of setting new ones. These are often used with tech upgrades.

add_energy
add_shield
add_radar

FIXME Are there more? Add them!

References

modding/vehicle_script.txt · Last modified: 2014/01/08 07:11 by Ormu
Back to top
CC Attribution-Noncommercial-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0