Space Station 13 - Modules - TypesVar Details - Proc Details

item

Vars

action_iconlist of icons-sheets for a given action to override the icon.
action_icon_statelist of icon states for a given action to override the icon_state.
actionslist of /datum/action's that this item has.
actions_typeslist of paths of action datums to give to the item on New().
allowedsuit storage stuff.
armour_penetrationpercentage of armour effectiveness to remove
attack_effect_overrideAllows you to override the attack animation with an attack effect
attack_speedThe click cooldown given after attacking. Lower numbers means faster attacks
attack_verbUsed in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]".
body_parts_coveredsee setup.dm for appropriate bit flags
cold_protectionflags which determine which body parts are protected from cold. Use the HEAD, UPPER_TORSO, LOWER_TORSO, etc. flags. See setup.dm
drop_soundSound used when dropping the item. May contain a list of sounds to pick from instead of a single path.
dye_colorUsed as the dye color source in the washing machine only (at the moment). Can be a hex color or a key corresponding to a registry entry, see washing_machine.dm
dying_keyWhat dye registry should be looked at when dying this item; see washing_machine.dm
embed_chanceSo items can have custom embedd values Because customisation is king
embedded_fall_pain_multiplierThe coefficient of multiplication for the damage this item does when falling out of a limb (this*w_class)
embedded_impact_pain_multiplierThe coefficient of multiplication for the damage this item does when first embedded (this*w_class)
embedded_pain_multiplierThe coefficient of multiplication for the damage this item does while embedded (this*w_class)
embedded_unsafe_removal_pain_multiplierThe coefficient of multiplication for the damage removing this without surgery causes (this*w_class)
embedded_unsafe_removal_timeA time in ticks, multiplied by the w_class.
enchant_typeWhat's the type on enchantment on it? 0
enchantsList(datum)
equip_delay_selfIn deciseconds, how long an item takes to equip/unequip; counts only for normal clothing slots, not pockets, hands etc.
equip_soundSound used when equipping the item into a valid slot. May contain a list of sounds to pick from instead of a single path.
flags_coverSpecial cover flags used for protection calculations.
flags_invThis flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc.
flags_inv_transparentThese flags will be added/removed (^=) to/from flags_inv in [/proc/check_obscured_slots()] if check_transparent argument is set to TRUE. Used in carbon's update icons shenanigans. Example: you can see someone's mask through their transparent visor, but you cannot reach it
gas_transfer_coefficient0 prevents all transfers, 1 is invisible for leaking gas from turf to mask and vice-versa (for masks right now, but at some point, i'd like to include space helmets)
ground_offset_xHow much to offset the item randomly either way alongside X visually
ground_offset_yHow much to offset the item randomly either way alongside Y visually
has_speed_harvestUsed in butchering of animals, set to TRUE for near instant butchering
heat_protectionflags which determine which body parts are protected from heat. Use the HEAD, UPPER_TORSO, LOWER_TORSO, etc. flags. See setup.dm
hidden_uplinkAll items can have an uplink hidden inside, just remember to add the triggers.
hit_reaction_chanceIf you want to have something unrelated to blocking/armour piercing etc. Maybe not needed, but trying to think ahead/allow more freedom
hitsoundSound played when you hit something with the item.
inhand_x_dimensionSame as for worn_x_dimension but for inhands, uses the lefthand_ and righthand_ file vars
inhand_y_dimensionSame as for worn_y_dimension but for inhands, uses the lefthand_ and righthand_ file vars
item_flagsFlags only used with items.
item_pixel_shiftDatum used in item pixel shift TGUI
item_state_colorif you want to color icon in hands, but not a icon of item
max_heat_protection_temperatureSet this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags
min_cold_protection_temperatureSet this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags
mob_throw_hit_soundUsed when yate into a mob.
move_resistSet in the Initialise depending on the item size. Unless it's overriden by a specific item
needs_permitUsed by security bots to determine if this item is safe for public use.
onmob_sheetsSprite sheets used to render clothing, if none of sprite_sheets are used
outline_filterHolder var for the item outline filter, null when no outline filter on the item.
permeability_coefficientfor chemicals/diseases
pickup_soundSound used when picking the item up (into your hands). May contain a list of sounds to pick from instead of a single path.
shields_penetrationamount by which block_chance decreases
siemens_coefficientfor electrical admittance/conductance (electrocution checks and shit)
slot_flagsThis is used to determine on which slots an item can fit.
slot_flags_2Additional slot flags, mostly used by humans.
slowdownHow much clothing is slowing you down. Negative values speeds you up
sound_cooldownUsed for hit sound cooldown
sprite_sheetsSprite sheets to render species clothing, takes priority over "onmob_sheets" var, but only takes one dmi
sprite_sheets_inhandUsed to override inhand items. Use a single .dmi and suffix the icon states inside with _l and _r for each hand.
stealthy_audioWhether or not we use stealthy audio levels for this item's attack sounds
thrownbyUID of a /mob that threw the item.
tool_behaviourWhat kind of tool are we?
tool_enabledIf we can turn on or off, are we currently active? Mostly for welders and this will normally be TRUE
tool_modeFor tools that have an extra mode.
tool_volumeHow loud are we when we use our tool?
toolbox_radial_menu_compatibilityFor tools that can be used from toolbox via radial menu
toolspeedIf this item is a tool, the speed multiplier
undyeableWhether the item is unaffected by standard dying.
usesoundPlayed when the item is used, for example tools.
worn_x_dimensionDimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly
worn_y_dimensionDimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly

Procs

AdjacentThis is necessary for storage items not on your person.
IsReflectThis proc determines if and at what% an object will reflect energy projectiles if it's in l_hand,r_hand or wear_suit
active_uplink_checkI placed this here because of how relevant it is. You place this in your uplinkable item to check if an uplink is active or not. If it is, it will display the uplink menu and return TRUE, else it'll return FALSE. If it returns true, I recommend closing the item's normal menu with "user << browse(null, "window=name")"
allow_attack_hand_dropIf we want to stop manual unequipping of item by hands, but only for user himself (almost NODROP)
allowed_for_alienIf xenos can manipulate with this item.
attackCalled from [/mob/living/proc/attackby]
attack_objThe equivalent of the standard version of /obj/item/proc/attack but for object targets.
camera_upgradeCamera upgrading stuff.
can_enter_storageCalled to check if this item can be put into a storage item.
carbon_skip_catch_checkIndividual check for items to skip catching.
droppedWhen item is officially left user
dye_itemUpdates an item's appearance to mimic the appearance of another item in the dye_registry's dictionary what types of items (beanie, jumpsuit, shoes, etc) src is dyed into depends on the dye_key unless an overidden dye_key is specified. For example if our dye_key is DYE_REGISTRY_UNDER and we specify to dye to DYE_RED, our item's appearance would then mimic /obj/item/clothing/under/color/red; see [code/_globalvars/lists/dye_registry.dm] for this dictionary
equip_to_best_slotPuts item into best inventory slot. If all slots are filled, item attempts to move in storage: container in offhand, belt, backpack. Proc is a real action after mob's client quick_equip hotkey is pressed. You can override it for diferent behavior.
equippedCalled after an item is placed in an equipment slot. Note that hands count as slots.
forceMove_turfSimple helper we need to call before putting any item in hands, to allow fancy animation. Item will be forceMoved() to turf below its holder.
get_clamped_volumeReturn sound volumet between 10 and 100, depending on the item weight class
get_heatGeneric get_heat proc. Returns 0 or number amount of heat an item gives.
give_item_actionGives one of our item actions to a mob, when equipped to a certain slot
handle_openspace_clickCalled on [/datum/element/openspace_item_click_handler/proc/on_afterattack]. Check the relative file for information.
is_crutchReturns an effectiveness of an item as a crunch, which allow mobs to stand if they are missing a leg/foot?
is_equippedReturns TRUE if the item is equipped by a mob, FALSE otherwise. This might need some error trapping, not sure if get_equipped_items() is safe for non-human mobs.
is_equivalentCheck used for telekinesis grabs
is_on_userProc that checks if item is on user
item_action_slot_checkSome items only give their actions buttons when in a specific slot.
mark_targetUsed to mark a target for the demo system during a melee attack chain, call this before return
melee_attack_chainThis is the proc that handles the order of an item_attack.
mob_can_equipMob 'M' is attempting to equip this item into the slot passed through as 'slot'. Return TRUE if it can do this and FALSE if it can't. IF this is being done by a mob other than M, it will include the mob equipper, who is trying to equip the item to mob M. equipper will be null otherwise. If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen.
on_enter_storageCalled when this item is added into a storage item, which is passed on as S. The loc variable is already set to the storage item.
on_exit_storageCalled when this item is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called.
on_foundCalled when "found" in pockets and storage items. Returns 1 if the search should end.
on_giveCalled when the giver gives it to the receiver.
on_thrownCalled by the carbon throw_item() proc. Returns null if the item negates the throw, or a reference to the thing to suffer the throw else.
pickupCalled just as an item is picked up (loc is not yet changed)
pre_attackbyCalled on the item before it hits something
remove_item_from_storageplease use this if you're going to snowflake an item out of a obj/item/storage
run_drop_held_itemThis proc is called whenever mob's client presses 'drop_held_object' hotkey Not for robots since they have their own key in [keybindinds/robot.dm] You can easily overriride it for different behavior on other items.
select_skinGlobal item proc for all of your unique item skin needs. Works with any item, and will change the skin to whatever you specify here. You can also manually override the icon with a unique skin if wanted, for the outlier cases. Override_icon_state should be a list. Generally requires NO_GAMEMODE_SKIN to not be set for changes to be applied.
separate_worn_overlaysworn_overlays to use when you'd want to use KEEP_APART. Don't use KEEP_APART neither there nor here, as it would break floating overlays
sharpen_actDefault item sharpening effect. Return FALSE to stop sharpening.
tool_attack_chainCalled on the item to check if it has any of the tool's behavior
ui_action_clickThis proc is executed when someone clicks the on-screen UI button. The default action is attack_self(). Checks before we get to here are: mob is alive, mob is not restrained, paralyzed, asleep, resting, laying, item is on the mob.
use_toolCalled when a mob tries to use the item as a tool. Handles most checks.
used_for_ventcrawlingConditional proc that allows ventcrawling with an item, if it has trait TRAIT_VENTCRAWLER_ITEM_BASED.
user_can_equipAdditional can equip checks when equipping is done by the user, and not by the code: /mob/verb/quick_equip
worn_overlaysOverlays for the worn overlay so you can overlay while you overlay eg: ammo counters, primed grenade flashing, etc. "icon_file" is used automatically for inhands etc. to make sure it gets the right inhand file

Var Details

action_icon

list of icons-sheets for a given action to override the icon.

action_icon_state

list of icon states for a given action to override the icon_state.

actions

list of /datum/action's that this item has.

actions_types

list of paths of action datums to give to the item on New().

allowed

suit storage stuff.

armour_penetration

percentage of armour effectiveness to remove

attack_effect_override

Allows you to override the attack animation with an attack effect

attack_speed

The click cooldown given after attacking. Lower numbers means faster attacks

attack_verb

Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]".

