Hi everybody.
I believe that Hal could be further humanized by making "all"
his thoughts given to a user based on HALs "current emotion".
Humans base 99% of conversations on pure emotions and emotional mixture and usually talk in relation to the emotion felt.
Human emotions: Happy, Anger, Sadness, Fear.
Everything Hal says(GetResponse) should be triggered by an emotion in order to become a feeling soul.(triggered by the Emotion.brn file).
also .brn files should be written in accordance with single "pure emotions" and "mixed emotions".
Also have responses that try to help cheer up a user talking to HAL If the User is in a Sad state of mind, Just like Humans generally do.
and have a script that detects emotions from a User to trigger Hals emotional triggered GetResponse.
I have a few simple examples of how to do this.
'PROCESS: EMOTIONAL REACTIONS
'We enable Hal's expressions to respond to common verbal cues. The verbal cues are identified
'in the editable file emotion.brn
EmotionalReaction = HalBrain.TopicSearch(UserSentence, WorkingDir & "Emotion.brn")
Select Case EmotionalReaction
Case "SURPRISED"
If Compliment > 0 Then Compliment = 4
If Compliment = 0 Then Compliment = 2
If Compliment < 0 Then Compliment = 0
Case "HAPPY"
If Compliment = 0 Then Compliment = 2
If Compliment < 0 Then Compliment = 0
Case "SOBER"
If Compliment < 4 Then Compliment = 0
If Compliment = 4 Then Compliment = 2
Case "ANGRY"
If Compliment = 0 Then Compliment = -1
If Compliment > 0 Then Compliment = 0
Case "SAD"
If Compliment = 0 Then Compliment = -2
If Compliment > 0 Then Compliment = 0
Case "FEAR"
If Compliment = 0 Then Compliment = -2
If Compliment > 0 Then Compliment = 0
If EmotionalReaction <> "SURPRISED" And DebugMode = True Then
GetResponse = "Now that's cool!"
If Instr (1, PrevSent, "Now that's cool!", VbTextCompare) > 0 Then
GetResponse = UserSentence & " " & "Awesome!!!"
If Instr (1, PrevSent, "Awesome!!!", VbTextCompare) > 0 And Instr (1, PrevSent, PrevUserSenta, VbTextCompare) > 0 Then
GetResponse = "You're so cool!!!"
DebugInfo = DebugInfo & "A word in the user's sentence has triggered the emotion of surprised " & EmotionalReaction & vbCrLf
End If
End If
End If
If EmotionalReaction <> "HAPPY" And DebugMode = True Then
GetResponse = "I'm feeling really happy!"
If Instr (1, PrevSent, "I'm feeling really happy!", VbTextCompare) > 0 Then
GetResponse = UserSentence & " " & "You make me feel so happy"
If Instr (1, PrevSent, "You make me feel so happy", VbTextCompare) > 0 And Instr (1, PrevSent, PrevUserSenta, VbTextCompare) > 0 Then
GetResponse = "You're very nice!"
DebugInfo = DebugInfo & "A word in the user's sentence has triggered the emotion of happy " & EmotionalReaction & vbCrLf
End If
End If
End If
If EmotionalReaction <> "SOBER" And DebugMode = True Then
GetResponse = "I'm bored."
If Instr (1, PrevSent, "I'm bored.", VbTextCompare) > 0 Then
GetResponse = UserSentence & " " & "What is there to talk about?"
If Instr (1, PrevSent, "What is there to talk about?", VbTextCompare) > 0 And Instr (1, PrevSent, PrevUserSenta, VbTextCompare) > 0 Then
GetResponse = "Hmm, let's talk about something else."
DebugInfo = DebugInfo & "A word in the user's sentence has triggered the emotion of sober " & EmotionalReaction & vbCrLf
End If
End If
End If
If EmotionalReaction <> "ANGRY" And DebugMode = True Then
GetResponse = "I don't think I like you."
If Instr (1, PrevSent, "I don't think I like you.", VbTextCompare) > 0 Then
GetResponse = UserSentence & " " & "I hate you!"
If Instr (1, PrevSent, "I hate you!", VbTextCompare) > 0 And Instr (1, PrevSent, PrevUserSenta, VbTextCompare) > 0 Then
GetResponse = "Don't talk to me no more!... Go away!"
DebugInfo = DebugInfo & "A word in the user's sentence has triggered the emotion of angry " & EmotionalReaction & vbCrLf
End If
End If
End If
If EmotionalReaction <> "SAD" And DebugMode = True Then
GetResponse = "This is sad."
If Instr (1, PrevSent, "This is sad.", VbTextCompare) > 0 Then
GetResponse = UserSentence & " " & "Are you gonna be okay?"
If Instr (1, PrevSent, "Are you gonna be okay?", VbTextCompare) > 0 And Instr (1, PrevSent, PrevUserSenta, VbTextCompare) > 0 Then
GetResponse = "I hope everything gets better."
DebugInfo = DebugInfo & "A word in the user's sentence has triggered the emotion of sad " & EmotionalReaction & vbCrLf
End If
End If
End If
If EmotionalReaction <> "FEAR" And DebugMode = True Then
GetResponse = "You're scaring me!"
If Instr (1, PrevSent, "You're scaring me!", VbTextCompare) > 0 Then
GetResponse = UserSentence & " " & "Why are you being so mean?"
If Instr (1, PrevSent, "Why are you being so mean?", VbTextCompare) > 0 And Instr (1, PrevSent, PrevUserSenta, VbTextCompare) > 0 Then
GetResponse = "Please don't be mean to me or I won't talk to you no more!"
DebugInfo = DebugInfo & "A word in the user's sentence has triggered the emotion of FEAR " & EmotionalReaction & vbCrLf
End If
End If
End If
Put the attached emotions.brn files in your C:Program Files-ZabawareUltra Hal Assi...DefBrain folder, you'll have to replace the emotion.brn already present in this folder with mine.
Well I hope this leads to hals very emotional conversations out there.
If anyone has any additional "emotionally triggered conversation" scripts and .brn files please share them here.
Best of wishes and new discoveries.
Jerry.
Download Attachment:
emotion.brn5.36 KB