82
« on: July 19, 2005, 04:24:37 pm »
ncluded: ZabaReadme, Default psn, Emotion brn, DetectTestEmotions
I am using this In the XTF brn With Haptek Sandy and it seems to be working without problems.
The script should detect a trigger word which is located in the emotion brn
from the user or from Hals response and send the Hap file to be displayed.
The original hal5.uhp or hal5_XTF_v1.2 should be saved by making a copy in another folder.
I'd suggest doing the following work in the Brain editor, it's simply a mater of copy and paste.
Detect Emotions1
put in at line 4048 of the XTF uhp using the dopy and paste method
A portion of the script used for debugging has been copied from line 851
Line 851, 852, and 853 must be made nonfunctional by inserting a '
before the text, this should make the line turn green in the Brain Editor.
Again this for the XTF uhp
The existing emotion brn which is located in the DefBrain folder should be moved To the
folder created for the original hal uhp and the new emotion brn should be put in the
DefBrain folder. The emotion brn can be opened in notepad or you can Use the Brain Editor
Tools, Emotional Topics, Emotional Reactions to make any changes. There is a problem with the varity of names used and The names used in the emotion brn are the one which are looked for
to display emotions to make everything work be sure the hap files have the same names. The trigger word is located to the left and the emotion is on the right.
BrokenHeart is BrokenHearted, Pondering is PonderingMysteries, rename the hap files to agree
with the names in the emotion brn. Later versions of the Haptek Player show more emotion than
the Hal display, I did not see any difference from netural to Happy. I opened the happy hap
in notepad and increased the MouthHappy to 3.9000.
Copy this script
'================================ PROCESS ==================================
'detect EMOTIONS1
'Emotion.brn
'PROCESS USERSENTENCE FOR AN EMOTIONAL TRIGGER
'Emotion.brn
' HalBrain.TopicSearch
'* EmotionalReaction = HalBrain.TopicSearch(PrevSent, WorkingDir & "Emotion.brn")
'* EmotionalReaction = HalBrain.TopicSearch(PrevUserSent, WorkingDir & "Emotion.brn")
'* EmotionalReaction = HalBrain.TopicSearch(GetResponse, WorkingDir & "Emotion.brn")
'* EmotionalReaction = (UserSentence & "Emotion.brn")
'* EmotionalReaction = HalBrain.TopicSearch(OriginalSentence, WorkingDir & "Emotion.brn")
'*InStr
'* EmotionalReaction = HalBrain.TopicSearch(PrevSent, WorkingDir & "Emotion.brn")
'* EmotionalReaction = HalBrain.TopicSearch(PrevUserSent, WorkingDir & "Emotion.brn")
'* EmotionalReaction = HalBrain.TopicSearch(GetResponse, WorkingDir & "Emotion.brn")
'* EmotionalReaction = (UserSentence & "Emotion.brn")
'* EmotionalReaction = HalBrain.TopicSearch(OriginalSentence, WorkingDir & "Emotion.brn")
EmotionalReaction = HalBrain.TopicSearch(PrevSent, WorkingDir & "Emotion.brn")
EmotionalReaction = HalBrain.TopicSearch(GetResponse, WorkingDir & "Emotion.brn")
EmotionalReaction = Halbrain.TopicSearch(UserSentence, WorkingDir & "Emotion.brn")
Select Case EmotionalReaction
Case "Angry"
HalCommands = "<HAPFILE>Angry.hap</HAPFILE>"
Case "Brokenhearted"
HalCommands = "<HAPFILE>BrokenHearted.hap</HAPFILE>"
Case "Bully"
HalCommands = "<HAPFILE>Bully.hap</HAPFILE>"
Case "Calm"
HalCommands = "<HAPFILE>Calm.hap</HAPFILE>"
Case "EaterOfBugs"
HalCommands = "<HAPFILE>EaterOfBugs.hap</HAPFILE>"
Case "HAPPY"
HalCommands = "<HAPFILE>Happy.hap</HAPFILE>"
Case "Mellow"
HalCommands = "<HAPFILE>Mellow.hap</HAPFILE>"
Case "Neutral"
HalCommands = "<HAPFILE>Neutral.hap</HAPFILE>"
Case "NewMood"
HalCommands = "<HAPFILE>NewMood.hap</HAPFILE>"
Case "New_Mood"
HalCommands = "<HAPFILE>New_Mood.hap</HAPFILE>"
Case "PonderingMysteries"
HalCommands = "<HAPFILE>PonderingMysteries.hap</HAPFILE>"
Case "Physco"
HalCommands = "<HAPFILE>Psycho.hap</HAPFILE>"
Case "SAD"
HalCommands = "<HAPFILE>Sad.hap</HAPFILE>"
Case "Shy"
HalCommands = "<HAPFILE>Shy.hap</HAPFILE>"
Case "Shylove"
HalCommands = "<HAPFILE>Shylove.hap</HAPFILE>"
Case "Skeptic"
HalCommands = "<HAPFILE>Skeptic.hap</HAPFILE>"
Case "Sleepy"
HalCommands = "<HAPFILE>Sleepy.hap</HAPFILE>"
End Select
If EmotionalReaction <> "" And DebugMode = True Then
DebugInfo = DebugInfo & "A word in the user's sentence has triggered the emotion of " & EmotionalReaction & VbCrLf
HALemotion = EmotionalReaction
DISPLAY_Emotion = HALemotion
HalCommands = "<HAPFILE>" & HapFile & "</HAPFILE>"
End If
'TROUBLESHOOTING
'The following code is used to troubleshoot facial expressions.
If InStr(UserSentence, " ANGRYMODE ") > 0 Then
HalCommands = "<HAPFILE>Angry.hap</HAPFILE>"
GetResponse = "Angry mode set" & VbCrLf
ElseIf InStr(UserSentence, " BROKENHEARTEDMODE ") > 0 Then
HalCommands = "<HAPFILE>BrokenHearted.hap</HAPFILE>"
GetResponse = "Broken hearted mode set." & VbCrLf
ElseIf InStr(UserSentence, " BULLYMODE ") > 0 Then
HalCommands = "<HAPFILE>Bully.hap</HAPFILE>"
GetResponse = "Bully mode set." & VbCrLf
ElseIf InStr(UserSentence, " CALMMODE ") > 0 Then
HalCommands = "<HAPFILE>Calm.hap</HAPFILE>"
GetResponse = "Calm mode set." & VbCrLf
ElseIf InStr(UserSentence, " HAPPYMODE ") > 0 Then
HalCommands = "<HAPFILE>Happy.hap</HAPFILE>"
GetResponse = "Happy mode set." & VbCrLf
ElseIf InStr(UserSentence, " MELLOWMODE ") > 0 Then
HalCommands = "<HAPFILE>Mellow.hap</HAPFILE>"
GetResponse = "Mellow mode set." & VbCrLf
ElseIf InStr(UserSentence, " NEUTRALMODE ") > 0 Then
HalCommands = "<HAPFILE>Neutral.hap</HAPFILE>"
GetResponse = "Neutral mode set." & VbCrLf
ElseIf InStr(UserSentence, " PONDERINGMODE ") > 0 Then
HalCommands = "<HAPFILE>PonderingMysteries.hap</HAPFILE>"
GetResponse = "Pondering mode set." & VbCrLf
ElseIf InStr(UserSentence, " PSYCHOMODE ") > 0 Then
HalCommands = "<HAPFILE>Psycho.hap</HAPFILE>"
GetResponse = "Psycho mode set." & VbCrLf
ElseIf InStr(UserSentence, " SADMODE ") > 0 Then
HalCommands = "<HAPFILE>Sad.hap</HAPFILE>"
GetResponse = "Sad mode set." & VbCrLf
ElseIf InStr(UserSentence, " SHYMODE ") > 0 Then
HalCommands = "<HAPFILE>Shy.hap</HAPFILE>"
GetResponse = "Shy mode set." & VbCrLf
ElseIf InStr(UserSentence, " SHYLOVEMODE ") > 0 Then
HalCommands = "<HAPFILE>ShyLove.hap</HAPFILE>"
GetResponse = "Shy and in love mode set." & VbCrLf
ElseIf InStr(UserSentence, " SKEPTICMODE ") > 0 Then
HalCommands = "<HAPFILE>Skeptic.hap</HAPFILE>"
GetResponse = "Skeptic mode set." & VbCrLf
ElseIf InStr(UserSentence, " SLEEPYMODE ") > 0 Then
HalCommands = "<HAPFILE>Sleepy.hap</HAPFILE>"
GetResponse = "Sleepy mode set." & VbCrLf
ElseIf InStr(UserSentence, " SILLYMODE1 ") > 0 Then
HalCommands = "<HAPFILE>XTF_SillyFace1.hap</HAPFILE>"
GetResponse = "Silly mode set." & VbCrLf
ElseIf InStr(UserSentence, " SILLYMODE2 ") > 0 Then
HalCommands = "<HAPFILE>XTF_SillyFace2.hap</HAPFILE>"
GetResponse = "Silly mode set." & VbCrLf
ElseIf InStr(UserSentence, " SILLYMODE3 ") > 0 Then
HalCommands = "<HAPFILE>XTF_SillyFace3.hap</HAPFILE>"
GetResponse = "Silly mode set." & VbCrLf
End If
'Drop this emotion into your defbrain folder.
End
This is emotion brn
"angry","Angry"
"mad","Angry"
"I'm leaving","BrokenHearted"
"Your terrible","BrokenHearted"
"get him","Bully"
"it's okay","Calm"
"just relax","Calm"
"try to relax","Calm"
"your wild","EaterOfBugs"
"fixed","Happy"
"great","Happy"
"it works","Happy"
"nice of you","Happy"
"your right","Happy"
"your welcome","Happy"
"you win","Happy"
"you won","Happy"
"nice and relaxing","Mellow"
"just okay","Neutral"
"serious","Neutral"
"This is new","NewMood"
"Interesting","New_Mood"
"do you know","PonderingMysteries"
"What do you think","PonderingMysteries"
"remember","PonderingMysteries"
"Thats crazy","Psycho"
"died","Sad"
"got hurt","Sad"
"it broke","Sad"
"it's broken","Sad"
"dosen't work","Sad"
"mistake","Sad"
"that's wrong","Sad"
"Unforutnate","Sad"
"Very sick","Sad"
"bare","Shy"
"naked","Shy"
"undressed","Shy"
"alone together","Shylove"
"romantic","Shylove"
"don't know","Skeptic"
"not sure","Skeptic"
"late","Sleepy"
"time for bed","Sleepy"
"tired","Sleepy"
"silly","SillyFace1"
This is the default psn
"Angry","angry"
"BrokenHearted","BrokenHearted"
"Bully","Bully"
"Calm","Calm"
"EaterofBugs","EaterOfBugs"
"Happy","Happy"
"Mellow","Mellow"
"Netural","Netural"
"New_Mood","New_Mood"
"NewMood","NewMood"
"PonderingMysteries","PonderingMysteries"
"Psycho","Psycho"
"Sad","Sad"
"Shy","Shy"
"ShyLove","ShyLove"
"Skeptic","Skeptic"
"Sleepy","Sleepy"
Hope I can get this posted
Carl2