. . . Posted April 1, 2024 Share Posted April 1, 2024 There's something I really dislike that characters now forcefully enter the talking state after a state ends if text is above their head if they talked in the previous state. I think I found the functions which cause it in SGWilson local function StopTalkSound(inst, instant) if not instant and inst.endtalksound ~= nil and inst.SoundEmitter:PlayingSound("talk") then inst.SoundEmitter:PlaySound(inst.endtalksound) end inst.SoundEmitter:KillSound("talk") end local function CancelTalk_Override(inst, instant) if inst.sg.statemem.talktask ~= nil then inst.sg.statemem.talktask:Cancel() inst.sg.statemem.talktask = nil StopTalkSound(inst, instant) end end local function OnTalk_Override(inst) CancelTalk_Override(inst, true) if DoTalkSound(inst) then inst.sg.statemem.talktask = inst:DoTaskInTime(1.5 + math.random() * .5, CancelTalk_Override) end return true end local function OnDoneTalking_Override(inst) CancelTalk_Override(inst) return true end but I have no idea how I can edit these since they are local. If anyone can help guide me how I can edit these to ideally make them empty or return nothing it would be really wonderful ! Thanks for reading and your time, have a good day! Link to comment https://forums.kleientertainment.com/forums/topic/155384-how-can-i-editoverride-a-local-function-in-sgwilson/ Share on other sites More sharing options...
LeafyFly Posted May 18, 2024 Share Posted May 18, 2024 debug.setupvalue(func, index, value) 1 Link to comment https://forums.kleientertainment.com/forums/topic/155384-how-can-i-editoverride-a-local-function-in-sgwilson/#findComment-1715208 Share on other sites More sharing options...
. . . Posted June 8, 2024 Author Share Posted June 8, 2024 @LeafyFly hello! thanks for the reply and sorry for the very late reply back, but how exactly would I use this? would it be like debug.setupvalue(StopTalkSound, IDK, nil) ? Link to comment https://forums.kleientertainment.com/forums/topic/155384-how-can-i-editoverride-a-local-function-in-sgwilson/#findComment-1721620 Share on other sites More sharing options...
_zwb Posted June 10, 2024 Share Posted June 10, 2024 https://www.lua.org/manual/5.1/manual.html#5.9 The debug library allows you to modify local variables and functions, though it's rather complicated to use directly, there are some libraries making things easier like this one by Rezecib: https://github.com/rezecib/Rezecib-s-Rebalance/blob/master/scripts/tools/upvaluehacker.lua Link to comment https://forums.kleientertainment.com/forums/topic/155384-how-can-i-editoverride-a-local-function-in-sgwilson/#findComment-1722393 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