Okay, here is an
example of how such a multiple dialogue can be set up. This example refers to one "question" and two possible "answers"; but it can be extended to more possible answers.
There may be easier ways to do it though. This is the best that I can offer at the time being - I keep working on it, and hope to find an easier solution (or a solution that can be customized easily)
So take it as "work in progress"
First, create your screen where you wish to have the dialogue.
Add some text (3 times) by rightclicking on the screen as placeholder, it doesn't matter what you write in it. Choose for each of them an appropriate color and font that can be seen in front of the background that you use:
Text for MyQuestion
Text for MyAnswer1
Text for MyAnswer2
Then create a frame where the player should go after exiting the dialogue, in this case it's called "GamescreenNext".
Then create the following variant variables:
MyQuestion
MyAnswer1
MyAnswer2
Then create a hotspot over MyAnswer1 and MyAnswer2.
Add to the Advanced Tab of the hotspot MyAnswer1 the following code:
- Code: Select all
MyAnswer1_Clicked
Add to the Advanced Tab of the hotspot MyAnswer2 the following code:
- Code: Select all
MyAnswer2_Clicked
After that, add to the Advanced Tab of your Frame Property the following:
- Code: Select all
Dialogue1
DisplayText
And then comes the hard work
Go to the VB Procedures of your project, and add subroutines for the dialogue (the dialogue contents, and the definitions what dialogue should be called). Please note, that the contents of your variant variables should not be repeated, they must be unique.
Example:
- Code: Select all
Sub DisplayText 'This will make sure that the text of your questions and answers will be displayed
Text(1) = MyQuestion
Text(2) = MyAnswer1
Text(3) = MyAnswer2
End Sub
'Add your dialogues, in this example 7 different dialogues
Sub Dialogue1
MyQuestion = "How are you?"
MyAnswer1 = "Great!" 'go to Dialogue 2 as defined in Sub MyAnswer1_Clicked
MyAnswer2 = "Bad." 'go to Dialogue 3 as defined in Sub MyAnswer2_Clicked
DisplayText
End Sub
Sub Dialogue2
MyQuestion = "Good to hear. Will you help me?"
MyAnswer1 = "Yes." 'go to Dialogue 4 as defined in Sub MyAnswer1_Clicked
MyAnswer2 = "No." 'go to Dialogue 5 as defined in Sub MyAnswer2_Clicked
DisplayText
End Sub
Sub Dialogue3
MyQuestion = "That's a pity." 'Exit Dialogue and go to next screen after 2 seconds
MyAnswer1 = ""
MyAnswer2 = ""
DisplayText
Action.CreateTimedEvent 2, "GamescreenNext", false
End Sub
Sub Dialogue4
MyQuestion = "You need to bring me the letter, then I'll help you."
MyAnswer1 = "Okay." 'Exit Dialogue and go to next screen as defined in Sub MyAnswer1_Clicked
MyAnswer2 = "Where can I find it?" 'go to Dialogue 6 as defined in Sub MyAnswer2_Clicked
DisplayText
End Sub
Sub Dialogue5
MyQuestion = "Then I won't help you either. Bye."
MyAnswer1 = "No, wait. I've got money!" 'Go to Dialogue 7 as defined in Sub MyAnswer1_Clicked
MyAnswer2 = "Goodbye." 'Exit Dialogue and go to next screen as defined in Sub MyAnswer2_Clicked
DisplayText
End Sub
Sub Dialogue6
MyQuestion = "You need to talk to the wizard, he knows more about it. Bye" 'Exit Dialogue and go to next screen after 3 seconds
MyAnswer1 = "Bye."
MyAnswer2 = ""
DisplayText
Action.CreateTimedEvent 3, "GamescreenNext", false
End Sub
Sub Dialogue7
MyQuestion = "I don't need your money, I need the letter. Bye." 'Exit Dialogue and go to next screen after 2 seconds
MyAnswer1 = "Oh well. Bye."
MyAnswer2 = ""
DisplayText
Action.CreateTimedEvent 2, "GamescreenNext", false
End Sub
'Define what should happen if the player clicks the MyAnswer1 hotspot by using the content of the variant variables MyAnswer1
Sub MyAnswer1_Clicked
If MyAnswer1 = "Great!" Then
Dialogue2 'go to Dialogue2
ElseIf MyAnswer1 = "Yes." Then
Dialogue4 'go to Dialogue 4
ElseIf MyAnswer1 = "Okay." Then
Action.GoToFrame "GamescreenNext" 'Exit Dialogue and go to next screen immediately
ElseIf MyAnswer1 = "No, wait. I've got money!" Then
Dialogue7
End If
End Sub
'Define what should happen if the player clicks the MyAnswer2 hotspot by using the content of the variant variables MyAnswer2
Sub MyAnswer2_Clicked
If MyAnswer2 = "Bad." Then
Dialogue3 'go to Dialogue3
ElseIf MyAnswer2 = "No." Then
Dialogue5 'go to Dialogue 5
ElseIf MyAnswer2 = "Where can I find it?" Then
Dialogue6 'go to Dialogue 6
ElseIf MyAnswer2 = "Goodbye." Then
Action.GoToFrame "GamescreenNext" 'Exit Dialogue and go to next screen immediately
End If
End Sub
'In some cases the player needs to read an answer before leaving the screen, the following code defines the action of the timed event
Sub GamescreenNext
Action.GoToFrame "GamescreenNext"
End Sub