Newbie trouble with lua vars and continuing conversations
Posted: Fri May 24, 2019 5:35 pm
I want to have an npc which as the player interacts, does something else, returns to interact, and picks up where they left off in the dialogue?/conversation? I tried laying them all out [there are about 20 different statements with 2 to 3 menu options for the player but of course some of these are never seen depending on the options the player chooses] in one Conversation and the layout was great, but then the player simply worked through the whole entire scene's worth of dialogue without being able to move away. If they moved away, it restarted when triggered again of course.
So I tried the RememberCurrentDialogueEntry.cs script, but while I got the debug lines, it never saved anything. I tried putting in the variables and initializing them in case they couldnt be created, but they never changed.
So I tried laying out my dialogue as individual conversations [aka 20 of them] -- one npc line with one set of options. I made a curconvo var to keep track, assuming I could use the script field on a menu option child to set the curconvo to the next linked convo id. The logic appeared to work, as I could hardcode the curconvo to whatever id I wanted the dialogue would jump to [because I had set conditions for that var on the convos] and start there. And yet again, when running the scene, the variable never changed even though I was setting it.
This is all during one running of a scene -- I'm not switching scenes or restarting. I just want to be able to walk away from the npc and come back and jump into the correct point of my conversation based on where I left off.
I've reviewed the demo scene and I feel like I'm doing the same setup as used for killing enemies and checking that value.
So I tried the RememberCurrentDialogueEntry.cs script, but while I got the debug lines, it never saved anything. I tried putting in the variables and initializing them in case they couldnt be created, but they never changed.
So I tried laying out my dialogue as individual conversations [aka 20 of them] -- one npc line with one set of options. I made a curconvo var to keep track, assuming I could use the script field on a menu option child to set the curconvo to the next linked convo id. The logic appeared to work, as I could hardcode the curconvo to whatever id I wanted the dialogue would jump to [because I had set conditions for that var on the convos] and start there. And yet again, when running the scene, the variable never changed even though I was setting it.
This is all during one running of a scene -- I'm not switching scenes or restarting. I just want to be able to walk away from the npc and come back and jump into the correct point of my conversation based on where I left off.
I've reviewed the demo scene and I feel like I'm doing the same setup as used for killing enemies and checking that value.