/tg/ Station 13 - Modules - TypesVar Details - Proc Details

storage

Datumized Storage Eliminates the need for custom signals specifically for the storage component, and attaches a storage variable (atom_storage) to every atom. The parent and real_location variables are both weakrefs, so they must be resolved before they can be used. If you're looking to create custom storage type behaviors, check ../subtypes

Vars

allow_big_nestingWhether we allow storage objects of the same size inside.
allow_quick_emptyIf TRUE, we can use-in-hand the storage object to dump all of its contents.
allow_quick_gatherIf TRUE, we can click on items with the storage object to pick them up and insert them.
animatedDetermines whether we play a rustle animation when inserting/removing items.
attack_hand_interactWhether we open when attack_handed (clicked on with an empty hand).
can_holdTypecache of items that can be inserted into this storage. By default, all item types can be inserted (assuming other conditions are met). Do not set directly, use set_holdable
can_hold_descriptionAn additional description shown on double-examine. Is autogenerated to the can_hold list if not set.
cant_holdTypecache of items that cannot be inserted into this storage. By default, no item types are barred from insertion. Do not set directly, use set_holdable
click_alt_openSwitch this off if you want to handle click_alt in the parent atom
collection_modeThe mode for collection when allow_quick_gather is enabled. See [code/__DEFINES/storage.dm]
display_contentsIf TRUE, shows the contents of the storage in open_storage
do_rustleDetermines whether we play a rustle sound when inserting/removing items.
exception_holdTypecache of items that can always be inserted into this storage, regardless of size.
exception_maxFor use with an exception typecache: The maximum amount of items of the exception type that can be inserted into this storage.
insert_on_attackdo we insert items when clicked by them?
insert_prepositionThe preposition used when inserting items into this storage. IE: You put things in a bag, but on a plate.
is_usingList of all the mobs currently viewing the contents of this storage.
lockedWhether the storage is currently locked (inaccessible). See [code/__DEFINES/storage.dm]
max_slotsThe maximum amount of items that can be inserted into this storage.
max_specific_storageThe largest weight class that can be inserted into this storage, inclusive.
max_total_storageDetermines the maximum amount of weight that can be inserted into this storage. Weight is calculated by the sum of all of our content's weight classes.
modeswitch_actionRef to the item action that toggles collectmode.
numerical_stackingInstead of displaying multiple items of the same type, display them as numbered contents.
open_soundThe sound to play when we open/access the storage
parentA reference to the atom linked to this storage object If the parent goes, we go. Will never be null.
quickdrawif TRUE, alt-click takes an item out instantly rather than opening up storage.
real_locationA reference to the atom where the items are actually stored. By default this is parent. Should generally never be null. Sometimes it's not the parent, that's what is called "dissassociated storage".
remove_rustle_soundPath for the item's rustle sound when removing items.
rustle_soundPath for the item's rustle sound.
screen_max_columnsMaximum amount of columns a storage object can have
screen_max_rowsMaximum amount of rows a storage object can have
screen_pixel_xX-pixel location of the boxes and close button
screen_pixel_yY-pixel location of the boxes and close button
screen_start_xWhere storage starts being rendered, x-screen_loc wise
screen_start_yWhere storage starts being rendered, y-screen_loc wise
silentIf TRUE, chat messages for inserting/removing items will not be shown.
silent_for_userSame as above but only for the user. Useful to cut on chat spam without removing feedback for other players.
storage_interfacesAssociated list that keeps track of all storage UI datums per person.
supports_smart_equipIf we support smartly removing/inserting things from ourselves

Procs

