Hi! Im trying to add in mod VersepellesHardStorage a new item - iron crate (so i dont want own mod, just change a bit some stuff), and im realy new in mod writing.
So i copy all code for wooden crate and make iron crate. So you can easely find it (mod is realy little)
But in game a have 2 wooden crates, one from mod and one with my recipe, but they both are wooden crate. So i want wooden with 30 inv.size and iron with 40.
I dont know why my code wont work properly. pls help.
Problem with adding an item
- ShadowScaleFTL
- Inserter
- Posts: 25
- Joined: Mon Jan 23, 2017 3:30 pm
- Contact:
Problem with adding an item
- Attachments
-
- VersepellesHardStorage_2.0.0.rar
- (84.43 KiB) Downloaded 102 times
Re: Problem with adding an item
you also need textures/sprites for the iron crate
no yes yes no yes no yes yes
- ShadowScaleFTL
- Inserter
- Posts: 25
- Joined: Mon Jan 23, 2017 3:30 pm
- Contact:
Re: Problem with adding an item
i add them. Problem is not in sprites.kinnom wrote:you also need textures/sprites for the iron crate
Re: Problem with adding an item
In recipe.lua:
The result should be "iron-crate".
Code: Select all
{
type = "recipe",
name = "iron-crate",
enabled = "true",
ingredients =
{
{"iron-chest", 4},
{"iron-plate", 10},
},
result = "wooden-crate",
result_count = 1,
},
- ShadowScaleFTL
- Inserter
- Posts: 25
- Joined: Mon Jan 23, 2017 3:30 pm
- Contact:
Re: Problem with adding an item
daniel34 wrote:In recipe.lua:The result should be "iron-crate".Code: Select all
{ type = "recipe", name = "iron-crate", enabled = "true", ingredients = { {"iron-chest", 4}, {"iron-plate", 10}, }, result = "wooden-crate", result_count = 1, },
now it looks like my crate in recipes, but gives wooden crate after craft...
Re: Problem with adding an item
Are you sure? It works for me on a newly started map*. Maybe there's some other mod changing it somehow?ShadowScaleFTL wrote:now it looks like my crate in recipes, but gives wooden crate after craft...
* after removing the "science-pack-4" from technologies.lua. If the mod uses items from another mod you should include that mod in the dependencies.
- ShadowScaleFTL
- Inserter
- Posts: 25
- Joined: Mon Jan 23, 2017 3:30 pm
- Contact:
Re: Problem with adding an item
thx a lot! It works fine in new game. It was a bug in savegame.daniel34 wrote:Are you sure? It works for me on a newly started map*. Maybe there's some other mod changing it somehow?ShadowScaleFTL wrote:now it looks like my crate in recipes, but gives wooden crate after craft...
* after removing the "science-pack-4" from technologies.lua. If the mod uses items from another mod you should include that mod in the dependencies.
Re: Problem with adding an item
I see now what the issue was. When changing recipes in a mod that already exists in a savegame you then have to call LuaForce.reset_recipes to load the changes (or change the version number of the mod, that would call reset_recipes automatically).ShadowScaleFTL wrote:thx a lot! It works fine in new game. It was a bug in savegame.