materials
Vars | |
base_stack_recipes | List of stackcrafting recipes for materials using base recipes |
---|---|
dimensional_themes | A list of dimensional themes used by the dimensional anomaly and other things, most of which require materials to function. |
material_combos | A cache of all material combinations that have been used |
materialids_by_category | Dictionary of category || list of material ids, mostly used by rnd machines like autolathes. |
materialids_by_type | Dictionary of type || list of material ids |
materials | Dictionary of material.id || material ref |
materials_by_category | Dictionary of category || list of material refs |
materials_by_type | Dictionary of type || list of material refs |
rigid_stack_recipes | List of stackcrafting recipes for materials using rigid recipes |
Procs | |
FindOrCreateMaterialCombo | Returns a list to be used as an object's custom_materials. Lists will be cached and re-used based on the parameters. |
GetIdFromArguments | |
InitializeMaterial | |
InitializeMaterials | Ran on initialize, populated the materials and materials_by_category dictionaries with their appropriate vars (See these variables for more info) |
_GetMaterialRef |
Var Details
base_stack_recipes
List of stackcrafting recipes for materials using base recipes
dimensional_themes
A list of dimensional themes used by the dimensional anomaly and other things, most of which require materials to function.
material_combos
A cache of all material combinations that have been used
materialids_by_category
Dictionary of category || list of material ids, mostly used by rnd machines like autolathes.
materialids_by_type
Dictionary of type || list of material ids
materials
Dictionary of material.id || material ref
materials_by_category
Dictionary of category || list of material refs
materials_by_type
Dictionary of type || list of material refs
rigid_stack_recipes
List of stackcrafting recipes for materials using rigid recipes
Proc Details
FindOrCreateMaterialCombo
Returns a list to be used as an object's custom_materials. Lists will be cached and re-used based on the parameters.
GetIdFromArguments
-
I'm not going to lie, this was swiped from SSdcs.
-
Credit does to ninjanomnom
-
Generates an id for bespoke
elementsmaterials when given the argument list -
Generating the id here is a bit complex because we need to support named arguments
-
Named arguments can appear in any order and we need them to appear after ordered arguments
-
We assume that no one will pass in a named argument with a value of null
InitializeMaterial
-
Creates and caches a material datum.
-
Arguments:
-
- arguments: The arguments to use to create the material datum
-
- The first element is the type of material to initialize.
InitializeMaterials
Ran on initialize, populated the materials and materials_by_category dictionaries with their appropriate vars (See these variables for more info)
_GetMaterialRef
-
Fetches a cached material singleton when passed sufficient arguments.
-
Arguments:
-
- arguments: The list of arguments used to fetch the material ref.
-
- The first element is a material datum, text string, or material type.
-
- [Material datums][/datum/material] are assumed to be references to the cached datum and are returned
-
- Text is assumed to be the text ID of a material and the corresponding material is fetched from the cache
-
- A material type is checked for bespokeness:
-
- If the material type is not bespoke the type is assumed to be the id for a material and the corresponding material is loaded from the cache.
-
- If the material type is bespoke a text ID is generated from the arguments list and used to load a material datum from the cache.
-
- The following elements are used to generate bespoke IDs