Shiptest 13 - Modules - TypesVar Details - Proc Details

gun

Vars

adjust_fire_select_icon_state_on_safetyIf true, we put "safety_" before fire_select_icon_state_prefix's prefix. ex. "safety_laser_single"
allowed_ammo_typesAllowed base types of magazines with the gun
ammo_x_offsetUsed for positioning ammo count overlay on sprite
blacklisted_ammo_typesIncompatible magazines with the gun
bolt_drop_soundsound of dropping the bolt or releasing a slide
bolt_drop_sound_volumevolume of bolt drop/slide release
bolt_lockedUsed for locking bolt and open bolt guns. Set a bit differently for the two but prevents firing when true for both.
bolt_typeThe bolt type of the gun, affects quite a bit of functionality, see gun.dm in defines for bolt types: BOLT_TYPE_STANDARD; BOLT_TYPE_LOCKING; BOLT_TYPE_OPEN; BOLT_TYPE_NO_BOLT
bolt_wordingPhrasing of the bolt in examine and notification messages; ex: bolt, slide, etc.
burst_delayThe rate of fire when firing in a burst. Not the delay between bursts
burst_sizehow many shots per burst, Ex: most machine pistols, M90, some ARs are 3rnd burst, while others like the GAR and laser minigun are 2 round burst.
can_be_sawn_offWhether the gun can be sawn off by sawing tools
cartridge_wordingPhrasing of the cartridge in examine and notification messages; ex: bullet, shell, dart, etc.
casing_ejectorwhether the gun ejects the chambered casing
current_cooldownThis prevents gun from firing until the coodown is done, affected by lag
currently_firing_burstAre we firing a burst? If so, dont fire again until burst is done
default_ammo_typeCompatible magazines with the gun
default_attachmentsAttachments spawned on initialization. Should also be in valid attachments or it SHOULD(once i add that) fail
default_firemodeafter initializing, we set the firemode to this
eject_empty_soundsound of ejecting an empty magazine
eject_soundSound of ejecting a magazine
eject_sound_varywhether eject sound should vary
eject_sound_volumevolume of ejecting a magazine
empty_alarmWhether the gun alarms when empty or not.
empty_alarm_soundempty alarm sound (if enabled)
empty_alarm_varywhether empty alarm sound varies
empty_alarm_volumeempty alarm volume sound
empty_autoejectDo we eject the magazine upon runing out of ammo?
empty_indicatorWhether the sprite has a visible indicator for being empty or not.
fire_delayThe rate of fire when firing full auto and semi auto, and between bursts; for bursts its fire delay + burst_delay after every burst
fire_select_icon_state_prefixBASICALLY: the little button you select firing modes from? this is jsut the prefix of the icon state of that. For example, if we set it as "laser", the fire select will use "laser_single" and so on.
firemode_indexFiremode index, due to code shit this is the currently selected firemode
gun_firemodesOur firemodes, subtract and add to this list as needed. NOTE that the autofire component is given on init when FIREMODE_FULLAUTO is here.
gun_firenamesA acoc list that determines the names of firemodes. Use if you wanna be weird and set the name of say, FIREMODE_OTHER to "Underbarrel grenade launcher" for example.
has_safetyDoes this gun have a saftey and thus can toggle it?
internal_cellif the gun's cell cannot be replaced
internal_magazineWhether the gun has an internal magazine or a detatchable one. Overridden by BOLT_TYPE_NO_BOLT.
load_empty_soundsound when inserting an empty magazine
load_soundsound when inserting magazine
load_sound_varywhether loading sound should vary
load_sound_volumevolume of loading sound
lock_back_soundsound of when the bolt is locked back manually
lock_back_sound_varywhether lock back varies
lock_back_sound_volumevolume of lock back
mag_displayWhether the sprite has a visible magazine or not
mag_display_ammoWhether the sprite has a visible ammo display or not
magazineActual magazine currently contained within the gun
magazine_wordingPhrasing of the magazine in examine and notification messages; ex: magazine, box, etx
manufacturerThe manufacturer of this weapon. For flavor mostly. If none, this will not show.
min_recoilUsed if the guns recoil is lower then the min, it clamps the highest recoil
muzzle_flashEffect for the muzzle flash of the gun.
muzzle_flash_colorColor of the muzzle flash effect.
muzzle_flash_lumBrightness of the muzzle flash effect.
muzzleflash_iconstateIcon state of the muzzle flash effect.
rack_delaylength between individual racks
rack_soundsound of racking
rack_sound_varywhether racking sound should vary
rack_sound_volumevolume of racking
recent_racktime of the most recent rack, used for cooldown purposes
recoilScreen shake when the weapon is fired while wielded.
recoil_backtime_multipliera multiplier of the duration the recoil takes to go back to normal view, this is (recoil*recoil_backtime_multiplier)+1
recoil_deviationthis is how much deviation the gun recoil can have, recoil pushes the screen towards the reverse angle you shot + some deviation which this is the max.
recoil_unwieldedScreen shake when the weapon is fired while unwielded.
safetyIf the saftey on? If so, we can't fire the weapon
safety_multipliermultiplier for this gun's misfire chances. Closer to 0 is better.
safety_wordingThe wording of safety. Useful for guns that have a non-standard safety system, like a revolver
sealed_magazineWhether the gun can be reloaded
semi_autoWhether the gun has to be racked each shot or not.
show_ammo_capacity_on_magazine_spriteDo we show how much ammo is left on the sprite? In increments of 20.
show_magazine_on_spriteWhether the sprite has a visible magazine or not
show_magazine_on_sprite_ammoWhether the sprite has a visible ammo display or not
slot_availableNumber of attachments that can fit on a given slot
slot_offsetsOffsets for the slots on this gun. should be indexed by SLOT and then by X/Y
special_magsWhether the gun supports multiple special mag types
spreadHow much the bullet scatters when fired while wielded.
spread_unwieldedHow much the bullet scatters when fired while unwielded.
tac_reloadsWhether the gun can be tacloaded by slapping a fresh magazine directly on it
tactical_reload_delayIf we have the 'snowflake mechanic,' how long should it take to reload?
trigger_guardtrigger guard on the weapon. Used for hulk mutations and ashies. I honestly dont know how usefult his is, id avoid touching it
unique_mag_sprites_for_variantsWhether the gun supports multiple special mag types
valid_attachmentsThe types of attachments allowed, a list of types. SUBTYPES OF AN ALLOWED TYPE ARE ALSO ALLOWED
wield_delayHow long between wielding and firing in tenths of seconds
wield_slowdownSlowdown for wielding
wield_timeStoring value for above
zoom_amtDistance in TURFs to move the user's screen forward (the "zoom" effect)
zoomableWhether the gun generates a Zoom action on creation

Procs

blow_upused for sawing guns, causes the gun to fire without the input of the user
on_unwieldtriggered on unwield of two handed item
on_wieldtriggered on wield of two handed item
process_fireHandles everything involving firing.
sawoffUsed on init or try_sawoff
try_sawoffHandles all the logic of sawing off guns,

Var Details

adjust_fire_select_icon_state_on_safety

If true, we put "safety_" before fire_select_icon_state_prefix's prefix. ex. "safety_laser_single"

allowed_ammo_types

Allowed base types of magazines with the gun

ammo_x_offset

Used for positioning ammo count overlay on sprite

blacklisted_ammo_types

Incompatible magazines with the gun

bolt_drop_sound

sound of dropping the bolt or releasing a slide

bolt_drop_sound_volume

volume of bolt drop/slide release

bolt_locked

Used for locking bolt and open bolt guns. Set a bit differently for the two but prevents firing when true for both.

bolt_type

The bolt type of the gun, affects quite a bit of functionality, see gun.dm in defines for bolt types: BOLT_TYPE_STANDARD; BOLT_TYPE_LOCKING; BOLT_TYPE_OPEN; BOLT_TYPE_NO_BOLT

bolt_wording

Phrasing of the bolt in examine and notification messages; ex: bolt, slide, etc.

burst_delay

The rate of fire when firing in a burst. Not the delay between bursts

burst_size

how many shots per burst, Ex: most machine pistols, M90, some ARs are 3rnd burst, while others like the GAR and laser minigun are 2 round burst.

can_be_sawn_off

Whether the gun can be sawn off by sawing tools

cartridge_wording

Phrasing of the cartridge in examine and notification messages; ex: bullet, shell, dart, etc.

casing_ejector

whether the gun ejects the chambered casing

current_cooldown

This prevents gun from firing until the coodown is done, affected by lag

currently_firing_burst

Are we firing a burst? If so, dont fire again until burst is done

default_ammo_type

Compatible magazines with the gun

default_attachments

Attachments spawned on initialization. Should also be in valid attachments or it SHOULD(once i add that) fail

default_firemode

after initializing, we set the firemode to this

eject_empty_sound

sound of ejecting an empty magazine

eject_sound

Sound of ejecting a magazine

eject_sound_vary

whether eject sound should vary

eject_sound_volume

volume of ejecting a magazine

empty_alarm

Whether the gun alarms when empty or not.

empty_alarm_sound

empty alarm sound (if enabled)

empty_alarm_vary

whether empty alarm sound varies

empty_alarm_volume

empty alarm volume sound

empty_autoeject

Do we eject the magazine upon runing out of ammo?

empty_indicator

Whether the sprite has a visible indicator for being empty or not.

fire_delay

