MadAl777 Posted October 27, 2025 Posted October 27, 2025 Hello, everyone! I am currently creating my own mod and have a question: is it possible to make the game “remember” the NPCs that the player has talked to while one global variable is equal to 0, and when it changes to 1, the process of “remembering” NPCs stops? And is it possible to automatically add these NPCs to a faction or use SPID/SkyPatcher/FLM to give these NPCs special (one-time) lines? I'm new to this and can't find anything like this anywhere. Thank you in advance for your help!
blank_v Posted October 27, 2025 Posted October 27, 2025 (edited) You mean specific dialogue option or any dialogue option? You could give Dialogue condition to check if NPC has magic effect condition, and for example if he dont have it then dialogue is visible: You can then add small TIF script ( dialogue script ) that will at the end of the conversation cast magic effect on the NPC You can get in the script ( Dialogue Script ) reference to the NPC via akSpeaker It's best if You use MagicEffect because using for example other script that would hold references could cause issues like for example if actor gets deleted from the scene and if u use MagicEffect then game will use its "natural" behavior, dialogue conditions and magic effects You can also create Spell and control its duration, keep in mind tho duration is in "real life" seconds 1 ingame hour is if i remember correctly 180 seconds ( 3 minutes ) That ofc. only if You want to control specific dialogue option, like the one that You would add, because u need to physically add the condition to dialogue topic... //edit: fixing image... Edited October 27, 2025 by ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ 1
MadAl777 Posted October 28, 2025 Author Posted October 28, 2025 (edited) 8 hours ago, ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ said: You mean specific dialogue option or any dialogue option? You could give Dialogue condition to check if NPC has magic effect condition, and for example if he dont have it then dialogue is visible: You can then add small TIF script ( dialogue script ) that will at the end of the conversation cast magic effect on the NPC You can get in the script ( Dialogue Script ) reference to the NPC via akSpeaker It's best if You use MagicEffect because using for example other script that would hold references could cause issues like for example if actor gets deleted from the scene and if u use MagicEffect then game will use its "natural" behavior, dialogue conditions and magic effects You can also create Spell and control its duration, keep in mind tho duration is in "real life" seconds 1 ingame hour is if i remember correctly 180 seconds ( 3 minutes ) That ofc. only if You want to control specific dialogue option, like the one that You would add, because u need to physically add the condition to dialogue topic... //edit: fixing image... No, I don't want to add a full-fledged dialogue—it should just be the NPC's reaction if the global variable changes from 0 to 1. To do this, I need to somehow make the NPC remember that PC interacted with NPC, while the global variable was 0, and then when it changed to 1, the memory function is disabled and the dialogue line with this NPC should be displayed. It’s like in fertility mode: if PC has sex with a woman - she will be “remebered”. I need the same but for dialogue. Edited October 28, 2025 by MadAl777
jib_buttkiss Posted October 28, 2025 Posted October 28, 2025 The first thing that comes to mind for me is a cloak spell. It's a pretty common way to dynamically run scripts on NPCs without editing it onto them. The CK Wiki has an article about how to do it: https://ck.uesp.net/wiki/Dynamically_Attaching_Scripts And since the cloak script retriggers every few seconds (however long you set it), you could then have that script check IsInDialogueWithPlayer() on the NPCs it touches and track them if it returns 1. As long as you set the frequency fast enough, it'll catch every NPC the player talks to. How you track the talked-to actors will depend on what you want to do with them. If it's permanent and you just want to add dialogue/just check that the player talked to them, you could just add them to a faction (for example, once the player talks to them, they'll say "Hey slut!" to them forever). But then you won't have any way to recover that list of talked to NPCs, if you want to reset them or run a script on them. If you want to make the NPCs do something when you trigger another script (for example, when your tracking time ends, every NPC you've talked to runs up and attacks the player), you'll need to keep a list of them somewhere in the script. There's a few ways to do that- a formlist, an array, a bunch of aliases, a StorageUtil structure, whatever. For this I'd probably have a manager quest that handles the overhead (tracking the NPCs, triggering the cloak every x seconds, triggering the behavior, resetting afterwards), so you don't run into volatility issues with the cloak scripts only existing for a few second at a time. 1
MadAl777 Posted October 28, 2025 Author Posted October 28, 2025 23 minutes ago, jib_buttkiss said: The first thing that comes to mind for me is a cloak spell. It's a pretty common way to dynamically run scripts on NPCs without editing it onto them. The CK Wiki has an article about how to do it: https://ck.uesp.net/wiki/Dynamically_Attaching_Scripts And since the cloak script retriggers every few seconds (however long you set it), you could then have that script check IsInDialogueWithPlayer() on the NPCs it touches and track them if it returns 1. As long as you set the frequency fast enough, it'll catch every NPC the player talks to. How you track the talked-to actors will depend on what you want to do with them. If it's permanent and you just want to add dialogue/just check that the player talked to them, you could just add them to a faction (for example, once the player talks to them, they'll say "Hey slut!" to them forever). But then you won't have any way to recover that list of talked to NPCs, if you want to reset them or run a script on them. If you want to make the NPCs do something when you trigger another script (for example, when your tracking time ends, every NPC you've talked to runs up and attacks the player), you'll need to keep a list of them somewhere in the script. There's a few ways to do that- a formlist, an array, a bunch of aliases, a StorageUtil structure, whatever. For this I'd probably have a manager quest that handles the overhead (tracking the NPCs, triggering the cloak every x seconds, triggering the behavior, resetting afterwards), so you don't run into volatility issues with the cloak scripts only existing for a few second at a time. I want to add NPC reactions to the fact that the main character was changed through my TGQM mod. This is where I use my global variable to mark the ‘changed’ player after the potions effect. And it is precisely for such reactions that I need the NPCs that the player talked to BEFORE the change to react to the player AFTER change. The Cloak spell - I thought about that, but wouldn't it overload the game?
jib_buttkiss Posted October 28, 2025 Posted October 28, 2025 4 minutes ago, MadAl777 said: I want to add NPC reactions to the fact that the main character was changed through my TGQM mod. This is where I use my global variable to mark the ‘changed’ player after the potions effect. And it is precisely for such reactions that I need the NPCs that the player talked to BEFORE the change to react to the player AFTER change. The Cloak spell - I thought about that, but wouldn't it overload the game? Nah, it should be fine, it's a pretty commonly used trick. As long as you don't make it trigger too fast (which you don't need to since player dialogues always last at least a few seconds) and trigger in too big of an area (which you don't need to, you only need to catch NPCs close enough to be talked to), you'll be fine. So your use case is an event happens (the genderbend), and then every NPC the player met before that event gains some dialogue? I'd say the faction method is best, just make a KnewPlayerBeforeBent faction that they get added to in the script and condition your "huh I thought you were a guy" dialogues against the speaker being in that faction. You could even end the cloak spell after the player gets genderbent, to really save on script load since it won't be doing anything afterwards. 1
MadAl777 Posted October 28, 2025 Author Posted October 28, 2025 27 minutes ago, jib_buttkiss said: Nah, it should be fine, it's a pretty commonly used trick. As long as you don't make it trigger too fast (which you don't need to since player dialogues always last at least a few seconds) and trigger in too big of an area (which you don't need to, you only need to catch NPCs close enough to be talked to), you'll be fine. So your use case is an event happens (the genderbend), and then every NPC the player met before that event gains some dialogue? I'd say the faction method is best, just make a KnewPlayerBeforeBent faction that they get added to in the script and condition your "huh I thought you were a guy" dialogues against the speaker being in that faction. You could even end the cloak spell after the player gets genderbent, to really save on script load since it won't be doing anything afterwards. Thank you so much for the advice! I hope that I will handle this and new update will come soon!
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