Earthyburt Posted November 2, 2020 Share Posted November 2, 2020 Title is self explanatory, but the other info I would like to include is that I want to put this in the magic tab. Link to comment Share on other sites More sharing options...
Yakuzashi Posted November 2, 2020 Share Posted November 2, 2020 (edited) Inside modmain.lua goes local prefabname = Ingredient( "prefabname", 1 ) prefabname.atlas = "images/inventoryimages/prefabname.xml" local prefabname_recipe = AddRecipe("prefabname", {Ingredient("log", 1), Ingredient("rope", 1)}, RECIPETABS.MAGIC, TECH.NONE, nil, nil, nil, nil, "yourcharactername", "images/inventoryimages/prefabname.xml") Swap "prefabname" with the name of item. Rememer to post this: local require = GLOBAL.require local STRINGS = GLOBAL.STRINGS local Ingredient = GLOBAL.Ingredient local RECIPETABS = GLOBAL.RECIPETABS local TECH = GLOBAL.TECH above. Also add inst:AddTag("yourcharactername") inside of yourcharacter.lua (sripts->prefabs->...) inside common_postinit. Cheers! Edited November 2, 2020 by Yakuzashi 2 Link to comment Share on other sites More sharing options...
Earthyburt Posted November 2, 2020 Author Share Posted November 2, 2020 (edited) 12 hours ago, Yakuzashi said: Inside modmain.lua goes local prefabname = Ingredient( "prefabname", 1 ) prefabname.atlas = "images/inventoryimages/prefabname.xml" local prefabname_recipe = AddRecipe("prefabname", {Ingredient("log", 1), Ingredient("rope", 1)}, RECIPETABS.MAGIC, TECH.NONE, nil, nil, nil, nil, "yourcharactername", "images/inventoryimages/prefabname.xml") Swap "prefabname" with the name of item. Rememer to post this: local require = GLOBAL.require local STRINGS = GLOBAL.STRINGS local Ingredient = GLOBAL.Ingredient local RECIPETABS = GLOBAL.RECIPETABS local TECH = GLOBAL.TECH above. Also add inst:AddTag("yourcharactername") inside of yourcharacter.lua (sripts->prefabs->...) inside common_postinit. Cheers! It seems that the caused my game to crash. I did everything you said, but I may have done something wrong. I have included my modmain and character prefab folder to this comment. wayne.lua modmain.lua Edited November 2, 2020 by Earthyburt Link to comment Share on other sites More sharing options...
Earthyburt Posted November 3, 2020 Author Share Posted November 3, 2020 2 hours ago, Earthyburt said: It seems that the caused my game to crash. I did everything you said, but I may have done something wrong. I have included my modmain and character prefab folder to this comment. wayne.lua modmain.lua 3.01 kB · 0 downloads I had a look at the crash looks; here is where things went wrong; tried to add the xml file it asked for, but nothing worked [00:00:55]: MOD ERROR: Wayne_the_Experiment (Wayne the Experiment): Mod: Wayne_the_Experiment (Wayne the Experiment) [00:00:56]: Event data unavailable: lavaarena_event_server/lavaarena_achievement_quest_defs [00:00:56]: [string "scripts/util.lua"]:562: Could not find an asset matching images/inventoryimages/nightmarefuel.xml in any of the search paths. LUA ERROR stack traceback: =[C] in function 'assert' scripts/util.lua(562,1) in function 'resolvefilepath' scripts/recipe.lua(100,1) in function '_ctor' scripts/class.lua(181,1) in function 'Recipe' scripts/modutil.lua(476,1) in function 'AddRecipe' ../mods/Wayne_the_Experiment/modmain.lua(68,1) in main chunk =[C] in function 'xpcall' scripts/util.lua(723,1) in function 'RunInEnvironment' scripts/mods.lua(529,1) in function 'InitializeModMain' scripts/mods.lua(503,1) in function 'LoadMods' scripts/main.lua(318,1) in function 'ModSafeStartup' scripts/main.lua(394,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(26,1) in function 'SavePersistentString' scripts/modindex.lua(118,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(105,1) in function 'BeginStartupSequence' scripts/main.lua(393,1) in function 'callback' scripts/modindex.lua(659,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(633,1) in function 'Load' scripts/main.lua(392,1) in main chunk [00:00:56]: [string "scripts/mainfunctions.lua"]:1118: variable 'global_error_widget' is not declared LUA ERROR stack traceback: =[C] in function 'error' scripts/strict.lua(23,1) scripts/mainfunctions.lua(1118,1) =[C] in function 'GetPersistentString' scripts/quagmire_recipebook.lua(54,1) in function 'Load' scripts/main.lua(336,1) in function 'ModSafeStartup' scripts/main.lua(394,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(26,1) in function 'SavePersistentString' scripts/modindex.lua(118,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(105,1) in function 'BeginStartupSequence' scripts/main.lua(393,1) in function 'callback' scripts/modindex.lua(659,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(633,1) in function 'Load' scripts/main.lua(392,1) in main chunk [00:00:56]: Faild to load the cookbook! false [string "scripts/json.lua"]:450: Failed to load string [ return "filters"] in JSON4Lua.decode_scanString at position 2 : 11 [00:00:56]: DoLuaFile Error: (null) [00:00:56]: LuaError but no error string [00:00:56]: Error loading main.lua [00:00:56]: Failed mSimulation->Reset() [00:00:56]: Error during game restart! [00:00:57]: ModWorkshop::CancelDownloads clearing all unfinished downloads [00:00:57]: Collecting garbage... [00:00:57]: lua_gc took 0.05 seconds [00:00:57]: ~ShardLuaProxy() [00:00:57]: ~cEventLeaderboardProxy() [00:00:57]: ~ItemServerLuaProxy() [00:00:57]: ~InventoryLuaProxy() [00:00:57]: ~NetworkLuaProxy() [00:00:57]: ~SimLuaProxy() [00:00:57]: ModWorkshop::CancelDownloads clearing all unfinished downloads [00:00:57]: lua_close took 0.02 seconds [00:00:57]: ModWorkshop::CancelDownloads clearing all unfinished downloads [00:00:57]: [Steam] Auth ticket cancelled [00:00:58]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. [00:00:58]: CurlRequestManager::ClientThread::Main() complete [00:00:58]: HttpClient2 discarded 0 callbacks. [00:00:58]: Shutting down Link to comment Share on other sites More sharing options...
Thomas Die Posted November 3, 2020 Share Posted November 3, 2020 (edited) I think you need to add the image to assets or make a new image for the recipe I don't think modmain has or knows it has the image Edited November 3, 2020 by thomas4846 1 Link to comment Share on other sites More sharing options...
Thomas Die Posted November 3, 2020 Share Posted November 3, 2020 8 hours ago, Earthyburt said: [00:00:56]: [string "scripts/util.lua"]:562: Could not find an asset matching images/inventoryimages/nightmarefuel.xml in any of the search paths. 1 Link to comment Share on other sites More sharing options...
Yakuzashi Posted November 3, 2020 Share Posted November 3, 2020 (edited) You need to create folder called "inventoryimages" inside of "images" and you need to use 64x64x24 .png as a base. Then into inventoryimages goes: png + tex + xml. You might need to convert .png file into .tex with TexTools. Then inside modmain.lua ->Assets ={} Asset("ATLAS", "images/inventoryimages/prefabname.xml"), Asset("IMAGE", "images/inventoryimages/prefabname.tex"), prefabname.xml Edited November 3, 2020 by Yakuzashi 1 Link to comment Share on other sites More sharing options...
Thomas Die Posted November 3, 2020 Share Posted November 3, 2020 I think that it should covert when you compile everhthing, not sure tho But why a 64 64 24 base, is it the maximum it can be? 1 Link to comment Share on other sites More sharing options...
Yakuzashi Posted November 3, 2020 Share Posted November 3, 2020 Quote I think that it should covert when you compile everhthing, not sure tho Sometime it does and sometime not. I want to be sure everytime, so I do it myself. The 64x64x24 it's for item image on inventory bar. When I have tried to change dimensions, everything went bad. It was long time ago, and now I am not sure about necessity of this format. 1 Link to comment Share on other sites More sharing options...
Earthyburt Posted November 3, 2020 Author Share Posted November 3, 2020 (edited) I did put in the image atlas files, but I just found out the crash was from a typo error. However, now it just displays a campfire instead of nightmare fuel. I think this is an issue with the image size, 64 x 64, instead of 64 x 64 x 24, but I do not know how to set the image that way Edited November 3, 2020 by Earthyburt Link to comment Share on other sites More sharing options...
Yakuzashi Posted November 3, 2020 Share Posted November 3, 2020 Send me the file you want to convert and I will handle it Link to comment Share on other sites More sharing options...
Earthyburt Posted November 3, 2020 Author Share Posted November 3, 2020 1 minute ago, Yakuzashi said: Send me the file you want to convert and I will handle it Thanks for helping me, btw. I really appreciate it Link to comment Share on other sites More sharing options...
Yakuzashi Posted November 3, 2020 Share Posted November 3, 2020 (edited) nightmare.xmlnightmare.tex I have added my settings for Tex Tools if you are curious. Edited November 3, 2020 by Yakuzashi 1 Link to comment Share on other sites More sharing options...
Earthyburt Posted November 3, 2020 Author Share Posted November 3, 2020 Thank you very much! 21 minutes ago, Yakuzashi said: nightmare.xml 164 B · 0 downloads nightmare.tex 5.44 kB · 0 downloads I have added my settings for Tex Tools if you are curious. It still shows the campfire. I thought last post would be the end of it, but it still shows the campfire. 1 Link to comment Share on other sites More sharing options...
Yakuzashi Posted November 3, 2020 Share Posted November 3, 2020 Well, you can DM me your whole mod in .zip and I will fix that. Cheers! Link to comment Share on other sites More sharing options...
Earthyburt Posted November 3, 2020 Author Share Posted November 3, 2020 Wayne_the_Experiment.zip Link to comment Share on other sites More sharing options...
Yakuzashi Posted November 4, 2020 Share Posted November 4, 2020 (edited) I don't play DST thus I haven't know that nightmarefuel has one recipe already. Basically you don't need to add and show direction of inventory image inside of modmain.lua anymore. I just modified few lines inside modmain. I would also reccomend to delete nightmarefuel.png etc. from inventoryimages folder in order to avoid errors.modmain.lua Cheers! Edited November 4, 2020 by Yakuzashi 1 Link to comment Share on other sites More sharing options...
Earthyburt Posted November 17, 2020 Author Share Posted November 17, 2020 Thank You! Sorry for late reply, I had my stuff taken away. 1 Link to comment Share on other sites More sharing options...
CloverNoir Posted November 21, 2020 Share Posted November 21, 2020 What if I want my character to craft an item with the same effects as an existing one, but I want it to have a custom image and name?? Do I have to create a completely different item for this? Link to comment Share on other sites More sharing options...
Yakuzashi Posted November 21, 2020 Share Posted November 21, 2020 I don't exactly know what do you mean. Just rename it and set custom image. The itemname.lua contains unique abilities of item. Link to comment 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