AkaiNight Posted February 24, 2020 Share Posted February 24, 2020 I was planning to add a were form to my character and i look for some tutorials about it and i found few. But i have question about were form can we add a were form depends on tags? like if the player has tag "randomtag" then it changes its build and abilities? Link to comment Share on other sites More sharing options...
CarlZalph Posted February 25, 2020 Share Posted February 25, 2020 You could populate the tag section and use it as a hacked netvar, but I'd recommend using netvars straight for that since the tags for entities are quite limited. See how Woodie's prefab handles it with the 'weremode' netvar: inst.weremode = net_tinybyte(inst.GUID, "woodie.weremode", "weremodedirty") 1 Link to comment Share on other sites More sharing options...
AkaiNight Posted February 26, 2020 Author Share Posted February 26, 2020 19 hours ago, CarlZalph said: You could populate the tag section and use it as a hacked netvar, but I'd recommend using netvars straight for that since the tags for entities are quite limited. See how Woodie's prefab handles it with the 'weremode' netvar: inst.weremode = net_tinybyte(inst.GUID, "woodie.weremode", "weremodedirty") I just noticed that i don't need tags lel :/ something like this should work i suppoise local function FirstForm(inst) inst.AnimState:SetBuild("normal") isInSecondForm = false isInThirdForm = false isInFourthForm = false end local function SecondForm(inst) inst.AnimState:SetBuild("secondform") isInSecondForm = true isInThirdForm = false isInFourthForm = false end local function ThirdForm(inst) inst.AnimState:SetBuild("thirdform") isInSecondForm = false isInThirdForm = true isInFourthForm = false end local function FourthForm(inst) inst.AnimState:SetBuild("fourthform") isInSecondForm = false isInThirdForm = false isInFourthForm = true end and this one is in level system if inst.level <=9 then FirstForm(inst) elseif inst.level >= 10 and inst.level <= 19 and not isInThirdForm then SecondForm(inst) elseif inst.level >= 20 and inst.level <= 29 and not isInSecondForm then ThirdForm(inst) elseif inst.level >= 30 and not isInFourthForm then FourthForm(inst) end Link to comment Share on other sites More sharing options...
AkaiNight Posted February 26, 2020 Author Share Posted February 26, 2020 Ok im trying to make a craftable item that needs 10 healt for craft (like Telltale Heart) and im using Ingredient(CHARACTER_INGREDIENT.HEALTH, 20) (i took it in reviver.lua) but when i use that i have that error Quote [00:00:32]: [string "../mods/Kitsura/modmain.lua"]:94: attempt to index global 'CHARACTER_INGREDIENT' (a nil value) LUA ERROR stack traceback: ../mods/Kitsura/modmain.lua(94,1) in main chunk =[C] in function 'xpcall' scripts/util.lua(723,1) in function 'RunInEnvironment' scripts/mods.lua(516,1) in function 'InitializeModMain' scripts/mods.lua(490,1) in function 'LoadMods' scripts/main.lua(309,1) in function 'ModSafeStartup' scripts/main.lua(383,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(26,1) in function 'SavePersistentString' scripts/modindex.lua(80,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(67,1) in function 'BeginStartupSequence' scripts/main.lua(382,1) in function 'callback' scripts/modindex.lua(550,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(524,1) in function 'Load' scripts/main.lua(381,1) in main chunk Link to comment Share on other sites More sharing options...
CarlZalph Posted February 26, 2020 Share Posted February 26, 2020 1 hour ago, AkaiNight said: Ok im trying to make a craftable item that needs 10 healt for craft (like Telltale Heart) and im using Ingredient(CHARACTER_INGREDIENT.HEALTH, 20) (i took it in reviver.lua) but when i use that i have that error Probably is missing the "GLOBAL." prefix to denote that you're getting CHARACTER_INGREDIENT from the global table rather than the modmain's scope. Link to comment Share on other sites More sharing options...
AkaiNight Posted February 26, 2020 Author Share Posted February 26, 2020 nope same error Link to comment Share on other sites More sharing options...
Yakuzashi Posted February 26, 2020 Share Posted February 26, 2020 (edited) @AkaiNight Could you upload your mod in .zip? I will take a closer look and try to help you. EDIT: Quote Ok im trying to make a craftable item that needs 10 healt for craft (like Telltale Heart) and im using Ingredient(CHARACTER_INGREDIENT.HEALTH, 20) (i took it in reviver.lua) but when i use that i have that error Do you have something like this inside modmain? Quote local Ingredient = GLOBAL.Ingredient Edited February 26, 2020 by Yakuzashi EDIT:... Link to comment Share on other sites More sharing options...
AkaiNight Posted February 26, 2020 Author Share Posted February 26, 2020 (edited) 7 minutes ago, Yakuzashi said: @AkaiNight Could you upload your mod in .zip? I will take a closer look and try to help you. here is the mod and do you know any tutorial about how to change your characters look i mean im using template mod as base and i want to change it looks Kitsura.rar Do you have something like this inside modmain? local Ingredient = GLOBAL.Ingredient yes i have Edited February 26, 2020 by AkaiNight Link to comment Share on other sites More sharing options...
Yakuzashi Posted February 26, 2020 Share Posted February 26, 2020 (edited) Ad. Health I have added health as the ingredient into Sealed Eye and it worked fine. CarlZalph was right. Quote {Ingredient("bluegem", 3), Ingredient("deerclops_eyeball", 1), Ingredient("ice", 5), Ingredient(GLOBAL.CHARACTER_INGREDIENT.HEALTH, 20)}, Ad. Appearance Quote here is the mod and do you know any tutorial about how to change your characters look i mean im using template mod as base and i want to change it looks Mod->exported->kitsura Then you change .png files inside subfolders. Edited February 26, 2020 by Yakuzashi 1 1 Link to comment Share on other sites More sharing options...
AkaiNight Posted February 26, 2020 Author Share Posted February 26, 2020 Just now, Yakuzashi said: I have added health as the ingredient into Sealed Eye and it worked fine. CarlZalph was right. thanks a lot! 1 Link to comment Share on other sites More sharing options...
Yakuzashi Posted February 27, 2020 Share Posted February 27, 2020 (edited) Ok. It's ready but I have encountered problem so I had to turn off few lines of code. Kitsura.lua -> about 1280->1307 I added code and action listener in master_postinit. Few folders into exported you can change it to look like whatever you want, I just needed indicators so I have placed numers 2-4 on character's head. Moreover I touched assets: Quote local assets = { Asset("SCRIPT", "scripts/prefabs/player_common.lua"), Asset( "ANIM", "anim/secondform.zip" ), Asset( "ANIM", "anim/thirdform.zip" ), Asset( "ANIM", "anim/fourthform.zip" ), } Summarizing I had modified kitsura.lua and exported folder. I think that's all I have changed. You can compare your old files and this edited one. Cheers! Kitsura.rar Edited February 27, 2020 by Yakuzashi nuffin 1 Link to comment Share on other sites More sharing options...
Sinicero Posted April 20, 2020 Share Posted April 20, 2020 (edited) I did all of those thing, and somehow the error is on the game file, not my mod. The item work find alone, only when i try to add it in the character mod and have health and/or sanity as ingredient the bug appear. client_log.txtstring "scripts/recipe.lua"]:79: attempt to index local 'v' (a number value) LUA ERROR stack traceback: scripts/recipe.lua(79,1) in function '_ctor' scripts/class.lua(181,1) in function 'Recipe' scripts/modutil.lua(476,1) in function 'AddRecipe' ../mods/Windy the DD v 1.5/modmain.lua(64,1) in main chunk =[C] in function 'xpcall' scripts/util.lua(723,1) in function 'RunInEnvironment' scripts/mods.lua(516,1) in function 'InitializeModMain' scripts/mods.lua(490,1) in function 'LoadMods' scripts/main.lua(309,1) in function 'ModSafeStartup' scripts/main.lua(383,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(26,1) in function 'SavePersistentString' scripts/modindex.lua(80,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(67,1) in function 'BeginStartupSequence' scripts/main.lua(382,1) in function 'callback' scripts/modindex.lua(550,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(524,1) in function 'Load' scripts/main.lua(381,1) in main chunk [00:00:15]: [string "scripts/mainfunctions.lua"]:1105: variable 'global_error_widget' is not declared LUA ERROR stack traceback: =[C] in function 'error' scripts/strict.lua(23,1) scripts/mainfunctions.lua(1105,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(26,1) in function 'SavePersistentString' scripts/modindex.lua(80,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(67,1) in function 'BeginStartupSequence' scripts/main.lua(382,1) in function 'callback' scripts/modindex.lua(550,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(524,1) in function 'Load' scripts/main.lua(381,1) in main chunk modmain.lua Update: I remove the Health and Sanity ingredient, same error so i now have no idea what is going on Edited April 20, 2020 by Sinicero Update. Link to comment Share on other sites More sharing options...
AkaiNight Posted May 21, 2020 Author Share Posted May 21, 2020 On 4/20/2020 at 4:21 PM, Sinicero said: I did all of those thing, and somehow the error is on the game file, not my mod. The item work find alone, only when i try to add it in the character mod and have health and/or sanity as ingredient the bug appear. client_log.txtstring "scripts/recipe.lua"]:79: attempt to index local 'v' (a number value) LUA ERROR stack traceback: scripts/recipe.lua(79,1) in function '_ctor' scripts/class.lua(181,1) in function 'Recipe' scripts/modutil.lua(476,1) in function 'AddRecipe' ../mods/Windy the DD v 1.5/modmain.lua(64,1) in main chunk =[C] in function 'xpcall' scripts/util.lua(723,1) in function 'RunInEnvironment' scripts/mods.lua(516,1) in function 'InitializeModMain' scripts/mods.lua(490,1) in function 'LoadMods' scripts/main.lua(309,1) in function 'ModSafeStartup' scripts/main.lua(383,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(26,1) in function 'SavePersistentString' scripts/modindex.lua(80,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(67,1) in function 'BeginStartupSequence' scripts/main.lua(382,1) in function 'callback' scripts/modindex.lua(550,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(524,1) in function 'Load' scripts/main.lua(381,1) in main chunk [00:00:15]: [string "scripts/mainfunctions.lua"]:1105: variable 'global_error_widget' is not declared LUA ERROR stack traceback: =[C] in function 'error' scripts/strict.lua(23,1) scripts/mainfunctions.lua(1105,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(26,1) in function 'SavePersistentString' scripts/modindex.lua(80,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(67,1) in function 'BeginStartupSequence' scripts/main.lua(382,1) in function 'callback' scripts/modindex.lua(550,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(524,1) in function 'Load' scripts/main.lua(381,1) in main chunk modmain.lua 3.15 kB · 0 downloads Update: I remove the Health and Sanity ingredient, same error so i now have no idea what is going on Well i'm not pro and im not sure that are you having same problem but did you tried to change line 64 local lightningbladerecipe = AddRecipe("lightningblade", with local lightningblade_recipe = AddRecipe("lightningblade", im not sure but it may work 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