Guest deleted43426342 Posted January 15, 2018 Share Posted January 15, 2018 As the title says, how do you keep track of the dialogue the player picked so that the next time they greet an NPC they respond accordingly. For example one of my NPCs asks for your help but it's too small for a quest as you only have to ask something to your companion. If you agree to help her I want her to respond a different way than when you don't agree to help her. How do you do that? Link to comment Share on other sites More sharing options...
dubiousintent Posted January 15, 2018 Share Posted January 15, 2018 (edited) You set a variable you have defined (usually in a "quest script") that you use to track responses. That variable is then used as a "test condition" for the dialog so it will only become available when the correct conditions exist (such as moving in range of an activator/Actor; or have "said" the previous line of dialog). In the End type "Result Script" of each line of related dialog, you set that variable to indicate that line of dialog has been "said", so that line's condition will be "false" and skipped over the next time, and the next line will then encounter a "true" condition. Basically you are assigning a "line number" to each line of dialog, and checking if the previous (or a particular) line has been spoken on each subsequent line. There are a number of companions that use this technique you can use as examples. -Dubious- Edited January 15, 2018 by dubiousintent Link to comment Share on other sites More sharing options...
EPDGaffney Posted January 15, 2018 Share Posted January 15, 2018 (edited) It's very common to use a 'quest' just to have variables available to manipulate across many different aspects of a mod or to use timers and stuff like that. A very common technique is to use a 'variable reservoir', which is a quest that does nothing but have a script that declares loads of variables to use in other scripts or dialogue across your mod. I used to think exactly what you did, that something was 'too small' for a quest but that's not the way to go about it. If it needs a 'quest', it needs one, even if there's not really a quest involved. I have a quest that starts when you pick up an object and ends when you leave the room, just to respond to what you do before you leave the room. In fact, once it responds, it ends, so it may end even before you leave the room. It runs for about ten seconds for the average player. So, as Dubious says, you have a quest that declares the variable: scn MyQuestScript int HelpThen in dialogue, when she asks for your help, you set that variable to 1 or 2, depending on your answer. There are other ways, like ticking Say Once and organising it correctly, but this is probably easier to visualise. So, in the result script, when she responds after you tell her you will or won't help her, you put: Set MyQuest.Help to 1That could be set to 1 if you agree and 2 if you refuse to help. Then, you make a greeting for when the variable is set to 1 and for when it's set to 2:https://prnt.sc/i0rv8p See that, the variables are already available in a dropdown menu once the quest and script are saved/attached and the variables declared. Just save all that before you access the dropdown menu or it won't appear (and remember to set your script to Quest rather than the default of Object). Edited January 15, 2018 by EPDGaffney Link to comment Share on other sites More sharing options...
Guest deleted43426342 Posted January 15, 2018 Share Posted January 15, 2018 You set a variable you have defined (usually in a "quest script") that you use to track responses. That variable is then used as a "test condition" for the dialog so it will only become available when the correct conditions exist (such as moving in range of an activator/Actor; or have "said" the previous line of dialog). In the End type "Result Script" of each line of related dialog, you set that variable to indicate that line of dialog has been "said", so that line's condition will be "false" and skipped over the next time, and the next line will then encounter a "true" condition. Basically you are assigning a "line number" to each line of dialog, and checking if the previous (or a particular) line has been spoken on each subsequent line. There are a number of companions that use this technique you can use as examples. -Dubious- Ah, alright. Thank you! It's very common to use a 'quest' just to have variables available to manipulate across many different aspects of a mod or to use timers and stuff like that. A very common technique is to use a 'variable reservoir', which is a quest that does nothing but have a script that declares loads of variables to use in other scripts or dialogue across your mod. I used to think exactly what you did, that something was 'too small' for a quest but that's not the way to go about it. If it needs a 'quest', it needs one, even if there's not really a quest involved. I have a quest that starts when you pick up an object and ends when you leave the room, just to respond to what you do before you leave the room. In fact, once it responds, it ends, so it may end even before you leave the room. It runs for about ten seconds for the average player. So, as Dubious says, you have a quest that declares the variable: scn MyQuestScript int HelpThen in dialogue, when she asks for your help, you set that variable to 1 or 2, depending on your answer. There are other ways, like ticking Say Once and organising it correctly, but this is probably easier to visualise. So, in the result script, when she responds after you tell her you will or won't help her, you put: Set MyQuest.Help to 1That could be set to 1 if you agree and 2 if you refuse to help. Then, you make a greeting for when the variable is set to 1 and for when it's set to 2:https://prnt.sc/i0rv8p See that, the variables are already available in a dropdown menu once the quest and script are saved/attached and the variables declared. Just save all that before you access the dropdown menu or it won't appear (and remember to set your script to Quest rather than the default of Object). Alright, I tried to do what you just explained but it won't save. I know that means that you did something wrong but am I supposed to add something to the script? As I can't save the one you wrote either. Link to comment Share on other sites More sharing options...
EPDGaffney Posted January 15, 2018 Share Posted January 15, 2018 (edited) It should work, but let me clarify that scn MyQuestScript is naming the script MyQuestScript, so you probably want to change that, and Set MyQuest.Help to 1 is calling that Help variable from that script but that script is in this scenario attached to a quest called MyQuest, so the two names are not identical and it would be impossible for them to be identical. They're just similar in this scenario and many people like to call a quest script the same thing as the quest but with the word Script appended. If that's not your trouble, there should be a message explaining (at least partially) what's wrong anyway. I think I have occasionally had to alt-tab to messages like that, so try that maybe. Edit: I think you're talking about a script not saving, but don't forget to attach the script to the quest, and that that means clicking OK on the quest form, then opening it again once the script is done, then attaching it, then clicking OK again. Good idea to save after that as well. Edited January 15, 2018 by EPDGaffney Link to comment Share on other sites More sharing options...
Guest deleted43426342 Posted January 15, 2018 Share Posted January 15, 2018 Thank you, it worked! I got it to save even though I don't really know what I did differently this time. Still, thank you! Link to comment Share on other sites More sharing options...
EPDGaffney Posted January 15, 2018 Share Posted January 15, 2018 Well, I wish we knew what you did but I'm glad it worked. Link to comment Share on other sites More sharing options...
Recommended Posts