mecha_part_fabricator
Vars | |
being_built | The current design datum that the machine is building. |
---|---|
build_finish | World time when the build will finish. |
build_materials | Reference to all materials used in the creation of the item being_built. |
build_start | World time when the build started. |
component_coeff | Coefficient for the efficiency of material usage in item building. Based on the installed parts. |
link_on_init | Whether the Exofab links to the ore silo on init. Special derelict or maintanance variants should set this to FALSE. |
part_sets | A list of categories that valid MECHFAB design datums will broadly categorise themselves under. |
process_queue | Whether or not the machine is building the entire queue automagically. |
queue | Current items in the build queue. |
rmat | Reference to a remote material inventory, such as an ore silo. |
stored_part | Part currently stored in the Exofab. |
stored_research | Copy of the currently synced techweb. |
time_coeff | Coefficient for the speed of item building. Based on the installed parts. |
Procs | |
add_part_set_to_queue | Adds a list of datum designs to the build queue. |
add_to_queue | Adds a datum design to the build queue. |
build_next_in_queue | Attempts to build the next item in the build queue. |
build_part | Starts the build process for a given design datum. |
check_resources | Checks if the Exofab has enough resources to print a given item. |
dispense_built_part | Dispenses a part to the tile infront of the Exosuit Fab. |
eject_sheets | Eject material sheets. |
get_construction_time_w_coeff | Calculates the coefficient-modified build time of a design. |
get_resource_cost_w_coeff | Calculates the coefficient-modified resource cost of a single material component of a design's recipe. |
get_resources_w_coeff | Calculates resource/material costs for printing an item based on the machine's resource coefficient. |
list_queue | Generates a list of parts formatted for tgui based on the current build queue. |
on_finish_printing | Intended to be called when the exofab has stopped working and is no longer printing items. |
on_start_printing | Intended to be called when an item starts printing. |
output_available_resources | Generates a list of resources / materials available to this Exosuit Fab |
output_part_info | Generates an info list for a given part. |
remove_from_queue | Removes datum design from the build queue based on index. |
sync | Syncs machine with R&D servers. |
Var Details
being_built
The current design datum that the machine is building.
build_finish
World time when the build will finish.
build_materials
Reference to all materials used in the creation of the item being_built.
build_start
World time when the build started.
component_coeff
Coefficient for the efficiency of material usage in item building. Based on the installed parts.
link_on_init
Whether the Exofab links to the ore silo on init. Special derelict or maintanance variants should set this to FALSE.
part_sets
A list of categories that valid MECHFAB design datums will broadly categorise themselves under.
process_queue
Whether or not the machine is building the entire queue automagically.
queue
Current items in the build queue.
rmat
Reference to a remote material inventory, such as an ore silo.
stored_part
Part currently stored in the Exofab.
stored_research
Copy of the currently synced techweb.
time_coeff
Coefficient for the speed of item building. Based on the installed parts.
Proc Details
add_part_set_to_queue
Adds a list of datum designs to the build queue.
Will only add designs that are in this machine's stored techweb. Does final checks for datum IDs and makes sure this machine can build the designs.
- part_list - List of datum design ids for designs to add to the queue.
add_to_queue
Adds a datum design to the build queue.
Returns TRUE if successful and FALSE if the design was not added to the queue.
- D - Datum design to add to the queue.
build_next_in_queue
Attempts to build the next item in the build queue.
Returns FALSE if either there are no more parts to build or the next part is not buildable. Returns TRUE if the next part has started building.
- verbose - Whether the machine should use say() procs. Set to FALSE to disable the machine saying reasons for failure to build.
build_part
Starts the build process for a given design datum.
Returns FALSE if the procedure fails. Returns TRUE when being_built is set. Uses materials.
- D - Design datum to attempt to print.
- verbose - Whether the machine should use say() procs. Set to FALSE to disable the machine saying reasons for failure to build.
check_resources
Checks if the Exofab has enough resources to print a given item.
Returns FALSE if the design has no reagents used in its construction (?) or if there are insufficient resources. Returns TRUE if there are sufficient resources to print the item.
- D - Design datum to calculate the modified resource cost of.
dispense_built_part
Dispenses a part to the tile infront of the Exosuit Fab.
Returns FALSE is the machine cannot dispense the part on the appropriate turf. Return TRUE if the part was successfully dispensed.
- D - Design datum to attempt to dispense.
eject_sheets
Eject material sheets.
Returns the number of sheets successfully ejected. eject_sheet - Byond REF of the material to eject. eject_amt - Number of sheets to attempt to eject.
get_construction_time_w_coeff
Calculates the coefficient-modified build time of a design.
Returns coefficient-modified build time of a given design.
- D - Design datum to calculate the modified build time of.
- roundto - Rounding value for round() proc
get_resource_cost_w_coeff
Calculates the coefficient-modified resource cost of a single material component of a design's recipe.
Returns coefficient-modified resource cost for the given material component.
- D - Design datum to pull the resource cost from.
- resource - Material datum reference to the resource to calculate the cost of.
- roundto - Rounding value for round() proc
get_resources_w_coeff
Calculates resource/material costs for printing an item based on the machine's resource coefficient.
Returns a list of k,v resources with their amounts.
- D - Design datum to calculate the modified resource cost of.
list_queue
Generates a list of parts formatted for tgui based on the current build queue.
Returns a formatted list of lists containing formatted part information for every part in the build queue.
on_finish_printing
Intended to be called when the exofab has stopped working and is no longer printing items.
Removes the overlay to show the fab working and sets idle power usage settings. Additionally resets the description and turns off queue processing.
on_start_printing
Intended to be called when an item starts printing.
Adds the overlay to show the fab working and sets active power usage settings.
output_available_resources
Generates a list of resources / materials available to this Exosuit Fab
Returns null if there is no material container available. List format is list(material_name = list(amount = ..., ref = ..., etc.))
output_part_info
Generates an info list for a given part.
Returns a list of part information.
- D - Design datum to get information on.
- categories - Boolean, whether or not to parse snowflake categories into the part information list.
remove_from_queue
Removes datum design from the build queue based on index.
Returns TRUE if successful and FALSE if a design was not removed from the queue.
- index - Index in the build queue of the element to remove.
sync
Syncs machine with R&D servers.
Requires an R&D Console visible within 7 tiles. Copies techweb research. Updates tgui's state data.