Weapon Scripts

Weapon scripts define all primary weapons and machine guns.

Because weapon scripts can be quite long a complete example is not included. See existing scripts for reference.

Weapon keywords

new_weapon starts a new weapon definition. It's followed by the weapon ID number which can be from 1 to 127 FIXME (or is it 255?). Number 0 may work but it may cause glitches.
modify_weapon starts a weapon modifier.
end ends these.

General

model defines the weapon type. Possible models are:

  • grenade is pretty self-explaining. It has a descending trajectory.
  • rocket is like a grenade but it has a straight trajectory until it runs out of fuel.
  • missile is like a rocket but it tracks the target that was locked when shooting.
  • bomb falls downwards. (Note: When deployed, bombs can have forward velocity like grenades, but the weapon type determines how the AI uses it!)
  • special is machine gun. See another article for machine gun information. Most of the following information does NOT apply to machine guns!

name defines the weapon name. It's not very important.
wireframe defines the weapon preview image that can be seen in the HUD of every vehicle that uses this weapon.

Physics and behavior

energy is the weapon power. This value is divided by 100 to get the value seen in the game.
mass is the mass of the projectile.
force is the driving force
airconst is the air drag constant. Force and airconst determine the maximum speed of the projectile (also, mass affects speed towards ground).
maxrot defines the maximum turning rate of the projectile.
radius defines a radius of some kind FIXME
type_icon defines an icon. It's not very important as it's not used anywhere.

start_speed is the forward speed of the projectile immediately after deployment.
life_time determines how long the projectile “lives” in milliseconds. After this time it explodes.
life_time_nt (“not tracking”) can be used to define the life time when the weapon was not locked to any target during deployment. It's usually used with missiles only but can be used with other weapon types too. If not defined, life_time is always used.
drive_time defines the duration of powered flight in milliseconds (after which the projectile runs out of fuel and starts to descend). It is used with rockets and missiles.

Shooting

shot_time is the time between shots in milliseconds when the vehicle is controlled by computer
shot_time_user is the time between shots when the vehicle is controlled by the player

salve_shots determines the number of shots in the “magazine”. It's used with some vehicles only.
salve_delay defines the time needed to reload the magazine.

Graphics/models

FIXME check these

vp_normal defines the appearance of the projectile when it's flying
vp_fire defines the appearance during deployment
vp_dead defines the appearance when the projectile dies
vp_wait this is unknown
vp_megadeth defines the appearance when the projectile hits the environment
vp_genesis defines the appearance when the projectile hits another unit FIXME

The model numbers define the model which is picked from SET.BAS package. See visproto.lst for a list of them.

Palettes and shaking

FIXME this needs lots of updating

pal_launch_slot
pal_launch_mag0
pal_launch_mag1
pal_launch_time

pal_normal_slot
pal_normal_mag0
pal_normal_mag1
pal_normal_time (this seems to be unused)

pal_hit_slot
pal_hit_mag0
pal_hit_mag1
pal_hit_time

shk_hit_slot
shk_hit_mag0
shk_hit_mag1
shk_hit_time
shk_hit_x
shk_hit_y
shk_hit_z
shk_hit_mute

These keywords define some effects. “pal” could mean “palette” and it might define color set or something. “shk” probably means “shake”. The keyword after these defines when the effect is applied, e.g. during launch.
slot keyword defines an effect slot of some kind. It might be related to the slots defined in every level file but this is unknown.
mag0 and mag1 keywords probably define the minimum and maximum magnitude of the effect.
time keyword defines the duration of the effect
x, y and z keywords define coordinates or distances of some kind.
mute keyword is unknown.

dest_fx entries define the destruction effects. Examples:

dest_fx                 =       	megadeth_123_0_0_0
dest_fx                 =       	death_123_0_0_0
dest_fx                 =       	megadeth_125_0_0_0 
dest_fx                 =       	death_125_0_0_0 

“Death” and “megadeth” effects are applied in different situations. The first number defines the effect “unit” (defined as a vehicle) and the other numbers are the coordinates relative to the projectile.

Target-specific parameters

energy_tank
energy_heli
energy_flyer
energy_robo
These are damage (energy) multipliers against different vehicle types. (Note: “robo” means host station)

radius_tank
radius_heli
radius_flyer
radius_robo
The function of these is currently unknown. FIXME These may define the radius of “proximity fuse”, or area of effect, against different vehicle types.

Sounds

NOTE: Sounds are often defined in a separate file (such as ssnd.scr).

snd_launch_sample
snd_launch_pitch
snd_launch_volume

snd_normal_sample
snd_normal_pitch
snd_normal_volume

snd_hit_sample
snd_hit_pitch
snd_hit_volume

These are pretty self-explaining. Sample keywords define the audio files.

Modifier keywords

FIXME Are there more?

These are often used with tech upgrades. They increase (negative decreases) the value instead of setting a new one.

add_energy
add_shot_time
add_shot_time_user

References

modding/weapon_script.txt · Last modified: 2014/01/07 15:39 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