Jump to content

Recommended Posts

I'm trying my hand at modding for the first time, because I want to create a new structure (composter: 9 slot container that increases the spoilage rate of items inside; basically a reverse ice box).  To keep it simple, I'm using the icebox prefab as a template and (for now at least) am just going to use the ice box model, animations, sounds, minimap icon, etc.  My plan is to just insert

 

elseif owner:HasTag("compost") then
modifier = TUNING.PERISH_COMPOST_MULT 
 
into the components/perishable.lua "if" loop, change the "fridge" flag in composter.lua (copied from icebox.lua) to "compost", add the spoilage constant  TUNING.PERISH_COMPOST_MULT , change the recipe in recipies.lua (i've done all of this), and figure out what else I need to change in composter.lua and elsewhere to get it to work (this is where i'm stuck).
 
So far I've got it so that my item shows up in the right crafting tab and with the right recipe, but with no lable and a honey poultice icon(for some reason).  I can prototype it, I get the ice box model placement sprite, and when placed, it activates the character placement animation, but it doesn't place anything, I get the "you can't put that there" message, and the placement sprite stays around with the options to place or cancel (cancel works, but place does nothing after the first fail; canceling and replacing are similarly ineffective).
 
I've come across tons of tutorials and examples here and elsewhere on inventory items, wearable items, and character creation, but can't find anything on structures.  Can anyone help me out here?

 

I'm trying my hand at modding for the first time, because I want to create a new structure (composter: 9 slot container that increases the spoilage rate of items inside; basically a reverse ice box).  To keep it simple, I'm using the icebox prefab as a template and (for now at least) am just going to use the ice box model, animations, sounds, minimap icon, etc.  My plan is to just insert

 

elseif owner:HasTag("compost") then
modifier = TUNING.PERISH_COMPOST_MULT 
 
into the components/perishable.lua "if" loop, change the "fridge" flag in composter.lua (copied from icebox.lua) to "compost", add the spoilage constant  TUNING.PERISH_COMPOST_MULT , change the recipe in recipies.lua (i've done all of this), and figure out what else I need to change in composter.lua and elsewhere to get it to work (this is where i'm stuck).
 
So far I've got it so that my item shows up in the right crafting tab and with the right recipe, but with no lable and a honey poultice icon(for some reason).  I can prototype it, I get the ice box model placement sprite, and when placed, it activates the character placement animation, but it doesn't place anything, I get the "you can't put that there" message, and the placement sprite stays around with the options to place or cancel (cancel works, but place does nothing after the first fail; canceling and replacing are similarly ineffective).
 
I've come across tons of tutorials and examples here and elsewhere on inventory items, wearable items, and character creation, but can't find anything on structures.  Can anyone help me out here?

 

 

Posting your code as well as the most recent log that has an error would make it much easier to help you.

 

I'm assuming you're the author of that experiment mod on Steam?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...