Vecto0r Posted April 23, 2016 Share Posted April 23, 2016 (edited) i was tryng to make a recipe for my custom character in "modmain.lua" that cost healt it looks like this: Recipe("synch", { Ingredient("twigs", 2), Ingredient("flint", 2), Ingredient(CHARACTER_INGREDIENT.HEALTH, 10)}, RECIPETABS.WAR, TECH.NONE, nil, nil, nil, nil, "images/inventoryimages/synch.xml", "synch.tex") but everytime i start the game it crashes someone can help me plz? Edited April 23, 2016 by Vecto0r Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/ Share on other sites More sharing options...
Muche Posted April 23, 2016 Share Posted April 23, 2016 (edited) Did the log say anything helpful? Assuming all needed GLOBAL references are made local, try AddRecipe("synch", { Ingredient("twigs", 2), Ingredient("flint", 2), Ingredient(CHARACTER_INGREDIENT.HEALTH, 10)}, RECIPETABS.WAR, TECH.NONE, nil, nil, nil, nil, nil, "images/inventoryimages/synch.xml", "synch.tex") (one extra nil parameter for builder_tag. Edited April 23, 2016 by Muche Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-754929 Share on other sites More sharing options...
Vecto0r Posted April 23, 2016 Author Share Posted April 23, 2016 4 hours ago, Muche said: Did the log say anything helpful? Assuming all needed GLOBAL references are made local, try AddRecipe("synch", { Ingredient("twigs", 2), Ingredient("flint", 2), Ingredient(CHARACTER_INGREDIENT.HEALTH, 10)}, RECIPETABS.WAR, TECH.NONE, nil, nil, nil, nil, nil, "images/inventoryimages/synch.xml", "synch.tex") (one extra nil parameter for builder_tag. my GLOBAL references is local require = GLOBAL.require local STRINGS = GLOBAL.STRINGS GLOBAL.STRINGS.CHARACTER_TITLES.victor_dracul = "The Vampire" GLOBAL.STRINGS.CHARACTER_NAMES.victor_dracul = "Victor Dracul" GLOBAL.STRINGS.CHARACTER_DESCRIPTIONS.victor_dracul = "* An Evil Vampire, Which Love Fruits." GLOBAL.STRINGS.CHARACTER_QUOTES.victor_dracul = "\"The Master of Vampires.\"" GLOBAL.STRINGS.CHARACTERS.VICTOR_DRACUL = {} GLOBAL.STRINGS.CHARACTERS.VICTOR_DRACUL.DESCRIBE = {} ------------------------------------ -------------ITEMS------------------ local Ingredient = GLOBAL.Ingredient local RECIPETABS = GLOBAL.RECIPETABS local STRINGS = GLOBAL.STRINGS local TECH = GLOBAL.TECH i get same error look Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755057 Share on other sites More sharing options...
Vecto0r Posted April 23, 2016 Author Share Posted April 23, 2016 i think i need to reference the GLOBAL for `` CHARACTER_INGREDIENT`` but i dont know how Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755061 Share on other sites More sharing options...
Aquaterion Posted April 23, 2016 Share Posted April 23, 2016 2 minutes ago, Vecto0r said: i think i need to reference the GLOBAL for `` CHARACTER_INGREDIENT`` but i dont know how ye local character_ingredient = GLOBAL.CHARACTER_INGREDIENT btw this is dst not ds area Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755065 Share on other sites More sharing options...
Vecto0r Posted April 23, 2016 Author Share Posted April 23, 2016 54 minutes ago, Aquaterion said: ye local character_ingredient = GLOBAL.CHARACTER_INGREDIENT btw this is dst not ds area CHARACTER_INGREDIENT only works in DST ? Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755096 Share on other sites More sharing options...
Aquaterion Posted April 23, 2016 Share Posted April 23, 2016 Just now, Vecto0r said: CHARACTER_INGREDIENT only works in DST ? I didnt say that, it should work for ds as well. Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755099 Share on other sites More sharing options...
Vecto0r Posted April 23, 2016 Author Share Posted April 23, 2016 6 minutes ago, Aquaterion said: I didnt say that, it should work for ds as well. local Ingredient = GLOBAL.Ingredient local RECIPETABS = GLOBAL.RECIPETABS local STRINGS = GLOBAL.STRINGS local TECH = GLOBAL.TECH local character_ingredient = GLOBAL.CHARACTER_INGREDIENT STRINGS.NAMES.SYNCH = "Synch" STRINGS.CHARACTERS.GENERIC.DESCRIBE.SYNCH = "He Loves Blood Taste." STRINGS.RECIPE_DESC.SYNCH = "The Thirst Blade." --Recipe("synch", { Ingredient("twigs", 2), Ingredient("flint", 2)}, RECIPETABS.WAR, TECH.NONE, nil, nil, nil, nil, "images/inventoryimages/synch.xml", "synch.tex") Recipe("synch", { Ingredient("twigs", 2), Ingredient("flint", 2), Ingredient(character_ingredient.HEALTH, 10)}, RECIPETABS.WAR, TECH.NONE, nil, nil, nil, nil, nil, "images/inventoryimages/synch.xml", "synch.tex") ------------------------------------ my code is like this now but dont worked, i get same error Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755112 Share on other sites More sharing options...
Aquaterion Posted April 23, 2016 Share Posted April 23, 2016 1 minute ago, Vecto0r said: local Ingredient = GLOBAL.Ingredient local RECIPETABS = GLOBAL.RECIPETABS local STRINGS = GLOBAL.STRINGS local TECH = GLOBAL.TECH local character_ingredient = GLOBAL.CHARACTER_INGREDIENT STRINGS.NAMES.SYNCH = "Synch" STRINGS.CHARACTERS.GENERIC.DESCRIBE.SYNCH = "He Loves Blood Taste." STRINGS.RECIPE_DESC.SYNCH = "The Thirst Blade." --Recipe("synch", { Ingredient("twigs", 2), Ingredient("flint", 2)}, RECIPETABS.WAR, TECH.NONE, nil, nil, nil, nil, "images/inventoryimages/synch.xml", "synch.tex") Recipe("synch", { Ingredient("twigs", 2), Ingredient("flint", 2), Ingredient(character_ingredient.HEALTH, 10)}, RECIPETABS.WAR, TECH.NONE, nil, nil, nil, nil, nil, "images/inventoryimages/synch.xml", "synch.tex") ------------------------------------ my code is like this now but dont worked, i get same error Hmm I don't think dont starve singleplayer has any stat ingredients. Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755118 Share on other sites More sharing options...
Vecto0r Posted April 23, 2016 Author Share Posted April 23, 2016 13 minutes ago, Aquaterion said: Hmm I don't think dont starve singleplayer has any stat ingredients. OK i will change my ingredients , btw thanks. if you can help in one more thing in my recipes tab the item ingredient dont show correct. looks like a bee mine why??? Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755142 Share on other sites More sharing options...
Aquaterion Posted April 23, 2016 Share Posted April 23, 2016 in ur items prefab file, such as synch.lua for example, find something like AddComponent("Inventoryitem") and below it put inst.components.inventoryitem.atlasname = "images/inventoryimages/synch.xml" inst.components.inventoryitem.imagename = "synch" Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755145 Share on other sites More sharing options...
Vecto0r Posted April 24, 2016 Author Share Posted April 24, 2016 52 minutes ago, Aquaterion said: in ur items prefab file, such as synch.lua for example, find something like AddComponent("Inventoryitem") and below it put inst.components.inventoryitem.atlasname = "images/inventoryimages/synch.xml" inst.components.inventoryitem.imagename = "synch" my prefab file have this, but only display the correct image on inventory. in the recipe tab is showing bee mine icon XML problem maybe ? Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755186 Share on other sites More sharing options...
Muche Posted April 24, 2016 Share Posted April 24, 2016 Try local synchRecipe = Recipe("synch", { Ingredient("twigs", 2), Ingredient("flint", 2)}, RECIPETABS.WAR, TECH.NONE, nil, nil, nil, nil) synchRecipe.atlas = "images/inventoryimages/synch.xml" synchRecipe.image = "synch.tex" Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755654 Share on other sites More sharing options...
Vecto0r Posted April 24, 2016 Author Share Posted April 24, 2016 1 hour ago, Muche said: Try local synchRecipe = Recipe("synch", { Ingredient("twigs", 2), Ingredient("flint", 2)}, RECIPETABS.WAR, TECH.NONE, nil, nil, nil, nil) synchRecipe.atlas = "images/inventoryimages/synch.xml" synchRecipe.image = "synch.tex" ty Muche works like a charm *-* Link to comment https://forums.kleientertainment.com/forums/topic/66601-help-with-modding-recipes-with-healt-sanity-cost/#findComment-755714 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now