Jump to content

Recommended Posts

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!

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 by Heavenfall

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