Purpulear Posted July 31, 2019 Share Posted July 31, 2019 Hello I am currently working on a character mod for DST. And I've added a bow and arrow to the game. But, i'd like to make it so only my character can craft them, but be able to share them. Like Wigfrig and her helmets. My current recipes and code for them are: local bow = AddRecipe("bow",{ Ingredient("log", 10), Ingredient("rope", 2)}, GLOBAL.RECIPETABS.WAR, GLOBAL.TECH.NONE, nil, nil, nil, 1, nil, ATLAS_BOW) local arrow = AddRecipe("arrow", { Ingredient("rocks", 1 ), Ingredient("twigs", 1) }, GLOBAL.RECIPETABS.WAR, GLOBAL.TECH.NONE, nil, nil, nil, 3, nil, ATLAS_ARROW) Link to comment Share on other sites More sharing options...
Thomas Die Posted July 31, 2019 Share Posted July 31, 2019 (edited) can you tell us the problem what does it come up with when their is a error is it that you want it to be a character specific item,i'll give you an e.g but if you don't understand please ask me i'll try to help with the best of my ability AddRecipe("item name", { Ingredient("type of ingredient 1", amount), Ingredient("type of ingredient 2", amount), }, RECIPETABS.MAGIC, TECH.NONE, nil, nil, nil, nil, 'the tag you select for your character', "images/inventoryimages/image name.xml") (the tag select for your character basically makes it so that only your character can craft it) (this is the basic crafting recipe that i put on my post anyway, i would put this in a coded version but with this you can see the highlighted areas ) Edited July 31, 2019 by thomas4845 Link to comment Share on other sites More sharing options...
Purpulear Posted July 31, 2019 Author Share Posted July 31, 2019 40 minutes ago, thomas4845 said: can you tell us the problem what does it come up with when their is a error is it that you want it to be a character specific item,i'll give you an e.g but if you don't understand please ask me i'll try to help with the best of my ability AddRecipe("item name", { Ingredient("type of ingredient 1", amount), Ingredient("type of ingredient 2", amount), }, RECIPETABS.MAGIC, TECH.NONE, nil, nil, nil, nil, 'the tag you select for your character', "images/inventoryimages/image name.xml") (the tag select for your character basically makes it so that only your character can craft it) (this is the basic crafting recipe that i put on my post anyway, i would put this in a coded version but with this you can see the highlighted areas ) No errors or anything. The item is currently craftable id just like it to be exclusively craftable. But I think I got it. Just, how do I set up the tag for my character? Link to comment Share on other sites More sharing options...
Ultroman Posted July 31, 2019 Share Posted July 31, 2019 In your character's prefab Lua file, go to the common_postinit function and add this line inst:AddTag("whatever_tag_you_want") Link to comment Share on other sites More sharing options...
Purpulear Posted July 31, 2019 Author Share Posted July 31, 2019 Hmm. Im getting errors now. And it just crashes the game and closes it" Heres my log client_log.txt Link to comment Share on other sites More sharing options...
Ultroman Posted July 31, 2019 Share Posted July 31, 2019 The error says you're using TECH which is a global variable. Either do GLOBAL.TECH or add the following to the top of your modmain.lua local TECH = GLOBAL.TECH Link to comment Share on other sites More sharing options...
Purpulear Posted July 31, 2019 Author Share Posted July 31, 2019 Ah, all is well now. Thank you both for all the help! Really appreciate it! Link to comment Share on other sites More sharing options...
Thomas Die Posted August 1, 2019 Share Posted August 1, 2019 <3 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