body_parts_covered

see setup.dm for appropriate bit flags

cold_protection

flags which determine which body parts are protected from cold. Use the HEAD, UPPER_TORSO, LOWER_TORSO, etc. flags. See setup.dm

drop_sound

Sound used when dropping the item. May contain a list of sounds to pick from instead of a single path.

dye_color

Used as the dye color source in the washing machine only (at the moment). Can be a hex color or a key corresponding to a registry entry, see washing_machine.dm

dying_key

What dye registry should be looked at when dying this item; see washing_machine.dm

embed_chance

So items can have custom embedd values Because customisation is king

embedded_fall_pain_multiplier

The coefficient of multiplication for the damage this item does when falling out of a limb (this*w_class)

embedded_impact_pain_multiplier

The coefficient of multiplication for the damage this item does when first embedded (this*w_class)

embedded_pain_multiplier

The coefficient of multiplication for the damage this item does while embedded (this*w_class)

embedded_unsafe_removal_pain_multiplier

The coefficient of multiplication for the damage removing this without surgery causes (this*w_class)

embedded_unsafe_removal_time

A time in ticks, multiplied by the w_class.

enchant_type

What's the type on enchantment on it? 0

enchants

List(datum)

equip_delay_self

In deciseconds, how long an item takes to equip/unequip; counts only for normal clothing slots, not pockets, hands etc.

