How to override base entity?
Posted: Sun Apr 03, 2016 9:50 pm
Hi all. I don't know my way around lua, but figured I might be able to at least modify some base values by copying the entity info and changing it in a mod. While the couple of mods I made loaded fine (no errors), they also haven't changed anything in-game. I was hoping someone can point me in the right direction.
For example:
This is the entry for rail tracks (straight and curved) in the base game's entities.lua file. In my mod's entities.lua, I copy/pasted that and added "data:extend(" at the front and a closing parenthesis at the end. I changed the "mining time" to 0.2, but it has no effect in-game. My mod doesn't have a "control.lua", since I couldn't figure out what to put in there, lol. Any help or info in making simple mods to override base values would be appreciated!
For example:
Code: Select all
{
type = "straight-rail",
name = "straight-rail",
icon = "__base__/graphics/icons/straight-rail.png",
flags = {"placeable-neutral", "player-creation", "building-direction-8-way"},
minable = {mining_time = 1, result = "straight-rail"},
max_health = 100,
corpse = "straight-rail-remnants",
collision_box = {{-0.7, -0.8}, {0.7, 0.8}},
selection_box = {{-0.7, -0.8}, {0.7, 0.8}},
rail_category = "regular",
pictures = railpictures(),
},
{
type = "curved-rail",
name = "curved-rail",
icon = "__base__/graphics/icons/curved-rail.png",
flags = {"placeable-neutral", "player-creation", "building-direction-8-way"},
minable = {mining_time = 1, result = "curved-rail"},
max_health = 200,
corpse = "curved-rail-remnants",
collision_box = {{-0.75, -0.55}, {0.75, 1.6}},
secondary_collision_box = {{-0.65, -2.43}, {0.65, 2.43}},
selection_box = {{-1.7, -0.8}, {1.7, 0.8}},
rail_category = "regular",
pictures = railpictures(),
},