Author Topic: EMOTIONS  (Read 5682 times)

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
EMOTIONS
« on: June 08, 2004, 08:12:29 am »
I am Begining A NEW emotions script. [:D]

This script will also contribute to RELEVENCY processing of the final OUTPUT from the GETRESPONSE funtion. IT will ALSO display HAL's CURRENT EMOTION VIA a HAPTEK .HAP file or MSAGENT animation. [8)]

WHICH MOODS Shall I ADD, As I havent GOT into THE HAPTEK CHAR PROGmming YET.

I WAS ONLY GOING TO PUT EMOTIONS THAT HAVE HAP files or CURENTLY BUILT .BRN scripts..

ie: happiness, sadness, fun ETC.[^]

I am not GOOD with MSAGENT SCRIPTING IN VB so any contributions in DISPlaying ANIMS with MSAGENT in VB would be APPRECIATED.[8D]

i am Going to POST A SAMPLE of WHERE IM AT so far.... [;)]

If anyone WOULD LIKE TO HELP or COLLABERATE over EMAIL...
IM THERE ...


spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
EMOTIONS
« Reply #1 on: June 08, 2004, 08:14:06 am »


Download Attachment: default EMOTIONS SCRIPT.uhp
8.95 KB

'-----------------------------------------------------------------------------------------------
'SPYDAZ EMOTIONS SCRIPT DEVLOPMENT ENVIRONMENT
'-----------------------------------------------------------------------------------------------
'These emotional scripts are to give HAL more choice and emotions,
'by building scripts and logical operations around Each EMOTIONS CASE
'we can have more control over HALS personality. HALS emotions are also Tied to
' HALS HAPTEK DISPLAY MOOD SCRIPT to give it authenticity. WE MAY ALSO BLOCK the GETRESPONSE
' IF HAL IS ANGRY or INSULTED or ETC.. and GIVE AN ANGRYRESPONSE, FUNNYRESPONSE etc..




'================================ PRE PROCESS ==================================

'Initialize Variables
DISPLAY_Emotion = ""
 
'positive EMOTIONS    
 
 If SURPRISED = "" Then SURPRISED = 0
 If HAPPY = "" Then HAPPY = 0

'EMOTIONS RANDOMIZER            
Spinwheel = Int(Rnd * 100)

'negative EMOTIONS
 If ANGRY = "" Then ANGRY = 0
 If SAD = "" Then SAD = 0

'PROCESS SET TO CENTER  
'HERE WE SET HALS EMOTION TO NORMAL
'HALemotion = NORMAL







'================================   PROCESS ==================================

'detect EMOTIONS1

'PROCESS USERSENTENCE FOR AN EMOTIONAL TRIGGER
EmotionalReaction = HalBrain.TopicSearch(UserSentence, WorkingDir & "Emotion.brn")

Select Case EmotionalReaction
      Case "SURPRISED"
      HapFile = "Skeptic.hap"
         
      Case "HAPPY"
      HapFile = "Happy.hap"   
      
      Case "ANGRY"
      HapFile = "Angry.hap"
         
      Case "SAD"
      HapFile = "Sad.hap"
         
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  
'-----------------------------------------------------------------------------------------------

'-----------------------------------------------------------------------------------------------
' rand emotions 2

'PROCESS: EMOTIONAL STATE
If HALemotion = "" THEN

 'POSITIVE EMOTIONS
  Select Case POSITIVEemotion
      
       Case "SURPRISED"
              HapFile = "Skeptic.hap"

       Case "HAPPY"
                HapFile = "Happy.hap"
  End Select


 'NEGATIVE EMOTIONS
  Select Case NEGATIVEemotion
      
       Case "ANGRY"
                HapFile = "Angry.hap"

       Case "SAD"
                HapFile = "Sad.hap"
  End Select


 'randomize emotion
   FEELING = Spinwheel
   IF FEELING > 50 THEN HALemotion = POSITIVEemotion
   IF FEELING < 50 THEN HALemotion = NEGATIVEemotion  
   DebugInfo = DebugInfo & "A FEELING has triggered the emotion of " & HALemotion & VbCrLf

