chaosdc123 Posted February 25, 2019 Share Posted February 25, 2019 :04:18]: [string "scripts/stategraphs/SGhound.lua"]:231: attempt to index field 'sounds' (a nil value) LUA ERROR stack traceback: scripts/stategraphs/SGhound.lua:231 in (field) fn (Lua) <231-231> scripts/stategraph.lua:568 in (method) UpdateState (Lua) <536-580> scripts/stategraph.lua:607 in (method) Update (Lua) <599-627> scripts/stategraph.lua:125 in (method) Update (Lua) <109-148> scripts/update.lua:218 in () ? (Lua) <149-228> i was using a mod and the above happend, any ideas? Link to comment Share on other sites More sharing options...
Ultroman Posted February 25, 2019 Share Posted February 25, 2019 Which mod caused it? Link to comment Share on other sites More sharing options...
chaosdc123 Posted February 25, 2019 Author Share Posted February 25, 2019 a mod called caopr, it happens (or seems to happen) when you set the houndmoun that is unique to it Link to comment Share on other sites More sharing options...
Ultroman Posted February 25, 2019 Share Posted February 25, 2019 (edited) It seems to be an oversight on the modder's side. They didn't include the sounds-variable on the instances of their necrohound prefab, yet they use the SGhound stategraph which utilizes the sounds-variable in question. You can see where Klei adds this variable on lines 46-56 and line 388 in the original hound.lua (prefab). Pretty straight-forward fix. You can write to the author and link to this post, and see if they want to fix it. They haven't answered for almost a year, so I doubt they'll fix it, so if you want to play with this character online, you'll have to fix it yourself and upload a new version of the mod. Do try asking them first, though. Edited February 25, 2019 by Ultroman Link to comment Share on other sites More sharing options...
chaosdc123 Posted February 25, 2019 Author Share Posted February 25, 2019 will do, and thank you for the help (ill link them to this thread just cause doesnt hurt to try) Link to comment Share on other sites More sharing options...
Ultroman Posted February 25, 2019 Share Posted February 25, 2019 You're welcome Good luck with it. Looks like a fun character. Link to comment Share on other sites More sharing options...
chaosdc123 Posted February 25, 2019 Author Share Posted February 25, 2019 ill post a new version on the mod if the guy doesnt respond, in lets say a 2 week (ill take it down the moment he asks/demands it) also, are you reffering to inst.sounds = tag == "clay" and sounds_clay or sounds because thats on line 388 Link to comment Share on other sites More sharing options...
Ultroman Posted February 25, 2019 Share Posted February 25, 2019 (edited) Yes. This line: inst.sounds = tag == "clay" and sounds_clay or sounds says: If the variable 'tag' holds the value "clay", then it should set 'inst.sounds' to refer to the 'sounds_clay' variable, otherwise it should set it to refer to the 'sounds' variable. You can probably just copy lines 46-56 from hound.lua in at the top of the necrohound.lua (roughly the same place that they're placed in hound.lua), and then put in this line (below) where hound.lua has that other line (the one above): inst.sounds = sounds since I'm pretty sure the necrohounds are supposed to use the regular hound-sounds and not the clay_hound-sounds. Edited for clarity. Edited for more clarity. Edited February 25, 2019 by Ultroman Link to comment Share on other sites More sharing options...
chaosdc123 Posted February 25, 2019 Author Share Posted February 25, 2019 ok so using that line worked like a charm, another problem arose but it was easy to fix, the OA disabled the follower component but deleting the two lines "--" fixes it, and again, thank you for the HUGE help. idk why i spent 3 hours trying to fix it lmao Link to comment Share on other sites More sharing options...
Ultroman Posted February 25, 2019 Share Posted February 25, 2019 I bet you learned something in those 3 hours, though You're welcome, m8. Link to comment Share on other sites More sharing options...
chaosdc123 Posted February 25, 2019 Author Share Posted February 25, 2019 (edited) you bet I did, didnt even know of the SG files, may lead to some interesting things in the future edit to be less vulgar Edited February 25, 2019 by chaosdc123 Link to comment Share on other sites More sharing options...
Ultroman Posted February 25, 2019 Share Posted February 25, 2019 Do the sounds work for the necrohounds now, or did the error just go away? Link to comment Share on other sites More sharing options...
chaosdc123 Posted February 25, 2019 Author Share Posted February 25, 2019 the sound works, i assume all in working as it should be, the only oddesy is the fact the child necrohound walks into the necromound for 2 seconds Link to comment Share on other sites More sharing options...
Ultroman Posted February 25, 2019 Share Posted February 25, 2019 ok, that's probably acceptable. Link to comment Share on other sites More sharing options...
chaosdc123 Posted February 25, 2019 Author Share Posted February 25, 2019 ok, so I spawned another regular hound (not a necromound hound) and it says [string "../mods/workshop-78170850/scripts/stategra..."]:130: attenpt to index field 'sounds' (a nil value) so by fixing the necro hound mound we broke the regular hound, so im wondering, do I add the tag "clay"? sadly thats all i could think of as everything you/we fixed , fixed the first problem that was exactly the same thing lmao State{ name = "taunt", tags = { "busy" }, onenter = function(inst, norepeat) if inst:HasTag("clay") then inst.sg:GoToState("howl", norepeat and -1 or 0) else inst.Physics:Stop() inst.AnimState:PlayAnimation("taunt") inst.sg.statemem.norepeat = norepeat end end, timeline = { TimeEvent(13 * FRAMES, function(inst) inst.SoundEmitter:PlaySound(inst.sounds.bark) end), TimeEvent(24 * FRAMES, function(inst) inst.SoundEmitter:PlaySound(inst.sounds.bark) end), }, events = { EventHandler("animover", function(inst) if not inst.sg.statemem.norepeat and math.random() < .333 then inst.sg:GoToState("taunt", inst.components.follower.leader ~= nil and inst.components.follower.leader:HasTag("player")) else inst.sg:GoToState("idle") end end), }, }, this is the line of code that is crashing the game, ill try my best to figure it out Link to comment Share on other sites More sharing options...
Ultroman Posted February 25, 2019 Share Posted February 25, 2019 (edited) That doesn't make any sense. If we don't touch the regular hound, it shouldn't get bugged by changes to the custom necrohound. There must be something else wrong, then. Edited February 25, 2019 by Ultroman Link to comment Share on other sites More sharing options...
chaosdc123 Posted February 25, 2019 Author Share Posted February 25, 2019 perhaps i touched something else and didnt realize it/didnt undo it was something dumb i did, not sure what, but i uninstalled and reinstalled the mod and made the correct changes to add the sound that you said to do and now both of the good boys are working Link to comment Share on other sites More sharing options...
Ultroman Posted February 25, 2019 Share Posted February 25, 2019 Phew! That's good It doesn't take much to destroy everything Link to comment Share on other sites More sharing options...
chaosdc123 Posted February 25, 2019 Author Share Posted February 25, 2019 (edited) thanks again, hope the OMA sees this and makes a quick fix so this amazing mod can be shown without any bugs Edited February 25, 2019 by chaosdc123 Link to comment Share on other sites More sharing options...
Ultroman Posted February 25, 2019 Share Posted February 25, 2019 No problem. And yeah, I hope so, too. 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