animate_parentGives a spiffy animation to our parent to represent opening and closing.
attempt_insertAttempts to insert an item into the storage
attempt_removeAttempts to remove an item from the storage Ignores removal do_afters. Only use this if you're doing it as part of a dumping action
can_insertChecks if an item is capable of being inserted into the storage.
can_see_contentsChecks who is currently capable of viewing our storage (and is.)
close_allClose the storage UI for everyone viewing us.
close_distanceSignal handler for whenever a mob walks away with us, close if they can't reach us.
collect_on_turfCollects every item of a type on a turf.
contents_changed_w_classSignal proc for COMSIG_ATOM_CONTENTS_WEIGHT_CLASS_CHANGED to drop items out of our storage if they're suddenly too heavy.
dump_content_atDumps all of our contents at a specific location.
generate_hold_descGenerates a description, primarily for clothing storage.
get_exception_countReturns a count of how many items held due to exception_hold we have
get_total_weightReturns a sum of all of our content's weight classes
handle_enterAutomatically ran on all object insertions: flag marking and view refreshing.
handle_exitAutomatically ran on all object removals: flag marking and view refreshing.
handle_mass_pickupInserts every item in a given list, with a progress bar
hide_contentsHide our storage from a mob.
item_insertion_feedbackProvides visual feedback in chat for an item insertion
item_interact_insertCalled directly from the attack chain if [insert_on_attack] is TRUE. Handles inserting an item into the storage when clicked.
mass_emptySignal handler for remove_all()
mousedrop_receiveSince items inside storages ignore transparency for QOL reasons, we're tracking when things are dropped onto them instead of our UI elements
on_attackSignal handler for whenever we're attacked by a mob.
on_click_altAlt click on the storage item. Default: Open the storage.
on_emp_actSignal handler for emp_act to emp all contents
on_mousedrop_ontoSignal handler for whenever we drag the storage somewhere.
on_mousedropped_ontoSignal handler for whenever something gets mouse-dropped onto us.
on_preattackSignal handler for preattack from an object.
open_storageOpens the storage to the mob, showing them the contents to their UI.
open_storage_on_signalSignal handler to open up the storage when we receive a signal.
orient_storageUpdates views of all objects in storage and stretches UI to appropriate size
process_numerical_displayGenerates the numbers on an item in storage to show stacking.
put_in_hands_asyncAsync version of putting something into a mobs hand.
real_location_deletedSignal handler for when the real location is deleted.
refresh_viewsRefresh the views of everyone currently viewing the storage.
remove_allRemoves everything inside of our storage
remove_and_refreshResets an object, removes it from our screen, and refreshes the view.
remove_singleAllows a mob to attempt to remove a single item from the storage Allows for hooks into things like removal delays
remove_typeRemoves only a specific type of item from our storage
reset_itemRefreshes and item to be put back into the real world, out of storage.
return_invRecursive proc to get absolutely EVERYTHING inside a storage item, including the contents of inner items.
set_parentSet the passed atom as the parent
set_real_locationSets where items are physically being stored in the case it shouldn't be on the parent.
show_contentsShow our storage to a mob.
toggle_collection_modeToggles the collectmode of our storage.
update_actionsUpdates the action button for toggling collectmode.

Var Details

allow_big_nesting

Whether we allow storage objects of the same size inside.

allow_quick_empty

If TRUE, we can use-in-hand the storage object to dump all of its contents.

allow_quick_gather

If TRUE, we can click on items with the storage object to pick them up and insert them.

animated

Determines whether we play a rustle animation when inserting/removing items.

attack_hand_interact

Whether we open when attack_handed (clicked on with an empty hand).

can_hold

Typecache of items that can be inserted into this storage. By default, all item types can be inserted (assuming other conditions are met). Do not set directly, use set_holdable

can_hold_description

An additional description shown on double-examine. Is autogenerated to the can_hold list if not set.

cant_hold

Typecache of items that cannot be inserted into this storage. By default, no item types are barred from insertion. Do not set directly, use set_holdable

click_alt_open

Switch this off if you want to handle click_alt in the parent atom

collection_mode

The mode for collection when allow_quick_gather is enabled. See [code/__DEFINES/storage.dm]

display_contents

If TRUE, shows the contents of the storage in open_storage

do_rustle

Determines whether we play a rustle sound when inserting/removing items.

exception_hold

Typecache of items that can always be inserted into this storage, regardless of size.

exception_max

For use with an exception typecache: The maximum amount of items of the exception type that can be inserted into this storage.

insert_on_attack

do we insert items when clicked by them?

insert_preposition

The preposition used when inserting items into this storage. IE: You put things in a bag, but on a plate.

is_using

List of all the mobs currently viewing the contents of this storage.

locked

Whether the storage is currently locked (inaccessible). See [code/__DEFINES/storage.dm]

max_slots

The maximum amount of items that can be inserted into this storage.

max_specific_storage

The largest weight class that can be inserted into this storage, inclusive.

max_total_storage

Determines the maximum amount of weight that can be inserted into this storage. Weight is calculated by the sum of all of our content's weight classes.

modeswitch_action

Ref to the item action that toggles collectmode.

numerical_stacking

Instead of displaying multiple items of the same type, display them as numbered contents.

open_sound

The sound to play when we open/access the storage

parent

A reference to the atom linked to this storage object If the parent goes, we go. Will never be null.

quickdraw

if TRUE, alt-click takes an item out instantly rather than opening up storage.

real_location

A reference to the atom where the items are actually stored. By default this is parent. Should generally never be null. Sometimes it's not the parent, that's what is called "dissassociated storage".

