RevelHalcyon Posted June 17, 2019 Share Posted June 17, 2019 I'd like my character to not announce when she's hungry as part of her downsides, but not be entirely mute like Wes. I've tried searching for ANNOUNCE_HUNGRY to try and locate the call to it, but from what I can tell it's tied to some generic character class. Commenting out the ANNOUNCE_HUNGRY line in her speech file or replacing it with nil just calls Wilson's instead, and leaving the line as "" still causes her to make a sound and flap her lips. It's very probable that I just don't know what I'm looking for in order to get this functionality I'm after, so any help would be appreciated. Link to comment Share on other sites More sharing options...
. . . Posted June 17, 2019 Share Posted June 17, 2019 the announcement for being hungry I believe is in the wisecracker component I think what you should do is copypaste the wisecracker component and rename it to your own thing like "wisecracker_mychar" then in the component just get rid of the listenforevent/code which makes the player announce they are hungry then in yourchar.lua remove the old wisecracker component and add the new one you made Link to comment Share on other sites More sharing options...
RevelHalcyon Posted June 17, 2019 Author Share Posted June 17, 2019 Ah alright then, that sounds like solid reasoning. I'll give that a shot. Link to comment Share on other sites More sharing options...
RevelHalcyon Posted June 17, 2019 Author Share Posted June 17, 2019 Well, it seems that didn't work. For clarity; I did as you suggested and added in a copy of wisecracker into my mod's scripts/components folder, renamed it (and the self references inside to match), commented out the hungry listener. Then, within my character.lua's master_postinit I did: inst:RemoveComponent("wisecracker") inst:AddComponent("wisecracker_mychar") It seemed not to work immediately (character still announces she's hungry) so I did a quick test, and within my version of wisecracker I changed ANNOUNCE_HUNGRY to ANNOUNCE_BEES. This did indeed make her scream about bees when she's hungry, so I know she's looking at the right version of wisecracker. However if I remove the hungry listener it just reverts to the default announcement rather than removing it all together. Link to comment Share on other sites More sharing options...
CarlZalph Posted June 17, 2019 Share Posted June 17, 2019 Removing the old component won't make the event listener it creates vanish. This is one of those components that was created a long time ago without the foresight of components being able to be removed. Link to comment Share on other sites More sharing options...
RevelHalcyon Posted June 18, 2019 Author Share Posted June 18, 2019 (edited) I see. So there isn't a way to override it? EDIT: So I figured out a solution, I'll post it here for the sake of anyone else who may search for this topic; I removed my custom wisecracker_mychar and replaced it with just a plain old copy of wisecracker (still not really used to the idea of being able to include official files and have the game take them over the basegame) and I just wrapped the hunger listener in an additional if statement that checks to see if the instance doesn't have my character tag on it first. inst:ListenForEvent("hungerdelta", function(inst, data) if not inst:HasTag("mycharactertag") then if data.newpercent <= TUNING.HUNGRY_THRESH and data.oldpercent > TUNING.HUNGRY_THRESH then inst.components.talker:Say(GetString(inst, "ANNOUNCE_HUNGRY")) end end end) Edited June 18, 2019 by RevelHalcyon 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