Jump to content

Recommended Posts

so my problem is this, i have an item, that is required for most of the other items you can make. i can make this item just fine, however, when i go to make the other items, the original item i made does not have a picture in the crafting box for the other items, and it does not detect i have the original item in my inventory. so i am missing something in my modmain, but i do not know what.

 

also, the items in question are health related, but i am not sure how to tell the game the exact amount of health each item needs to give.

 

some help would be greatly appreciated.

Not quite sure i fully understand your first issue (and i am also new to modding so i might be wrong) but defining the crafting item is done like this: 

 

local furnace = GLOBAL.Recipe("furnace",{Ingredient("rocks", 16),},RECIPETABS.TOWN, TECH.SCIENCE_ZERO, "furnace_placer" ) -- This is used for the iventory iconfurnace.atlas = "images/inventoryimages/furnace.xml"
 
I just have an image in the images/inventory furnace with the same name as the item i added. 
 
About the healing bit, looking at the healingsalve file, it seems like you need this: 
 
inst:AddComponent("healer")inst.components.healer:SetHealthAmount(TUNING.HEALING_MED)

Instead of using TUNING.HEALING_MED you can just use any numeric number. 

 

Hope that helps a bit!

 

 

Not quite sure i fully understand your first issue (and i am also new to modding so i might be wrong) but defining the crafting item is done like this: 

 

local furnace = GLOBAL.Recipe("furnace",{Ingredient("rocks", 16),},RECIPETABS.TOWN, TECH.SCIENCE_ZERO, "furnace_placer" ) -- This is used for the iventory iconfurnace.atlas = "images/inventoryimages/furnace.xml"
 
I just have an image in the images/inventory furnace with the same name as the item i added. 
 
About the healing bit, looking at the healingsalve file, it seems like you need this: 
 
inst:AddComponent("healer")inst.components.healer:SetHealthAmount(TUNING.HEALING_MED)

Instead of using TUNING.HEALING_MED you can just use any numeric number. 

 

Hope that helps a bit!

 

so instead of inst:AddComponent("healer")inst.components.healer:SetHealthAmount(TUNING.HEALING_MED)

its

inst:AddComponent("healer")inst.components.healer:SetHealthAmount(TUNING.HEALING_14)

for a specific number?

 

 

also i have the proper script for crafting the item, it calls for butterfly wings just fine, the problem is in the other item i made in the mod, if it makes more seance i will add names

 

i craft crushed pestles, i can craft this just fine with no problems, i now have crushed pestles in my inventory, however when i try to craft an item that required crushed pestles, the image in the crafting box that is meant for crushed pestles is missing, and it doesn't detect i even have the item in my inventory. so its not a problem with the recipe itself, its a problem of me missing something in the modmain, that stops crushed pestles from being called for, or making what i have in my inventory something different from what is needed for the recipe.

Edited by AnimeOfTheArts

It would be like this: 

inst:AddComponent("healer")inst.components.healer:SetHealthAmount(14)

The "TUNING.HEALING_MED" is just a reference to a number.

 

About the image thing, i'm not quite sure why it wouldn't show up (again, i'm new to modding too heh) but i think you need to take care of 2 things for this to work.

 

1) Have the inventory image file loaded in the modmain.lua like this:

Assets = {	Asset("ATLAS", "images/inventoryimages/crushedpestels.xml"),	Asset("ATLAS", "images/inventoryimages/otheritem.xml"),}

That makes sure the files are loaded when you call the 

otheritem.atlas = "images/inventoryimages/otheritem.xml"

stuff later after defining the recipe. 

 

 

The other thing is make sure that the names are exactly the same everywhere. When you enter your recipe like this:

local otheritem = GLOBAL.Recipe("otheritem",{	Ingredient("crushedpestles", 1),}

make sure that the "crushedpestles" name is the same as your prefab name (crushedpestles.lua or whatever). They have to match exactly, problably even if it's upper/lowercase or not.

 

Let me know if any of this helped xD

 

-SC

Edited by SeriousCreeper

i have both the asset and .atlas for the items, and everything is spelled correctly, do i need to call the .atlas for both the item itself and the required item after every recipe? because right now my recipe looks like this 

 

local SmallPoultice = GLOBAL.Recipe("SmallPoultice",{Ingredient("CrushedPetals",3) },GLOBAL.RECIPETABS.FARM, GLOBAL.TECH.SCIENCE_ONE) SmallPoultice.atlas = ("images/inventoryimages/SmallPoultice.xml")

 

i think i figured out the problem, the prefab files had one instance where it was lower case, however the problem is that when changing it to upper case, the mod just broke. so i needed to change everything to fit what was in the prefab file, that includes remaking the animation and tex files, however while i can now craft all the items the description and the image in the recipe is now missing for all of the recepies.

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...