The rate of fire when firing full auto and semi auto, and between bursts; for bursts its fire delay + burst_delay after every burst

fire_select_icon_state_prefix

BASICALLY: the little button you select firing modes from? this is jsut the prefix of the icon state of that. For example, if we set it as "laser", the fire select will use "laser_single" and so on.

firemode_index

Firemode index, due to code shit this is the currently selected firemode

gun_firemodes

Our firemodes, subtract and add to this list as needed. NOTE that the autofire component is given on init when FIREMODE_FULLAUTO is here.

gun_firenames

A acoc list that determines the names of firemodes. Use if you wanna be weird and set the name of say, FIREMODE_OTHER to "Underbarrel grenade launcher" for example.

has_safety

Does this gun have a saftey and thus can toggle it?

internal_cell

if the gun's cell cannot be replaced

internal_magazine

Whether the gun has an internal magazine or a detatchable one. Overridden by BOLT_TYPE_NO_BOLT.

load_empty_sound

sound when inserting an empty magazine

load_sound

sound when inserting magazine

load_sound_vary

whether loading sound should vary

load_sound_volume

volume of loading sound

lock_back_sound

sound of when the bolt is locked back manually

lock_back_sound_vary

whether lock back varies

lock_back_sound_volume

volume of lock back

mag_display

Whether the sprite has a visible magazine or not

mag_display_ammo

Whether the sprite has a visible ammo display or not

magazine

Actual magazine currently contained within the gun

magazine_wording

Phrasing of the magazine in examine and notification messages; ex: magazine, box, etx

manufacturer

The manufacturer of this weapon. For flavor mostly. If none, this will not show.

min_recoil

Used if the guns recoil is lower then the min, it clamps the highest recoil

muzzle_flash

Effect for the muzzle flash of the gun.

muzzle_flash_color

Color of the muzzle flash effect.

muzzle_flash_lum

Brightness of the muzzle flash effect.

muzzleflash_iconstate

Icon state of the muzzle flash effect.

rack_delay

length between individual racks

rack_sound

sound of racking

rack_sound_vary

whether racking sound should vary

rack_sound_volume

volume of racking

recent_rack

time of the most recent rack, used for cooldown purposes

recoil

Screen shake when the weapon is fired while wielded.

recoil_backtime_multiplier

a multiplier of the duration the recoil takes to go back to normal view, this is (recoil*recoil_backtime_multiplier)+1

recoil_deviation

this is how much deviation the gun recoil can have, recoil pushes the screen towards the reverse angle you shot + some deviation which this is the max.

recoil_unwielded

Screen shake when the weapon is fired while unwielded.

safety

If the saftey on? If so, we can't fire the weapon

safety_multiplier

multiplier for this gun's misfire chances. Closer to 0 is better.

safety_wording

The wording of safety. Useful for guns that have a non-standard safety system, like a revolver

sealed_magazine

Whether the gun can be reloaded

semi_auto

Whether the gun has to be racked each shot or not.

show_ammo_capacity_on_magazine_sprite

Do we show how much ammo is left on the sprite? In increments of 20.

show_magazine_on_sprite

Whether the sprite has a visible magazine or not

show_magazine_on_sprite_ammo

Whether the sprite has a visible ammo display or not

slot_available

Number of attachments that can fit on a given slot

slot_offsets

Offsets for the slots on this gun. should be indexed by SLOT and then by X/Y

special_mags

Whether the gun supports multiple special mag types

spread

How much the bullet scatters when fired while wielded.

spread_unwielded

How much the bullet scatters when fired while unwielded.

tac_reloads

Whether the gun can be tacloaded by slapping a fresh magazine directly on it

tactical_reload_delay

If we have the 'snowflake mechanic,' how long should it take to reload?

trigger_guard

trigger guard on the weapon. Used for hulk mutations and ashies. I honestly dont know how usefult his is, id avoid touching it

unique_mag_sprites_for_variants

Whether the gun supports multiple special mag types

valid_attachments

The types of attachments allowed, a list of types. SUBTYPES OF AN ALLOWED TYPE ARE ALSO ALLOWED

wield_delay

How long between wielding and firing in tenths of seconds

wield_slowdown

Slowdown for wielding

wield_time

Storing value for above

zoom_amt

Distance in TURFs to move the user's screen forward (the "zoom" effect)

zoomable

Whether the gun generates a Zoom action on creation

Proc Details

blow_up

used for sawing guns, causes the gun to fire without the input of the user

on_unwield

triggered on unwield of two handed item

on_wield

triggered on wield of two handed item

process_fire

Handles everything involving firing.

Returns TRUE or FALSE depending on if it actually fired a shot. Arguments:

sawoff

Used on init or try_sawoff

try_sawoff

Handles all the logic of sawing off guns,