nailertn Posted August 19, 2013 Share Posted August 19, 2013 I have a custom craftable chest and for the life of me I can't get its own icon to show up on the crafting tab. In modmain.lua I do: AddSimPostInit(function() GLOBAL.Recipe("strongbox", {GLOBAL.Ingredient("boards", 5), GLOBAL.Ingredient('rope', 2), GLOBAL.Ingredient('goldnugget', 1)}, GLOBAL.RECIPETABS.TOWN, GLOBAL.TECH.SCIENCE_TWO, "treasurechest_placer",1) GLOBAL.Recipes.strongbox.sortkey = GLOBAL.Recipes.treasurechest.sortkey + 0.1 GLOBAL.Recipes.strongbox.atlas = GLOBAL.resolvefilepath('my_assets/strongbox_icon.xml') GLOBAL.Recipes.strongbox.image = 'strongbox.tex'end) I add Asset('ATLAS', 'my_assets/strongbox_icon.xml') to both modmain.lua and strongbox.lua that is in my_mod/scripts/prefabs for good measure but it doesn't work. The game can find the file because it wouldn't even load with a random filename, and the atlas + tex file is also working because it shows up just fine on the crafting tab if I overwrite the original inventoryimages.tex and inventoryimages.xml. Can anybody please clue me in on how this should be done? Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/26417-help-custom-icons-on-crafting-tab/ Share on other sites More sharing options...
Heavenfall Posted August 19, 2013 Share Posted August 19, 2013 (edited) This is an example of a functional recipe. You don't need to place your recipes in a AddSimPostInit, you should place them straight up in the modmain.lua.local temprecipe0 = Recipe( "summonskeleton", { Ingredient("nightmarefuel", 2), Ingredient("papyrus", 1) }, RECIPETABS.SUMMONS, {SKELETON = 1}) temprecipe0.atlas = "images/inventoryimages/summonskeleton.xml"note that for your atlas you may have to place it in yourmod/inventoryimages/xxx.xml as the game will look there by default if I remember correctly. Edited August 19, 2013 by Heavenfall Link to comment https://forums.kleientertainment.com/forums/topic/26417-help-custom-icons-on-crafting-tab/#findComment-295059 Share on other sites More sharing options...
nailertn Posted August 19, 2013 Author Share Posted August 19, 2013 It worked, thank you. Though I'm not sure why. Isn't it the purpose of Asset() to tell the game where assets are located and when to load them into memory? What's the point if paths are hard coded? Link to comment https://forums.kleientertainment.com/forums/topic/26417-help-custom-icons-on-crafting-tab/#findComment-295101 Share on other sites More sharing options...
Heavenfall Posted August 19, 2013 Share Posted August 19, 2013 I don't know. Link to comment https://forums.kleientertainment.com/forums/topic/26417-help-custom-icons-on-crafting-tab/#findComment-295109 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