So now the entire code should look like this:
General | Declarations
Dim Merlin As IAgentCtlCharacter
Const MERLINPATH = "Merlin.acs"
Dim reqDisappear As Object
Dim reqSpeak As Object
Private Sub Agent1_RequestComplete _
(ByVal Request As Object)
If Request Is reqDisappear Then
picPicture.Visible = False
Set reqSpeak = Merlin.Speak("Yes, it worked!")
ElseIf Request Is reqSpeak Then
picPicture.Visible = True
Merlin.Play "surprised"
Merlin.Play "RestPose"
Merlin.Speak "Oh, no. I will have to work" _
& " on my magic."
Merlin.Play "process"
Merlin.Speak "This calls for some work, I" _
& " will have to consult the Grand Wizard!"
Merlin.Hide
End If
End Sub
Private Sub cmdStart_Click()
Merlin.Show
Merlin.MoveTo me.Left / 15 + picPicture.Left / _
15 + 120, me.Top / 15 + picPicture.Top / 15
Merlin.Speak "Hocus Pocus"
Merlin.Play "DoMagic1"
Set reqDisappear = Merlin.Play("DoMagic2")
End Sub
Private Sub Form_Load()
Agent1.Characters.Load "Merlin", MERLINPATH
Set Merlin = Agent1.Characters("Merlin")
End Sub
I hope you have enjoyed this tutorial. Please use the feedback form to send any comments about it to me.
If you would like to show your appreciation and support for The Agent LaunchPad, see the Thank me page.