storage

Vars | |
access_delay | How long does it take to put items into or out of this, in ticks |
---|---|
allow_drawing_method | whether this object can change its drawing method |
allow_quick_empty | Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor. |
allow_quick_gather | Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile. |
boxes | storage UI |
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 |
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_border_end | In slotless storage, stores areas where clicking will refer to the associated item |
click_border_start | In slotless storage, stores areas where clicking will refer to the associated item |
closer | storage UI |
collection_mode | FALSE = pick one at a time, TRUE = pick all on tile |
content_watchers | list of mobs currently seeing the storage's contents |
display_contents_with_number | Set this to make the storage item group contents of the same type and display them as a number. |
draw_mode | FALSE = will open the inventory if you click on the storage container, TRUE = will draw from the inventory if you click on the storage container |
draw_sound | the sound produced when the special item is drawn |
foldable | BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard |
holsterable_allowed | the snowflake item(s) that will update the sprite. |
holstered_item | records the specific special item currently in the holster |
holstered_item_underlay | Image that get's underlayed under the sprite of the holster |
max_storage_space | The sum of the storage costs of all the items in this storage item. |
max_w_class | Max size of objects that this object can store (in effect only if canhold isn't set) |
opened | Has it been opened before? |
parent | A reference to the atom linked to this storage object If the parent goes, we go. Will never be null. |
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". |
refill_sound | What sound gets played when the item is tactical refilled |
refill_types | What item do you use to tactical refill this |
sheathe_sound | the sound produced when the special item is sheathed |
show_storage_fullness | whether our storage box on hud changes color when full. |
sprite_slots | Defines how many versions of the sprites that gets progressively emptier as they get closer to "_0" in .dmi. |
storage_continue | storage UI |
storage_end | storage UI |
storage_flags | flags for special behaviours |
storage_slots | The number of storage slots in this container. |
storage_start | storage UI |
storage_type_limits | Typecache of items that can always be inserted into this storage, regardless of size. |
storage_type_limits_max | Associated list of types and their max count, formatted as storage_type_limits_max = list( /obj/A = 3, ) |
stored_continue | storage UI |
stored_end | storage UI |
stored_start | storage UI |
trash_item | the item left behind when our parent is destroyed |
use_sound | sound played when used. null for no sound. |
use_to_pickup | Set this to make it possible to use this item in an inverse way, so you can have the item in your hand and click items on the floor to pick them up. |
Procs | |
attempt_draw_object | Attempts to get the first possible object from this container |
can_be_inserted | This proc return 1 if the item can be picked up and 0 if it can't. Set the warning to stop it from printing messages |
can_see_content | Returns a list of lookers, basically any mob that can see our contents |
close | Closes our storage |
delete_contents | Delete everything that's inside the storage |
do_refill | Refills the storage from the refill_types item |
handle_access_delay | This proc handles the delay associated with a storage object. If there is no delay, or the delay is negative, it simply returns TRUE. Should return true if the access delay is completed successfully. |
handle_atom_del | signal sent from /atom/proc/handle_atom_del(atom/A) |
handle_item_insertion | This proc handles items being inserted. It does not perform any checks of whether an item can or can't be inserted. That's done by can_be_inserted() The stop_warning parameter will stop the insertion message from being displayed. It is intended for cases where you are inserting multiple items at once, such as when picking up all the items on a tile with one click. user can be null, it refers to the potential mob doing the insertion. |
hide_from | Hides our inventory from user, sets s_active to null and removes user from content_watchers |
insertion_message | Output a message when an item is inserted into a storage object |
item_init_in_parent | Stores an item properly if its spawned directly into parent |
item_removed_from_storage | Handles if the item is forcemoved out of storage |
max_stack_merging | signal sent from /atom/proc/max_stack_merging() |
on_alt_click | Called when you alt + left click on parent Attempts to draw an object from our storage |
on_alt_right_click | Called when you alt + right click on parent Opens the inventory of our storage |
on_attack_hand | Called when you click on parent with an empty hand |
on_attack_hand_alternate | Called when you RIGHT click on parent with an empty hand Attempts to draw an object from our storage |
on_attack_self | BubbleWrap - Called when the parent clicks on itself. Used mostly to fold empty boxes |
on_attackby | This proc is called when you want to place an attacking_item into the storage |
on_contents_explode | handles explosions on parent exploding the things in storage |
on_ctrl_click | Called when you ctrl + left click on parent Attempts to draw an object from out storage, but it draw from the left side instead of the right |
on_emp | Called whenever parent is hit by an EMP, effectively EMPs everything inside your storage |
on_mousedrop_onto | Signal handler for when you click drag parent to something (usually ourselves or an inventory slot) |
on_quick_equip_request | Equips an item from our storage, returns signal COMSIG_QUICK_EQUIP_HANDLED to prevent standard quick equip behaviour |
open | Opens our storage, closes the storage if we are s_active |
orient2hud | This proc determines the size of the inventory to be displayed. Please touch it only if you know what you're doing. |
orient_objs | This proc draws out the inventory and places the items on it. tx and ty are the upper left tile and mx, my are the bottm right. The numbers are calculated from the bottom-left The bottom-left slot being 1,1. |
put_item_in_l_hand | Removes item_to_put_in_hand from the storage it's currently in, and then places it into our left hand |
put_item_in_r_hand | Removes item_to_put_in_hand from the storage it's currently in, and then places it into our right hand |
put_storage_in_hand | Wrapper that puts the storage into our chosen hand |
quick_empty | Dumps out the contents of our inventory onto our turf |
recalculate_storage_space | Called from signal in order to update the color of our storage, it's "fullness" basically |
register_storage_signals | Registers signals to parent |
remove_from_storage | Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target |
return_inv | Gets the inventory of a storage if recursive = TRUE, this will also get the inventories of things within the inventory |
set_parent | Set the passed atom as the parent |
should_access_delay | This proc checks to see if we should actually delay access in this scenario This proc should return TRUE or FALSE |
show_to | Shows our inventory to user, we become s_active and user is added to our content_watchers |
slot_orient_objs | This proc draws out the inventory and places the items on it. It uses the standard position. |
space_orient_objs | Generates a UI for slotless storage based on the objects inside of it |
storage_depth | Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area). Returns -1 if the atom was not found on container. |
storage_depth_turf | Like storage depth, but returns the depth to the nearest turf. Returns -1 if no top level turf (a loc was null somewhere, or a non-turf atom's loc was an area somehow). |
unregister_storage_signals | Unregisters our signals from parent. Used when parent loses storage but is not destroyed |
update_verbs | Updates our verbs if we are equipped |
Var Details
access_delay

How long does it take to put items into or out of this, in ticks
allow_drawing_method

whether this object can change its drawing method
allow_quick_empty

Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.
allow_quick_gather

Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
boxes

storage UI
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
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_border_end

In slotless storage, stores areas where clicking will refer to the associated item
click_border_start

In slotless storage, stores areas where clicking will refer to the associated item
closer

storage UI
collection_mode

FALSE = pick one at a time, TRUE = pick all on tile
content_watchers

list of mobs currently seeing the storage's contents
display_contents_with_number

Set this to make the storage item group contents of the same type and display them as a number.
draw_mode

FALSE = will open the inventory if you click on the storage container, TRUE = will draw from the inventory if you click on the storage container
draw_sound

the sound produced when the special item is drawn
foldable

BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard
holsterable_allowed

the snowflake item(s) that will update the sprite.
holstered_item

records the specific special item currently in the holster
holstered_item_underlay

Image that get's underlayed under the sprite of the holster
max_storage_space

The sum of the storage costs of all the items in this storage item.
max_w_class

Max size of objects that this object can store (in effect only if canhold isn't set)
opened

Has it been opened before?
parent

A reference to the atom linked to this storage object If the parent goes, we go. Will never be null.
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.
refill_sound

What sound gets played when the item is tactical refilled
refill_types

What item do you use to tactical refill this
sheathe_sound

the sound produced when the special item is sheathed
show_storage_fullness

whether our storage box on hud changes color when full.
sprite_slots

Defines how many versions of the sprites that gets progressively emptier as they get closer to "_0" in .dmi.
storage_continue

storage UI
storage_end

storage UI
storage_flags

flags for special behaviours
storage_slots

The number of storage slots in this container.
storage_start

storage UI
storage_type_limits

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

Associated list of types and their max count, formatted as storage_type_limits_max = list( /obj/A = 3, )
Any inserted objects will decrement the allowed count of every listed type which matches or is a parent of that object. With entries for both /obj/A and /obj/A/B, inserting a B requires non-zero allowed count remaining for, and reduces, both.
stored_continue

storage UI
stored_end

storage UI
stored_start

storage UI
trash_item

the item left behind when our parent is destroyed
use_sound

sound played when used. null for no sound.
use_to_pickup

Set this to make it possible to use this item in an inverse way, so you can have the item in your hand and click items on the floor to pick them up.
Proc Details
attempt_draw_object
Attempts to get the first possible object from this container
Arguments:
- mob/living/user - The mob attempting to draw from this container
- start_from_left - If true we draw the leftmost object instead of the rightmost. FALSE by default.
can_be_inserted
This proc return 1 if the item can be picked up and 0 if it can't. Set the warning to stop it from printing messages
can_see_content
Returns a list of lookers, basically any mob that can see our contents
close
Closes our storage
delete_contents
Delete everything that's inside the storage
do_refill
Refills the storage from the refill_types item
handle_access_delay
This proc handles the delay associated with a storage object. If there is no delay, or the delay is negative, it simply returns TRUE. Should return true if the access delay is completed successfully.
handle_atom_del
signal sent from /atom/proc/handle_atom_del(atom/A)
handle_item_insertion
This proc handles items being inserted. It does not perform any checks of whether an item can or can't be inserted. That's done by can_be_inserted() The stop_warning parameter will stop the insertion message from being displayed. It is intended for cases where you are inserting multiple items at once, such as when picking up all the items on a tile with one click. user can be null, it refers to the potential mob doing the insertion.
hide_from
Hides our inventory from user, sets s_active to null and removes user from content_watchers
insertion_message
Output a message when an item is inserted into a storage object
item_init_in_parent
Stores an item properly if its spawned directly into parent
item_removed_from_storage
Handles if the item is forcemoved out of storage
max_stack_merging
signal sent from /atom/proc/max_stack_merging()
on_alt_click
Called when you alt + left click on parent Attempts to draw an object from our storage
on_alt_right_click
Called when you alt + right click on parent Opens the inventory of our storage
on_attack_hand
Called when you click on parent with an empty hand
on_attack_hand_alternate
Called when you RIGHT click on parent with an empty hand Attempts to draw an object from our storage
on_attack_self
BubbleWrap - Called when the parent clicks on itself. Used mostly to fold empty boxes
on_attackby
This proc is called when you want to place an attacking_item into the storage
on_contents_explode
handles explosions on parent exploding the things in storage
on_ctrl_click
Called when you ctrl + left click on parent Attempts to draw an object from out storage, but it draw from the left side instead of the right
on_emp
Called whenever parent is hit by an EMP, effectively EMPs everything inside your storage
on_mousedrop_onto
Signal handler for when you click drag parent to something (usually ourselves or an inventory slot)
on_quick_equip_request
Equips an item from our storage, returns signal COMSIG_QUICK_EQUIP_HANDLED to prevent standard quick equip behaviour
open
Opens our storage, closes the storage if we are s_active
orient2hud
This proc determines the size of the inventory to be displayed. Please touch it only if you know what you're doing.
orient_objs
This proc draws out the inventory and places the items on it. tx and ty are the upper left tile and mx, my are the bottm right. The numbers are calculated from the bottom-left The bottom-left slot being 1,1.
put_item_in_l_hand
Removes item_to_put_in_hand from the storage it's currently in, and then places it into our left hand
put_item_in_r_hand
Removes item_to_put_in_hand from the storage it's currently in, and then places it into our right hand
put_storage_in_hand
Wrapper that puts the storage into our chosen hand
quick_empty
Dumps out the contents of our inventory onto our turf
recalculate_storage_space
Called from signal in order to update the color of our storage, it's "fullness" basically
register_storage_signals
Registers signals to parent
remove_from_storage
Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target
Arguments:
- item: the item that is getting removed
- new_location: where the item is being sent to
- user: whoever/whatever is calling this proc
- silent: defaults to FALSE, on subtypes this is used to prevent a sound from being played
- bypass_delay: if TRUE, will bypass draw delay
return_inv
Gets the inventory of a storage if recursive = TRUE, this will also get the inventories of things within the inventory
set_parent
Set the passed atom as the parent
should_access_delay
This proc checks to see if we should actually delay access in this scenario This proc should return TRUE or FALSE
show_to
Shows our inventory to user, we become s_active and user is added to our content_watchers
slot_orient_objs
This proc draws out the inventory and places the items on it. It uses the standard position.
space_orient_objs
Generates a UI for slotless storage based on the objects inside of it
storage_depth
Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area). Returns -1 if the atom was not found on container.
storage_depth_turf
Like storage depth, but returns the depth to the nearest turf. Returns -1 if no top level turf (a loc was null somewhere, or a non-turf atom's loc was an area somehow).
unregister_storage_signals
Unregisters our signals from parent. Used when parent loses storage but is not destroyed
update_verbs
Updates our verbs if we are equipped