Data :: struct - abstract
| raw | :: dictionary[string → dictionary[string → AnyPrototype]] | A dictionary of prototype types to values that themselves are dictionaries of prototype names to specific prototypes. [...] |
A dictionary of prototype types to values that themselves are dictionaries of prototype names to specific prototypes. [...] | ||
| extend | :: DataExtendMethod | The primary way to add prototypes to the data table. |
The primary way to add prototypes to the data table. | ||
| is_demo | :: boolean | Set by the game based on whether the demo or retail version is running. [...] |
Set by the game based on whether the demo or retail version is running. [...] | ||
Properties
raw :: dictionary[string → dictionary[string → AnyPrototype]] 
Examples
-- set the stack size of coal to be 1000
data.raw["item"]["coal"].stack_size = 1000
-- get the max health of the wooden chest
local health = data.raw["container"]["wooden-chest"].max_health
extend :: DataExtendMethod
Example
local not_coal =
{
type = "item",
name = "a-thing",
icon = "__base__/graphics/icons/coal.png",
icon_size = 64,
stack_size = 2
}
local proto2 =
{
type = "fuel-category",
name = "best-fuel"
}
data:extend({not_coal, proto2})

