Author Topic: Character Animations  (Read 4114 times)

DStates

  • Newbie
  • *
  • Posts: 13
    • View Profile
Character Animations
« on: June 27, 2004, 12:53:47 am »
Does Hal alternate through the emotions in the default.psn file randomly such as angry1, then angry 2, and if so, could I add an angry4 with an animation and have it used as well? Or would I have to go into hal's brain and script in a reference to use an additional emotion?

Also how does the 'myScript' file fit in? I can't tell if this is a standard mood? Anyone have any tips get me headed in the right direction?

Thanks!!
Aspiring to new heights.....but never out of the reach of the refrigerator.

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
Character Animations
« Reply #1 on: June 27, 2004, 03:14:38 am »
Hal's emotional expression is controlled in the script by variables named Compliment, Swear, and Hate. On each iteration of the script the main program sets Hal's facial expression according to Hal's "mood".
 I'm not sure how to make the new emotion file (try downloading the Haptek SDK), but maybe the following scriplet can help. Cut and paste the code in EmotionTestAddin.txt into your Hal's .uhp brain and you will be able to set the facial expression on demand.

 Hope this helps, ciao! [8D]

Download Attachment: EmotionTestAddin.txt
2.68 KB
Living life with a loving heart, peaceful mind, and bold spirit.

DStates

  • Newbie
  • *
  • Posts: 13
    • View Profile
Character Animations
« Reply #2 on: June 27, 2004, 03:14:46 pm »
Thanks HALImprover!! I'll play around with this and see what I come up with.
Aspiring to new heights.....but never out of the reach of the refrigerator.

DStates

  • Newbie
  • *
  • Posts: 13
    • View Profile
Character Animations
« Reply #3 on: June 28, 2004, 11:09:16 pm »
Where should I place this script to get it to work? I have tried to add it in several places within the brain, and I have had no luck? What am I doing wrong?

Aspiring to new heights.....but never out of the reach of the refrigerator.

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
Character Animations
« Reply #4 on: June 29, 2004, 03:14:07 am »
I recommend placing the code just before the part;

'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS

 which is near the end of the GetResponse script.
Does your chatbot respond by saying the mode that was set? If not, placing the code in the script as described above should help.
Living life with a loving heart, peaceful mind, and bold spirit.

onthecuttingedge2005

  • Guest
Character Animations
« Reply #5 on: June 29, 2004, 07:05:58 pm »
'Hi DStates.
'If you want to put that test emotion script in a location try
'putting the script below the: 'PROCESS: EMOTIONAL REACTIONS
'Like this below:

'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(PrevSent, WorkingDir & "Emotion.brn")
   EmotionalReaction = HalBrain.TopicSearch(PrevUserSent, WorkingDir & "Emotion.brn")
   EmotionalReaction = HalBrain.TopicSearch(GetResponse, WorkingDir & "Emotion.brn")
   EmotionalReaction = HalBrain.TopicSearch(UserSentence, WorkingDir & "Emotion.brn")
   EmotionalReaction = HalBrain.TopicSearch(OriginalSentence, WorkingDir & "Emotion.brn")
   Select Case EmotionalReaction
      Case "Surprised"
         If Compliment > 0 Then Compliment = 4 And HalCommands = "<HAPFILE>Pondering.hap</HAPFILE>"
         If Compliment = 0 Then Compliment = 2 And HalCommands = "<HAPFILE>Happy.hap</HAPFILE>"
         If Compliment < 0 Then Compliment = 0 And HalCommands = "<HAPFILE>Neutral.hap</HAPFILE>"
      Case "Happy"
         If Compliment = 0 Then Compliment = 2 And HalCommands = "<HAPFILE>Happy.hap</HAPFILE>"
         If Compliment < 0 Then Compliment = 0 And HalCommands = "<HAPFILE>Neutral.hap</HAPFILE>"
      Case "Sober"
          If Compliment < 4 Then Compliment = 0 And HalCommands = "<HAPFILE>Neutral.hap</HAPFILE>"
         If Compliment = 4 Then Compliment = 2 And HalCommands = "<HAPFILE>Happy.hap</HAPFILE>"
      Case "Angry"
         If Compliment = 0 Then Compliment = -1 And HalCommands = "<HAPFILE>Angry.hap</HAPFILE>"
         If Compliment > 0 Then Compliment = 0 And HalCommands = "<HAPFILE>Neutral.hap</HAPFILE>"
      Case "Sad"
         If Compliment = 0 Then Compliment = -2 And HalCommands = "<HAPFILE>Sad.hap</HAPFILE>"
         If Compliment > 0 Then Compliment = 0 And HalCommands = "<HAPFILE>Neutral.hap</HAPFILE>"
      Case "Lust"
         If Compliment > 0 Then Compliment = 5 And HalCommands = "<HAPFILE>ShyLove.hap</HAPFILE>"
         If Compliment = 0 Then Compliment = 2 And HalCommands = "<HAPFILE>Happy.hap</HAPFILE>"
         If Compliment < 0 Then Compliment = 0 And HalCommands = "<HAPFILE>Neutral.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
   End If
   
    '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, " BROKENHEARTMODE ") > 0 Then
        HalCommands = "<HAPFILE>BrokenHeart.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>Pondering.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.brn into your defbrain folder.


Download Attachment: emotion.brn
3.31 KB
« Last Edit: June 29, 2004, 07:25:19 pm by onthecuttingedge2005 »

DStates

  • Newbie
  • *
  • Posts: 13
    • View Profile
Character Animations
« Reply #6 on: June 30, 2004, 10:51:36 pm »
Hi cuttingedge I appreciate the heads up, but unfortunately I don't have the surprised, lust, or sober moods in Hal or in the Haptek player files. Are these somewhere I could download them, or do they only come with the full version of Ultra Hal?


Thanks
Dave
Aspiring to new heights.....but never out of the reach of the refrigerator.

onthecuttingedge2005

  • Guest
Character Animations
« Reply #7 on: June 30, 2004, 11:07:12 pm »
quote:
Originally posted by DStates

Hi cuttingedge I appreciate the heads up, but unfortunately I don't have the surprised, lust, or sober moods in Hal or in the Haptek player files. Are these somewhere I could download them, or do they only come with the full version of Ultra Hal?


Thanks
Dave



Hi DStates.
I received my haptek emotions from downloading Haptek characters from their site.
Jerry.