Back and forth conversation
Posted: Wed Apr 07, 2021 8:09 am
I have a quick question. I am making certain interactions where a player is talking to an NPC, and then when a small back and forth goes on, the conversation ends and then immediately when the player presses goodbye, they enter a conversation with another NPC. I was able to script it and code it so that it works most of the time, the problem is sometimes it just doesn't.
What I do is when one interaction ends, it sets the state of a global state I made, and then the next conversation with the NPC happens. I make it so that every change to a new NPC makes it so that the next part of the interaction happens after each global state change.
Pretty much all the interactions work, its just that sometimes after one interaction with the NPC, the next one is just silence, and then when I talk to them again, it's still silence.
Then when I talk to the next person, the conversation continues, having skipped the one part that occurred with the silence.
But it doesn't happen every time, only occasionally, and at random parts. In the editor it works fine, but in game it just sometimes doesn't, and when I save and restore it from before the conversation, it will work perfectly fine, or not work at a different part. I can do it 5 times in a row, and it go wrong in different parts, with doing nothing different between each parts.
Is it just because the editor wasn't really meant to do conversations that way, or is there something I am doing wrong?
What I do is when one interaction ends, it sets the state of a global state I made, and then the next conversation with the NPC happens. I make it so that every change to a new NPC makes it so that the next part of the interaction happens after each global state change.
Pretty much all the interactions work, its just that sometimes after one interaction with the NPC, the next one is just silence, and then when I talk to them again, it's still silence.
Then when I talk to the next person, the conversation continues, having skipped the one part that occurred with the silence.
But it doesn't happen every time, only occasionally, and at random parts. In the editor it works fine, but in game it just sometimes doesn't, and when I save and restore it from before the conversation, it will work perfectly fine, or not work at a different part. I can do it 5 times in a row, and it go wrong in different parts, with doing nothing different between each parts.
Is it just because the editor wasn't really meant to do conversations that way, or is there something I am doing wrong?