EmotionalReaction = HALemotion
DISPLAY_Emotion = HALemotion

HalCommands = "<HAPFILE>" & HapFile & "</HAPFILE>"

End If
'-----------------------------------------------------------------------------------------------






'================================ RESPONDS ==================================


'BASIC EMOTIONAL RESPONSES
'------------------------------
' these are the basic responds to the user STATEMENT about an emotion
'here hal DETECTS emotional chat and respond acordingly.




'------------------------------------------------------------------
'Happiness
'------------------------------------------------------------------
'sAVE user happy statement
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "DETECTHappY.brn") = "TRUE" Then
AnswerSent = "" & Trim(OriginalSentence)
HalBrain.AppendFile WorkingDir & "STATEMENTHappY" & ".brn", AnswerSent
End If

'RESPOND HAPPY
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "DETECTHappY.brn") = "TRUE" Then
HappyRESPONSE = HalBrain.ChooseSentenceFromFile(WorkingDir & "STATEMENTHappY.brn")

GetResponse = HappyRESPONSE & VbCrLf
DISPLAY_Emotion = HAPPY
HALemotion = DISPLAY_Emotion
HalCommands = "<HAPFILE>" & HapFile & "</HAPFILE>"

'DEBUG
DebugInfo = DebugInfo & "The user is talking about Happiness: " & HappyRESPONSE & VbCrLf
Else
DebugInfo = DebugInfo & "Hal has found nothing about Happiness: " & HappyRESPONSE & VbCrLf
End If
'------------------------------------------------------------------


'------------------------------------------------------------------
'SADness
'------------------------------------------------------------------
'sAVE user SAD statement
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "DETECTSAD.brn") = "TRUE" Then
AnswerSent = "" & Trim(OriginalSentence)
HalBrain.AppendFile WorkingDir & "STATEMENTSAD" & ".brn", AnswerSent
End If

'RESPOND SAD
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "DETECTSAD.brn") = "TRUE" Then
HappyRESPONSE = HalBrain.ChooseSentenceFromFile(WorkingDir & "STATEMENTSAD.brn")

GetResponse = SADRESPONSE & VbCrLf
DISPLAY_Emotion = SAD
HALemotion = DISPLAY_Emotion
HalCommands = "<HAPFILE>" & HapFile & "</HAPFILE>"

'DEBUG
DebugInfo = DebugInfo & "The user is talking about SADness: " & SADRESPONSE & VbCrLf
Else
DebugInfo = DebugInfo & "Hal has found nothing about SADness: " & SADRESPONSE & VbCrLf
End If
'------------------------------------------------------------------


'------------------------------------------------------------------
'SURPRISED
'------------------------------------------------------------------
'sAVE user SURPRISED statement
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "DETECTSURPRISED.brn") = "TRUE" Then
AnswerSent = "" & Trim(OriginalSentence)
HalBrain.AppendFile WorkingDir & "STATEMENTSURPRISED" & ".brn", AnswerSent
End If

'RESPOND SURPRISED
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "DETECTSURPRISED.brn") = "TRUE" Then
HappyRESPONSE = HalBrain.ChooseSentenceFromFile(WorkingDir & "STATEMENTSURPRISED.brn")

GetResponse = SURPRISEDRESPONSE & VbCrLf
DISPLAY_Emotion = SURPRISED
HALemotion = DISPLAY_Emotion
HalCommands = "<HAPFILE>" & HapFile & "</HAPFILE>"

'DEBUG
DebugInfo = DebugInfo & "The user is talking about SURPRISED: " & SURPRISEDRESPONSE & VbCrLf
Else
DebugInfo = DebugInfo & "Hal has found nothing about SURPRISED: " & SURPRISEDRESPONSE & VbCrLf
End If
'------------------------------------------------------------------


'------------------------------------------------------------------
'ANGRY
'------------------------------------------------------------------
'sAVE user ANGRY statement
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "DETECTANGRY.brn") = "TRUE" Then
AnswerSent = "" & Trim(OriginalSentence)
HalBrain.AppendFile WorkingDir & "STATEMENTANGRY" & ".brn", AnswerSent
End If

