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

material_container

Vars

allowed_item_typecacheThe typecache of things that this material container can accept
allowed_materialsThe list of materials that this material container can accept
mat_container_flagsThe material container flags. See __DEFINES/materials.dm.
materialsMap of material ref -> amount
max_amountThe maximum amount of materials this material container can contain
precise_insertionWhether or not this material container allows specific amounts from sheets to be inserted
registered_signalsSignals that are registered with this contained

Procs

InitializeSets up the proper signals and fills the list of materials with the appropriate references.
can_hold_materialThe default check for whether we can add materials to this material container.
get_item_material_amountReturns the amount of material relevant to this container; if this container does not support glass, any glass in 'I' will not be taken into account
get_material_amountReturns the amount of a specific material in this container.
has_enough_of_materialReturns TRUE if you have enough of the specified material.
has_materialsChecks if its possible to afford a certain amount of materials. Takes a dictionary of materials. coefficient can be thought of as the machines efficiency & multiplier as the print quantity
has_spaceProc that returns TRUE if the container has space
insert_amount_matFor inserting an amount of material. Use this to add materials to the container directly
insert_itemProc specifically for inserting items, use this when you want to insert any item into the container this bypasses most of the material flag checks so much be used by machines like recycler, stacking machine etc that does not care for such checks
insert_item_materials3 Types of Procs Material Insertion : Insert materials into the container Material Validation : Checks how much materials are available, Extracts materials from items if the container can hold them Material Removal : Removes material from the container
on_item_insertProc that allows players to fill the parent with mats
on_requesting_context_from_itemAdds context sensitivy directly to the material container file for screentips Arguments:
retrieve_allProc to get all the materials and dump them as sheets
retrieve_sheetsFor spawning mineral sheets at a specific location. Used by machines to output sheets.
total_amountreturns the total amount of material in the container
ui_dataList format is list(material_name = list(amount = ..., ref = ..., etc.))
use_amount_matUses an amount of a specific material, effectively removing it.
use_materialsFor consuming a dictionary of materials.
user_insertinserts an item from the players hand into the container. Loops through all the contents inside recursively Does all explicit checking for mat flags & callbacks to check if insertion is valid This proc is what you should be using for almost all cases

Var Details

allowed_item_typecache

The typecache of things that this material container can accept

allowed_materials

The list of materials that this material container can accept

mat_container_flags

The material container flags. See __DEFINES/materials.dm.

materials

Map of material ref -> amount

max_amount

The maximum amount of materials this material container can contain

precise_insertion

Whether or not this material container allows specific amounts from sheets to be inserted

registered_signals

Signals that are registered with this contained

Proc Details

Initialize

Sets up the proper signals and fills the list of materials with the appropriate references.

can_hold_material

The default check for whether we can add materials to this material container.

Arguments:

get_item_material_amount

Returns the amount of material relevant to this container; if this container does not support glass, any glass in 'I' will not be taken into account

Arguments:

get_material_amount

Returns the amount of a specific material in this container.

Arguments: -mat : the material type to check for 3 cases a) If it's an path its ref is retrieved b) If it's text then its an category material & there is no way to deal with it so return 0 c) If normal material proceeds as usual

has_enough_of_material

Returns TRUE if you have enough of the specified material.

Arguments:

has_materials

Checks if its possible to afford a certain amount of materials. Takes a dictionary of materials. coefficient can be thought of as the machines efficiency & multiplier as the print quantity

Arguments:

has_space

Proc that returns TRUE if the container has space

Arguments:

insert_amount_mat

For inserting an amount of material. Use this to add materials to the container directly

Arguments:

insert_item

Proc specifically for inserting items, use this when you want to insert any item into the container this bypasses most of the material flag checks so much be used by machines like recycler, stacking machine etc that does not care for such checks

Arguments:

insert_item_materials

3 Types of Procs Material Insertion : Insert materials into the container Material Validation : Checks how much materials are available, Extracts materials from items if the container can hold them Material Removal : Removes material from the container

Each Proc further belongs to a specific category LOW LEVEL: Procs that are used internally & should not be used anywhere else unless you know what your doing MID LEVEL: Procs that can be used by machines(like recycler, stacking machines) to bypass majority of checks HIGH LEVEL: Procs that can be used by anyone publicly and guarantees safety checks & limits

Inserts the relevant materials from an item into this material container. This low level proc should not be used directly by anyone

Arguments:

on_item_insert

Proc that allows players to fill the parent with mats

on_requesting_context_from_item

Adds context sensitivy directly to the material container file for screentips Arguments:

retrieve_all

Proc to get all the materials and dump them as sheets

Arguments:

retrieve_sheets

For spawning mineral sheets at a specific location. Used by machines to output sheets.

Arguments: sheet_amt: number of sheets to extract material: type of sheets present in this container to extract target: drop location [atom][context]: context - the atom performing the operation, this is the last argument sent in COMSIG_MATCONTAINER_SHEETS_RETRIEVED and is used mostly for silo logging

total_amount

returns the total amount of material in the container

ui_data

List format is list(material_name = list(amount = ..., ref = ..., etc.))

use_amount_mat

Uses an amount of a specific material, effectively removing it.

Arguments:

use_materials

For consuming a dictionary of materials.

Arguments:

user_insert

inserts an item from the players hand into the container. Loops through all the contents inside recursively Does all explicit checking for mat flags & callbacks to check if insertion is valid This proc is what you should be using for almost all cases

Arguments: