unya_10 Posted September 2, 2024 Share Posted September 2, 2024 (edited) I added a mod that increases sanity when character A and character B together. local function checkaura(inst, observer) if observer:HasTag("characterB") then return TUNING.SANITYAURA_LARGE end end local common_postinit = function(inst) inst:AddTag("characterB") inst:AddComponent("sanityaura") inst.components.sanityaura.aurafn = checkaura return inst end local master_postinit = function(inst) -- characterA return inst end I added that code to each character's lua, and the interaction worked well. But, when characterA met characterA or other characters not in the HasTag, there is a mod conflict as shown in that photo. (Error : attempt to perform arithmetic on a nil value LUA ERROR stack traceback) I couldn't solve this problem because I was a beginner. I hope that someone can help me with this problem. Edited September 2, 2024 by unya_10 Link to comment https://forums.kleientertainment.com/forums/topic/159467-when-i-play-with-other-players-sanity-mod-conflict-occurs/ Share on other sites More sharing options...
Baguettes Posted September 3, 2024 Share Posted September 3, 2024 Can I have the full crash logs? I want to look deeper into this. Link to comment https://forums.kleientertainment.com/forums/topic/159467-when-i-play-with-other-players-sanity-mod-conflict-occurs/#findComment-1745542 Share on other sites More sharing options...
unya_10 Posted September 5, 2024 Author Share Posted September 5, 2024 On 9/3/2024 at 5:15 PM, Baguettes said: Can I have the full crash logs? I want to look deeper into this. I'm so sorry I checked late. Are these the log files you're talking about? If not, please let me know! And thank you for your help. client_log_2024-09-02-02-04-00.txt client_log_2024-09-02-03-01-58.txt Link to comment https://forums.kleientertainment.com/forums/topic/159467-when-i-play-with-other-players-sanity-mod-conflict-occurs/#findComment-1745859 Share on other sites More sharing options...
Baguettes Posted September 6, 2024 Share Posted September 6, 2024 I'm afraid these logs do not contain the crash; if you want to make sure it's the correct one, you can load your game, replicate your crash and use the client_log.txt in your current game session. You can use Ctrl + F to look through contents of the text file; type in LUA ERROR in the search box, and if your log has it, that's the correct one. Link to comment https://forums.kleientertainment.com/forums/topic/159467-when-i-play-with-other-players-sanity-mod-conflict-occurs/#findComment-1746140 Share on other sites More sharing options...
5sam Posted October 26, 2024 Share Posted October 26, 2024 Hello. Can I also get some help? I'm experiencing exactly the same problem. However, I don't know much about coding, so I couldn't figure out a solution by looking at the logs... This is my crash logs. You can use Ctrl + F to find them. client_log_2024-10-26-20-10-03.txt Link to comment https://forums.kleientertainment.com/forums/topic/159467-when-i-play-with-other-players-sanity-mod-conflict-occurs/#findComment-1754725 Share on other sites More sharing options...
Baguettes Posted October 26, 2024 Share Posted October 26, 2024 (edited) 1 hour ago, 5sam said: Hello. Can I also get some help? I'm experiencing exactly the same problem. However, I don't know much about coding, so I couldn't figure out a solution by looking at the logs... This is my crash logs. You can use Ctrl + F to find them. client_log_2024-10-26-20-10-03.txt Your logs say you're trying to do maths on a nil value. This probably has something to do with your aura fn in your character's Lua file. Is your sanity aura fn returning a value for the game to work with? Edited October 26, 2024 by Baguettes Link to comment https://forums.kleientertainment.com/forums/topic/159467-when-i-play-with-other-players-sanity-mod-conflict-occurs/#findComment-1754733 Share on other sites More sharing options...
5sam Posted October 26, 2024 Share Posted October 26, 2024 local function checkaura(inst, observer) if observer:HasTag("tagA") then return TUNING.SANITYAURA_HUGE end end local function common_postinit (inst) inst.soundsname = "willow" inst.MiniMapEntity:SetIcon( "characterA_mapicon.tex" ) inst:AddTag("tagA") inst:AddComponent("sanityaura") inst.components.sanityaura.aurafn = checkaura return inst end Here’s the Lua script for characterA that I wrote. Is there something wrong with it? I want to apply the sanityaura effect only to characters assigned with "tagA". Therefore, I added the observer code to the Lua script of characterA. Additionally, I assigned the AddTag("tagA") code to characterA, characterB, and characterC so they would receive the sanityaura effect. Link to comment https://forums.kleientertainment.com/forums/topic/159467-when-i-play-with-other-players-sanity-mod-conflict-occurs/#findComment-1754841 Share on other sites More sharing options...
summerscorcher Posted October 27, 2024 Share Posted October 27, 2024 (edited) Baguettes is right: In your code it only returns TUNING.SANITYAURA_HUGE if the character has your tag. You need to define what happens if a character does not have the tag: local function checkaura(inst, observer) if observer:HasTag("tagA") then return TUNING.SANITYAURA_HUGE else return 0 -- Presuming 0 is the right number for no aura end end Edited October 27, 2024 by summerscorcher 1 Link to comment https://forums.kleientertainment.com/forums/topic/159467-when-i-play-with-other-players-sanity-mod-conflict-occurs/#findComment-1754876 Share on other sites More sharing options...
5sam Posted October 27, 2024 Share Posted October 27, 2024 4 hours ago, summerscorcher said: Baguettes is right: In your code it only returns TUNING.SANITYAURA_HUGE if the character has your tag. You need to define what happens if a character does not have the tag: local function checkaura(inst, observer) if observer:HasTag("tagA") then return TUNING.SANITYAURA_HUGE else return 0 -- Presuming 0 is the right number for no aura end end I was able to solve the problem. Thank youuuu!! Link to comment https://forums.kleientertainment.com/forums/topic/159467-when-i-play-with-other-players-sanity-mod-conflict-occurs/#findComment-1754908 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