Answer the question
In order to leave comments, you need to log in
How to make dialogues in games?
In the game you need to make dialogues, how to do it right? Or at least read?
I imagine this:
The player calls the Speak script (with the character id):
It returns:
1) An array of the character's dialogues
2) An array of the player's responses.
Next, the player makes a request to Speak with the question number and the selected answer.
Browser game.
I use C# + SQL Server.
Answer the question
In order to leave comments, you need to log in
Either you misunderstand, or you described it incorrectly. A classic of the genre is 1 replica of the character and n answers of the main character. Even if you need to split the replica into several screens, this is 1 request. Those. point 1 is incorrect for you. Plus, it is not clear where the question number will come from and what it is all about. I would do this:
1) pull the Speak script, pass the player ID to it (if it is enough)
2) get 1 replica, its ID, answers and their IDs, or a dialogue end signal
3) if the dialogue end signal is not received - after the reaction from we pull the player's Speak, pass the player ID, replica ID and response ID. Let's go to point 2.
4) If the signal for the end of the dialogue is received (from point 2) - exit.
You can remove point 1, but this is an optimization, nothing more.
All this can be nicely wrapped in XML/JSON.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question