'RESPOND ANGRY
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "DETECTANGRY.brn") = "TRUE" Then
HappyRESPONSE = HalBrain.ChooseSentenceFromFile(WorkingDir & "STATEMENTANGRY.brn")

GetResponse = ANGRYRESPONSE & VbCrLf
DISPLAY_Emotion = ANGRY
HALemotion = DISPLAY_Emotion
HalCommands = "<HAPFILE>" & HapFile & "</HAPFILE>"

'DEBUG
DebugInfo = DebugInfo & "The user is talking about ANGRY: " & ANGRYRESPONSE & VbCrLf
Else
DebugInfo = DebugInfo & "Hal has found nothing about ANGRY: " & ANGRYRESPONSE & VbCrLf
End If
'------------------------------------------------------------------














'================================ POST  PROCESS ==================================
'--------------------------------------------------
'POST PROCESS: DISPLAY_Emotion
'--------------------------------------------------
'This function temporarily alters Hal's Haptek character's displayed emotion for a few seconds
'after each response.

DISPLAY_Emotion = HALemotion

If DISPLAY_Emotion <> "" Then

   Select Case DISPLAY_Emotion
      Case "ANGRY"
         HapFile = "Angry.hap"
      Case "HAPPY"
         HapFile = "Happy.hap"
      Case "SAD"
         HapFile = "Sad.hap"
      Case "SURPRISED"
         HapFile = "Skeptic.hap"
      Case Else  
   End Select
   HalCommands = "<HAPFILE>" & HapFile & "</HAPFILE>"
   DISPLAY_Emotion = ""

End If
'--------------------------------------------------
 




'-----------------------------------------------------------------------------------------------
'END OF SPYDAZ EMOTIONS SCRIPT DEVLOPMENT ENVIRONMENT
'-----------------------------------------------------------------------------------------------


C06alt

  • Newbie
  • *
  • Posts: 7
    • View Profile
EMOTIONS
« Reply #2 on: June 10, 2004, 01:07:37 am »
will try it

on the subject of emotion i noticed hal goes through
emotions in this order

SURPRISED
HAPPY
ANGRY
SAD

its not hard to edit the brainfile so that
hal (if you insult him)
will end up in an angry mode and stay there.
this leads to some quite funny abuse sessions

as it stands you get about 2 or 3 verbal retaliations
from hal and then he goes into sulk mode.

gj spydaz

This will come in handy for tuning my
data's emotions.
Its not always apperent when a humor has changed
if your using subtle changes such as androids
have.
 

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
EMOTIONS
« Reply #3 on: June 10, 2004, 06:06:09 pm »
Im Have Finished A WORKING version. OF the Emotional Brain.

I will Be Uploading LATER.

1. version XTF brain + MY Xtra bRAINFILES
2. version HAL5 Brain + My Xtra Brainfiles.

BOTH ALSO HAVE the UPDATED TOPIC SCRIPTS. These scripts are for FOCUSING Hal Onto YOUR Own Personal topics. Although i have taken out the SAVE scripts for NOW.. as the VONSMITH XTF brain SAVES new data + does well in the CROSS REFERENCING dept. Therefore HIS STATIC topic STAY STATIC. I use the save scripts to CAPTURE / LEARN information.

Both of these brains have been tested and "too many files" A THING OF THE PAST. BUT some times "a blank expression" Only IF the current subject that you are talking about is totally NEW.

IVE JUST GOT SOME ZIPPING TO DO....

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
EMOTIONS
« Reply #4 on: June 10, 2004, 07:06:35 pm »
THESE are the extra BRN files NEEDED to operate the BRAINS Just drop them Into THE DEFBRAIN folder THAT YOU CHOOSE to USE. RENAME DEFBRAIN FOLDER in the .UHP to match ...

Download Attachment: XbrainZ.zip
157.3 KB [:D]



Download Attachment: uhp.zip
113.38 KB [:D]

IN THIS UHP ZIP is BOTH versions XTF & hal5 .. I FIND that Both brains should always have there own respective FOLDERS. AS sometimmes Scripts and BRN Files can crash you UP..[8]

HAVE A GO anyway.... [B)]

ITs nice to have the FACE EXpressions MATCH with the CONVERSATION...[8D]