User Tools

Site Tools


world_setup:weapons_reference:control_modes

Weapon Control Parameters

Each weapon in your weapon script must have a 'CONTROL=' field, which determines how the player fires the weapon..You can use it to make weapons that need a quick keypress to fire, or weapons that increase their fire 'strength' the longer the key is held down.

e.g.

Weapon 2
{             #Plasma gun
  Control=Basic
  Fire=DualAim 
  Object=Plasma1
}

All of the 'Control' modes generate a 'Fire Parameter' value from 0.0 to 1.0 that is passed to the 'FIRE=' function. By combining different 'Control=' and 'Fire=' functions you can make weapons where holding the key down controls the fire angle, or range, or type, etc.

Options for the Control field are:

Control=Basic

When the key is pressed, the weapon is fired once. (As long as the DELAY between firing time has passed). If the key is held, the weapon continues to fire at the regular delay intervals. The Fire parameter is always 1.

Control=BasicPlane

Same as Basic but the weapon can only be fired when the vehicle is in 'flight mode'.

Control=HoldStep

When the fire key is first pressed, a timer is started. The parameter sent to the Fire function depends on how long the player holds the key down. The weapon is fired when the key is released. The length of the key press is grouped into 3 bands:

Keypress   Fire Parameter
< 1/2 sec      0.5 
< 2 sec         0.8 
> 2 sec         1.0 

Control=MG

Acts the same as Basic but a strobe lighting effect is added whenever the key is held down (and there is ammunition available).

Control=MGPlane

This is the same as MG but the weapon cannot be fired when not in flight mode.

Control=Javelin

A bar is displayed on screen, which increases in value as the player holds the key. The 'Param=' field (See below) is used to specify the length of time (in 1/1000th of a sec) the key needs to be held for before the bar gets to full strength. Once past this time, the bar resets back to 0.0 and begins to increase again. The Fire parameter sent is the scale of the bar - varying from 0.0 when at the lowest point to 1.0 when full.

Control=HoldBar

HoldBar works (like the 'Javelin' mode) so that the longer the player holds the key, the bigger the 'fire parameter' is. Unlike the Javelin mode, 'HoldBar' works in distinct steps. e.g. You can use it so that holding the fire key for 0 to 1 seconds produces a parameter of 0.25, 1 to 2 seconds gives a parameter of 0.5, 2 to 3 seconds gives a parameter of 0.75 .. etc. The number of divisions of the bar is set by adding a 'STEPS=' parameter to the weapon.

Control=Portal

This is a special control type used specifically for the 'portal' weapon. (Most other normal fields, such as 'OBJECT=' etc, are ignored in this mode). When the player first 'fires' the portal weapon, they drop a little beacon at their current location. Next time they 'fire' the weapon they are warped back to the spot at which they dropped the weapon.

Control=Basic2

FIXME : Probably doesnt do anything?

Control=TargetForce

FIXME : TBD

Control=TargetWildlife

FIXME : TBD

world_setup/weapons_reference/control_modes.txt · Last modified: 2020/02/17 17:35 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki