Code: Select all
--data.lua
--====================================
-- defining shunter loco prototype
local shunterLoco = table.deepcopy(data.raw["locomotive"]["locomotive"]) -- copy the table that defines a loco
shunterLoco.name = "shunter-loco"
shunterLoco.max_speed = 60
shunterLoco.reversing_power_modifier = 1.00
--====================================
-- defining shunter recipe prototype
local shunterLocoRecipe = table.deepcopy(data.raw["recipe"]["locomotive"])
shunterLocoRecipe.name = "shunter-loco-recipe"
shunterLocoRecipe.enabled = true
shunterLocoRecipe.result = shunterLoco.name
--====================================
-- adding those prototypes to the game
data:extend({shunterLoco, shunterLocoRecipe})
Code: Select all
--language.cfg
[item-name]
shunter-loco=Shunter Locomotive
[item-description]
shunter-loco=A locomotive designated to move cars between rail yards.
[entity-name]
shunter-loco=Shunter Locomotive
[entity-description]
shunter-loco=A locomotive designated to move cars between rail yards.
Code: Select all
Item with name 'shunter-loco' does not exist