Skip to content

Data Stage Functions

Optera edited this page Apr 15, 2019 · 4 revisions

Table of Contents

data/utilities

copy_prototype

Copies prototypes and assigns new name to properties like minable.result.

Parameters:
prototype -> LuaPrototype
new_name -> string
Returns:
copied prototype -> LuaPrototype

create_icons

Adds new icon layers to a prototype icon or icons.

Parameters:
prototype -> LuaPrototype
new_layers -> array of icon_layer { icon, icon_size, tint (optional) }
Returns:
created layered icons -> array of icon_layer { icon, icon_size, tint (optional) }
nil on error

get_energy_value

Returns energy strings as base unit value + suffix.
Example get_energy_value('12kW') -> {12000, 'W'}

Parameters:
energy -> string
Returns:
value -> float
unit -> string

multiply_energy_value

Multiplies energy string.
Example multiply_energy_value('12kW', 2) -> '24000W'

Parameters:
energy -> string
multiplicator -> double
Returns:
energy -> string
Clone this wiki locally
You can’t perform that action at this time.