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

design

Design Datums All the data for building stuff.

Vars

autolathe_exportableFor protolathe designs that don't require reagents: If they can be exported to autolathes with a design disk or not.
build_pathThe typepath of the object produced by this design
build_typeBitflags indicating what machines this design is compatable with. ([IMPRINTER]|AWAY_IMPRINTER|[PROTOLATHE]|AWAY_LATHE|[AUTOLATHE]|[MECHFAB]|[BIOGENERATOR]|[LIMBGROWER]|[SMELTER])
categoryWhat categories this design falls under. Used for sorting in production machines.
construction_timeThe amount of time required to create one unit of the product.
departmental_flagsBitflags indicating what departmental lathes should be allowed to process this design.
descDescription of the created object
icon_cacheAppears to be unused.
idThe ID of the design. Used for quick reference. Alphanumeric, lower-case, no symbols
inherit_materialsA variable for if and how we want the printed object to receive the materials that were used to print it.
lathe_time_factorHow many times faster than normal is this to build on the protolathe
make_reagentReagent produced by this design. Currently only supported by the biogenerator.
materialsList of materials required to create one unit of the product. Format is (typepath or requirements datum) -> amount
nameName of the created object
reagents_listList of reagents required to create one unit of the product. Currently only supported by the limb grower.
research_iconOverride for the automatic icon generation used for the research console.
research_icon_stateOverride for the automatic icon state generation used for the research console.
search_metadataOptional string that interfaces can use as part of search filters. See- item/borg/upgrade/ai and the Exosuit Fabs.
transfered_materialsIf set, instead of transfering the contents of the materials var to the item(s), this list will be used. This is useful for printed items that possess fewer mats than those used in the process of printing them, Or items that in turn contain more items that can be extracted and recycled singularly.
unlocked_byWhat techwebs nodes unlock this design. Constructed by SSresearch

Procs

create_resultProduce the resulting item, optionally with a specfic amount if we're a stack design
get_descriptionReturns the description of the design
simple_transfer_materialsCalled by [proc/transfer_materials] in two places and it's basically the meat and bone of the function. Having it as a separate proc reduces copypaste a little.
transfer_materialsA proc that handles transfering the materials to the target object and anything it contains that isn't abstract. You can check the doc for var/list/transfered_materials for how it works.

Var Details

autolathe_exportable

For protolathe designs that don't require reagents: If they can be exported to autolathes with a design disk or not.

build_path

The typepath of the object produced by this design

build_type

Bitflags indicating what machines this design is compatable with. ([IMPRINTER]|AWAY_IMPRINTER|[PROTOLATHE]|AWAY_LATHE|[AUTOLATHE]|[MECHFAB]|[BIOGENERATOR]|[LIMBGROWER]|[SMELTER])

category

What categories this design falls under. Used for sorting in production machines.

construction_time

The amount of time required to create one unit of the product.

departmental_flags

Bitflags indicating what departmental lathes should be allowed to process this design.

desc

Description of the created object

icon_cache

Appears to be unused.

id

The ID of the design. Used for quick reference. Alphanumeric, lower-case, no symbols

inherit_materials

A variable for if and how we want the printed object to receive the materials that were used to print it.

P.S. unit test checks for materials are not performed on designs that use /datum/material_requirement. The only thing we would've to check in that case would be the amounts but not the types, and that isn't worth it.

lathe_time_factor

How many times faster than normal is this to build on the protolathe

make_reagent

Reagent produced by this design. Currently only supported by the biogenerator.

materials

List of materials required to create one unit of the product. Format is (typepath or requirements datum) -> amount

name

Name of the created object

reagents_list

List of reagents required to create one unit of the product. Currently only supported by the limb grower.

research_icon

Override for the automatic icon generation used for the research console.

research_icon_state

Override for the automatic icon state generation used for the research console.

search_metadata

Optional string that interfaces can use as part of search filters. See- item/borg/upgrade/ai and the Exosuit Fabs.

transfered_materials

If set, instead of transfering the contents of the materials var to the item(s), this list will be used. This is useful for printed items that possess fewer mats than those used in the process of printing them, Or items that in turn contain more items that can be extracted and recycled singularly.

Here's an example of how it's supposed to be structured: transfered_materials = list( /obj/item/printed = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 2.5), /obj/item/inside_printed = list(/datum/material/glass = SMALL_MATERIAL_AMOUNT * 2.5), )

A few things to consider though:

  1. It shouldn't include materials not present in the 'materials' variable.
  2. The sum of each material in the lists shouldn't surpass what present in the 'materials' list.
  3. It's incompatible with material_slot and material_requirement datums. This might change in the future, i dunno.
  4. this does nothing if 'inherit_materials' is set to DESIGN_DONT_INHERIT_MATS.

I've set a few unit test checks to make sure that things don't go wrong anyway, so don't worry too much about it

unlocked_by

What techwebs nodes unlock this design. Constructed by SSresearch

Proc Details

create_result

Produce the resulting item, optionally with a specfic amount if we're a stack design

get_description

Returns the description of the design

simple_transfer_materials

Called by [proc/transfer_materials] in two places and it's basically the meat and bone of the function. Having it as a separate proc reduces copypaste a little.

transfer_materials

A proc that handles transfering the materials to the target object and anything it contains that isn't abstract. You can check the doc for var/list/transfered_materials for how it works.