Problem with adding an item

Place to get help with not working mods / modding interface.
User avatar
ShadowScaleFTL
Inserter
Inserter
Posts: 25
Joined: Mon Jan 23, 2017 3:30 pm
Contact:

Problem with adding an item

Post by ShadowScaleFTL »

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.
Attachments
VersepellesHardStorage_2.0.0.rar
(84.43 KiB) Downloaded 102 times
kinnom
Filter Inserter
Filter Inserter
Posts: 706
Joined: Fri Dec 26, 2014 4:20 pm
Contact:

Re: Problem with adding an item

Post by kinnom »

you also need textures/sprites for the iron crate
no yes yes no yes no yes yes
User avatar
ShadowScaleFTL
Inserter
Inserter
Posts: 25
Joined: Mon Jan 23, 2017 3:30 pm
Contact:

Re: Problem with adding an item

Post by ShadowScaleFTL »

kinnom wrote:you also need textures/sprites for the iron crate
i add them. Problem is not in sprites.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Problem with adding an item

Post by daniel34 »

In recipe.lua:

Code: Select all

  {
   type = "recipe",
   name = "iron-crate",
   enabled = "true",
   ingredients = 
    {
		{"iron-chest", 4},
		{"iron-plate", 10},
	},
	result = "wooden-crate",
	result_count = 1,
  },
The result should be "iron-crate".
quick links: log file | graphical issues | wiki
User avatar
ShadowScaleFTL
Inserter
Inserter
Posts: 25
Joined: Mon Jan 23, 2017 3:30 pm
Contact:

Re: Problem with adding an item

Post by ShadowScaleFTL »

daniel34 wrote:In recipe.lua:

Code: Select all

  {
   type = "recipe",
   name = "iron-crate",
   enabled = "true",
   ingredients = 
    {
		{"iron-chest", 4},
		{"iron-plate", 10},
	},
	result = "wooden-crate",
	result_count = 1,
  },
The result should be "iron-crate".

now it looks like my crate in recipes, but gives wooden crate after craft...
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Problem with adding an item

Post by daniel34 »

ShadowScaleFTL wrote:now it looks like my crate in recipes, but gives wooden crate after craft...
Are you sure? It works for me on a newly started map*. Maybe there's some other mod changing it somehow?

* 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.
quick links: log file | graphical issues | wiki
User avatar
ShadowScaleFTL
Inserter
Inserter
Posts: 25
Joined: Mon Jan 23, 2017 3:30 pm
Contact:

Re: Problem with adding an item

Post by ShadowScaleFTL »

daniel34 wrote:
ShadowScaleFTL wrote:now it looks like my crate in recipes, but gives wooden crate after craft...
Are you sure? It works for me on a newly started map*. Maybe there's some other mod changing it somehow?

* 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.
thx a lot! It works fine in new game. It was a bug in savegame.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Problem with adding an item

Post by daniel34 »

ShadowScaleFTL wrote:thx a lot! It works fine in new game. It was a bug in savegame.
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).
quick links: log file | graphical issues | wiki
Post Reply

Return to “Modding help”