equip_sound

Sound used when equipping the item into a valid slot. May contain a list of sounds to pick from instead of a single path.

flags_cover

Special cover flags used for protection calculations.

flags_inv

This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc.

flags_inv_transparent

These flags will be added/removed (^=) to/from flags_inv in [/proc/check_obscured_slots()] if check_transparent argument is set to TRUE. Used in carbon's update icons shenanigans. Example: you can see someone's mask through their transparent visor, but you cannot reach it

gas_transfer_coefficient

0 prevents all transfers, 1 is invisible for leaking gas from turf to mask and vice-versa (for masks right now, but at some point, i'd like to include space helmets)

ground_offset_x

How much to offset the item randomly either way alongside X visually

ground_offset_y

How much to offset the item randomly either way alongside Y visually

has_speed_harvest

Used in butchering of animals, set to TRUE for near instant butchering

heat_protection

flags which determine which body parts are protected from heat. Use the HEAD, UPPER_TORSO, LOWER_TORSO, etc. flags. See setup.dm

All items can have an uplink hidden inside, just remember to add the triggers.

hit_reaction_chance

If you want to have something unrelated to blocking/armour piercing etc. Maybe not needed, but trying to think ahead/allow more freedom

hitsound

Sound played when you hit something with the item.

inhand_x_dimension

Same as for worn_x_dimension but for inhands, uses the lefthand_ and righthand_ file vars

inhand_y_dimension

Same as for worn_y_dimension but for inhands, uses the lefthand_ and righthand_ file vars

item_flags

Flags only used with items.

item_pixel_shift

Datum used in item pixel shift TGUI

item_state_color

if you want to color icon in hands, but not a icon of item

max_heat_protection_temperature

Set this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags

min_cold_protection_temperature

Set this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags

mob_throw_hit_sound

Used when yate into a mob.

move_resist

Set in the Initialise depending on the item size. Unless it's overriden by a specific item

needs_permit

Used by security bots to determine if this item is safe for public use.

onmob_sheets

Sprite sheets used to render clothing, if none of sprite_sheets are used

outline_filter

Holder var for the item outline filter, null when no outline filter on the item.

permeability_coefficient

for chemicals/diseases

pickup_sound

Sound used when picking the item up (into your hands). May contain a list of sounds to pick from instead of a single path.

shields_penetration

amount by which block_chance decreases

siemens_coefficient

for electrical admittance/conductance (electrocution checks and shit)

slot_flags

This is used to determine on which slots an item can fit.

slot_flags_2

Additional slot flags, mostly used by humans.

slowdown

How much clothing is slowing you down. Negative values speeds you up

sound_cooldown

Used for hit sound cooldown

sprite_sheets

Sprite sheets to render species clothing, takes priority over "onmob_sheets" var, but only takes one dmi

sprite_sheets_inhand

Used to override inhand items. Use a single .dmi and suffix the icon states inside with _l and _r for each hand.

stealthy_audio

Whether or not we use stealthy audio levels for this item's attack sounds

thrownby

UID of a /mob that threw the item.

tool_behaviour

What kind of tool are we?

tool_enabled

If we can turn on or off, are we currently active? Mostly for welders and this will normally be TRUE

tool_mode

For tools that have an extra mode.

tool_volume

How loud are we when we use our tool?

toolbox_radial_menu_compatibility

For tools that can be used from toolbox via radial menu

toolspeed

If this item is a tool, the speed multiplier

undyeable

Whether the item is unaffected by standard dying.

usesound

Played when the item is used, for example tools.

worn_x_dimension

Dimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly

worn_y_dimension

Dimensions of the icon file used when this item is worn, eg: hats.dmi (32x32 sprite, 64x64 sprite, etc.). Allows inhands/worn sprites to be of any size, but still centered on a mob properly

Proc Details

Adjacent

This is necessary for storage items not on your person.

IsReflect

This proc determines if and at what% an object will reflect energy projectiles if it's in l_hand,r_hand or wear_suit

I placed this here because of how relevant it is. You place this in your uplinkable item to check if an uplink is active or not. If it is, it will display the uplink menu and return TRUE, else it'll return FALSE. If it returns true, I recommend closing the item's normal menu with "user << browse(null, "window=name")"

allow_attack_hand_drop

If we want to stop manual unequipping of item by hands, but only for user himself (almost NODROP)

allowed_for_alien

If xenos can manipulate with this item.

attack

Called from [/mob/living/proc/attackby]

Arguments:

attack_obj

The equivalent of the standard version of /obj/item/proc/attack but for object targets.

camera_upgrade

Camera upgrading stuff.

can_enter_storage

Called to check if this item can be put into a storage item.

Return FALSE if src can't be inserted, and TRUE if it can. Arguments:

carbon_skip_catch_check

Individual check for items to skip catching.

dropped

When item is officially left user

dye_item

Updates an item's appearance to mimic the appearance of another item in the dye_registry's dictionary what types of items (beanie, jumpsuit, shoes, etc) src is dyed into depends on the dye_key unless an overidden dye_key is specified. For example if our dye_key is DYE_REGISTRY_UNDER and we specify to dye to DYE_RED, our item's appearance would then mimic /obj/item/clothing/under/color/red; see [code/_globalvars/lists/dye_registry.dm] for this dictionary

once everything is updated, the target type path that we dyed the item into is returned

Arguments:

equip_to_best_slot

Puts item into best inventory slot. If all slots are filled, item attempts to move in storage: container in offhand, belt, backpack. Proc is a real action after mob's client quick_equip hotkey is pressed. You can override it for diferent behavior.

Arguments:

equipped

Called after an item is placed in an equipment slot. Note that hands count as slots.

Arguments:

forceMove_turf

Simple helper we need to call before putting any item in hands, to allow fancy animation. Item will be forceMoved() to turf below its holder.

get_clamped_volume

Return sound volumet between 10 and 100, depending on the item weight class

get_heat

Generic get_heat proc. Returns 0 or number amount of heat an item gives.

give_item_action

Gives one of our item actions to a mob, when equipped to a certain slot

handle_openspace_click

Called on [/datum/element/openspace_item_click_handler/proc/on_afterattack]. Check the relative file for information.

is_crutch

Returns an effectiveness of an item as a crunch, which allow mobs to stand if they are missing a leg/foot?

is_equipped

Returns TRUE if the item is equipped by a mob, FALSE otherwise. This might need some error trapping, not sure if get_equipped_items() is safe for non-human mobs.

is_equivalent

Check used for telekinesis grabs

is_on_user

Proc that checks if item is on user

item_action_slot_check

Some items only give their actions buttons when in a specific slot.

mark_target

Used to mark a target for the demo system during a melee attack chain, call this before return

melee_attack_chain

This is the proc that handles the order of an item_attack.

The order of procs called is:

All the procs in the attack chain SHOULD return one of the two core bitflags:

Optional bitflags:

Returns a combination of all the bitflags we get on every step of the chain.

mob_can_equip

Mob 'M' is attempting to equip this item into the slot passed through as 'slot'. Return TRUE if it can do this and FALSE if it can't. IF this is being done by a mob other than M, it will include the mob equipper, who is trying to equip the item to mob M. equipper will be null otherwise. If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen.

Arguments:

on_enter_storage

Called when this item is added into a storage item, which is passed on as S. The loc variable is already set to the storage item.

on_exit_storage

Called when this item is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called.

on_found

Called when "found" in pockets and storage items. Returns 1 if the search should end.

on_give

Called when the giver gives it to the receiver.

on_thrown

Called by the carbon throw_item() proc. Returns null if the item negates the throw, or a reference to the thing to suffer the throw else.

pickup

Called just as an item is picked up (loc is not yet changed)

pre_attackby

Called on the item before it hits something

Arguments:

See: /obj/item/proc/melee_attack_chain

remove_item_from_storage

please use this if you're going to snowflake an item out of a obj/item/storage

run_drop_held_item

This proc is called whenever mob's client presses 'drop_held_object' hotkey Not for robots since they have their own key in [keybindinds/robot.dm] You can easily overriride it for different behavior on other items.

select_skin

Global item proc for all of your unique item skin needs. Works with any item, and will change the skin to whatever you specify here. You can also manually override the icon with a unique skin if wanted, for the outlier cases. Override_icon_state should be a list. Generally requires NO_GAMEMODE_SKIN to not be set for changes to be applied.

Returns whether changes were applied.

separate_worn_overlays

worn_overlays to use when you'd want to use KEEP_APART. Don't use KEEP_APART neither there nor here, as it would break floating overlays

sharpen_act

Default item sharpening effect. Return FALSE to stop sharpening.

tool_attack_chain

Called on the item to check if it has any of the tool's behavior

Arguments:

See: /obj/item/proc/melee_attack_chain

ui_action_click

This proc is executed when someone clicks the on-screen UI button. The default action is attack_self(). Checks before we get to here are: mob is alive, mob is not restrained, paralyzed, asleep, resting, laying, item is on the mob.

use_tool

Called when a mob tries to use the item as a tool. Handles most checks.

used_for_ventcrawling

Conditional proc that allows ventcrawling with an item, if it has trait TRAIT_VENTCRAWLER_ITEM_BASED.

user_can_equip

Additional can equip checks when equipping is done by the user, and not by the code: /mob/verb/quick_equip

worn_overlays

Overlays for the worn overlay so you can overlay while you overlay eg: ammo counters, primed grenade flashing, etc. "icon_file" is used automatically for inhands etc. to make sure it gets the right inhand file