Chesed Posted September 7, 2025 Share Posted September 7, 2025 (edited) I have a modded character who swaps between different 'characters' when he equips different masks. I'm in the process of adding a new mask to his mod who speaks in all caps, like WX. I accomplished this by adding this to the mask's OnEquip function: Quote owner.components.talker.mod_str_fn = string.utf8upper However, I then realised I don't know how to reset the character's dialogue back to normal when the mask is removed. I tried looking at util.lua and trying some things I saw there, but they all either seem to be modifiers to the default text that aren't fit for my purpose, or just crash the game. I'm not good enough at coding to actually understand what is happening in the file to attempt to engineer a solution myself. Does anyone know if it is possible to do something like this? I've found my character tends to create problems that are much harder to solve than they appear so I am hoping I am missing something extremely obvious. Edited September 7, 2025 by Chesed Link to comment https://forums.kleientertainment.com/forums/topic/167880-solved-automatically-swapping-back-and-forth-between-all-caps-speech/ Share on other sites More sharing options...
FerniFrenito Posted September 7, 2025 Share Posted September 7, 2025 22 minutes ago, Chesed said: I have a modded character who swaps between different 'characters' when he equips different masks. I'm in the process of adding a new mask to his mod who speaks in all caps, like WX. I accomplished this by adding this to the mask's OnEquip function: However, I then realised I don't know how to reset the character's dialogue back to normal when the mask is removed. I tried looking at util.lua and trying some things I saw there, but they all either seem to be modifiers to the default text that aren't fit for my purpose, or just crash the game. I'm not good enough at coding to actually understand what is happening in the file to attempt to engineer a solution myself. Does anyone know if it is possible to do something like this? I've found my character tends to create problems that are much harder to solve than they appear so I am hoping I am missing something extremely obvious. Just save the original font: owner.components.talker.original_font = owner.components.talker.mod_str_fn -- Save the original font owner.components.talker.mod_str_fn = string.utf8upper -- Put the new font ... -- When you need to back to the original font: owner.components.talker.mod_str_fn = owner.components.talker.original_font When you adding attributes to an entity, components, or any class, you are not "modifying" the class, i mean, you cannot break it by adding attributes , so, add whatever you want and need. 1 Link to comment https://forums.kleientertainment.com/forums/topic/167880-solved-automatically-swapping-back-and-forth-between-all-caps-speech/#findComment-1834766 Share on other sites More sharing options...
Chesed Posted September 7, 2025 Author Share Posted September 7, 2025 (edited) 11 minutes ago, FerniFrenito said: you are not "modifying" the class I meant modifier in the literal sense and don't understand what that means, but regardless the solution you provided works, so thank you in any case. Edited September 7, 2025 by Chesed Link to comment https://forums.kleientertainment.com/forums/topic/167880-solved-automatically-swapping-back-and-forth-between-all-caps-speech/#findComment-1834767 Share on other sites More sharing options...
FerniFrenito Posted September 7, 2025 Share Posted September 7, 2025 17 minutes ago, Chesed said: I meant modifier in the literal sense and don't understand what that means, but regardless the solution you provided works, so thank you in any case. I mean that by adding variables, as long as they do not have the same name as any other, you will not interfere in any way with the original functioning of the class. Link to comment https://forums.kleientertainment.com/forums/topic/167880-solved-automatically-swapping-back-and-forth-between-all-caps-speech/#findComment-1834768 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