Do NOT set this directly, use set_real_location.

remove_rustle_sound

Path for the item's rustle sound when removing items.

rustle_sound

Path for the item's rustle sound.

screen_max_columns

Maximum amount of columns a storage object can have

screen_max_rows

Maximum amount of rows a storage object can have

screen_pixel_x

X-pixel location of the boxes and close button

screen_pixel_y

Y-pixel location of the boxes and close button

screen_start_x

Where storage starts being rendered, x-screen_loc wise

screen_start_y

Where storage starts being rendered, y-screen_loc wise

silent

If TRUE, chat messages for inserting/removing items will not be shown.

silent_for_user

Same as above but only for the user. Useful to cut on chat spam without removing feedback for other players.

storage_interfaces

Associated list that keeps track of all storage UI datums per person.

supports_smart_equip

If we support smartly removing/inserting things from ourselves

Proc Details

animate_parent

Gives a spiffy animation to our parent to represent opening and closing.

attempt_insert

Attempts to insert an item into the storage

Arguments

attempt_remove

Attempts to remove an item from the storage Ignores removal do_afters. Only use this if you're doing it as part of a dumping action

Arguments

can_insert

Checks if an item is capable of being inserted into the storage.

Arguments

can_see_contents

Checks who is currently capable of viewing our storage (and is.)

close_all

Close the storage UI for everyone viewing us.

close_distance

Signal handler for whenever a mob walks away with us, close if they can't reach us.

collect_on_turf

Collects every item of a type on a turf.

@param obj/item/thing the initial object to pick up @param mob/user the user who is picking up the items

contents_changed_w_class

Signal proc for COMSIG_ATOM_CONTENTS_WEIGHT_CLASS_CHANGED to drop items out of our storage if they're suddenly too heavy.

dump_content_at

Dumps all of our contents at a specific location.

@param atom/dest_object where to dump to @param mob/user the user who is dumping the contents

generate_hold_desc

Generates a description, primarily for clothing storage.

get_exception_count

Returns a count of how many items held due to exception_hold we have

get_total_weight

Returns a sum of all of our content's weight classes

handle_enter

Automatically ran on all object insertions: flag marking and view refreshing.

handle_exit

Automatically ran on all object removals: flag marking and view refreshing.

handle_mass_pickup

Inserts every item in a given list, with a progress bar

Arguments

hide_contents

Hide our storage from a mob.

Arguments

item_insertion_feedback

Provides visual feedback in chat for an item insertion

Arguments

item_interact_insert

Called directly from the attack chain if [insert_on_attack] is TRUE. Handles inserting an item into the storage when clicked.

mass_empty

Signal handler for remove_all()

mousedrop_receive

Since items inside storages ignore transparency for QOL reasons, we're tracking when things are dropped onto them instead of our UI elements

on_attack

Signal handler for whenever we're attacked by a mob.

on_click_alt

Alt click on the storage item. Default: Open the storage.

on_emp_act

Signal handler for emp_act to emp all contents

on_mousedrop_onto

Signal handler for whenever we drag the storage somewhere.

on_mousedropped_onto

Signal handler for whenever something gets mouse-dropped onto us.

on_preattack

Signal handler for preattack from an object.

open_storage

Opens the storage to the mob, showing them the contents to their UI.

open_storage_on_signal

Signal handler to open up the storage when we receive a signal.

orient_storage

Updates views of all objects in storage and stretches UI to appropriate size

process_numerical_display

Generates the numbers on an item in storage to show stacking.

put_in_hands_async

Async version of putting something into a mobs hand.

real_location_deleted

Signal handler for when the real location is deleted.

refresh_views

Refresh the views of everyone currently viewing the storage.

remove_all

Removes everything inside of our storage

Arguments

remove_and_refresh

Resets an object, removes it from our screen, and refreshes the view.

@param atom/movable/gone the object leaving our storage

remove_single

Allows a mob to attempt to remove a single item from the storage Allows for hooks into things like removal delays

Arguments

remove_type

Removes only a specific type of item from our storage

Arguments

reset_item

Refreshes and item to be put back into the real world, out of storage.

return_inv

Recursive proc to get absolutely EVERYTHING inside a storage item, including the contents of inner items.

Arguments

set_parent

Set the passed atom as the parent

set_real_location

Sets where items are physically being stored in the case it shouldn't be on the parent.

Does not handle moving any existing items, that must be done manually.

Arguments

show_contents

Show our storage to a mob.

Arguments

Returns

toggle_collection_mode

Toggles the collectmode of our storage.

@param mob/to_show the mob toggling us

update_actions

Updates the action button for toggling collectmode.