Skip to content

Firing modes

mugling edited this page Jun 23, 2016 · 5 revisions

By default all guns are semi-automatic and fire one round at a time.

Automatic fire can be specified via the burst parameter. For example the hk_mp5 can be fire single shots or bursts of (up to) 5 shots:

"id": "hk_mp5",
"type": "GUN",
"burst": 5

Some guns support selective fire with multiple modes. These can be specified via the alternative modes syntax. For example the sig552 can be fire single shots, a three round burst or be used fully-automatic for bursts of (up to) 8 shots:

"id": "sig552",
"type": "GUN",
"modes": [
    [ "DEFAULT", "semi-auto", 1 ],
    [ "BURST", "3 rd.", 3 ],
    [ "AUTO", "auto", 8 ]
]

Some guns can only be fired full-auto, for example the m134:

"id": "m134",
"type": "GUN",
"modes": [
    [ "DEFAULT", "auto", 100 ]
]

For some guns the default display name is inappropriate and can be changed via modes. For example revolvers have a single fire mode which should be described as revolver and not semi-automatic:

"abstract": "pistol_revolver",
"copy-from": "pistol_base",
"type": "GUN",
"modes": [
   [ "DEFAULT", "revolver", 1 ]
]

The burst syntax is more concise and less error-prone and is therefore the preferred form.

Mode name

When using the modes syntax you must specify at least a DEFAULT mode and if the gun has a separate automatic mode this should be AUTO. Any additional burst mode is BURST although this has no special meaning in the code.

Other arbitrary modes are supported and as a matter of style should be entered in capitals. Each mode may be specified only once for a given gun and it is an error to specify both modes and burst.

Display name

The second array member is the displayed name when this mode is selected. To reduce the number of strings requiring translation the following nomenclature should be used:

  • semi-auto for guns that fire a single shot and eject a casing immediately after
  • revolver for wheel guns that fire single shots and eject casings when the player reloads
  • single for anything else including single-shot or break-action guns
  • auto for fully automatic weapons
  • double for shotguns or other weapons that can fire from multiple barrels simultaneously
  • multi for weapons firing from more than two barrels simultaneously
  • 3 rd. only for guns that have additional burst modes and should not be used in place of auto

Flags

The behavior of firing modes can be altered by extensible flags. For example triple_launcher_simple shouldn't be used by NPC's and for one mode all the barrels can be fired simultaneously (as opposed to sequentially):

"id": "triple_launcher_simple",
"type": "GUN",
"modes": [le
    [ "DEFAULT", "single", 1, "NPC_AVOID" ],
    [ "MULTI", "multi", 3, [ "NPC_AVOID", "SIMULTANEOUS" ]
]

Known flags:

  • NPC_AVOID - prohibits use by NPC's
  • MELEE - melee attack with the third parameter specifying reach distance
  • SIMULTANEOUS - multiple rounds fired simultaneously with recoil applied at the end
Clone this wiki locally