Zabaware Support Forums

Zabaware Forums => Ultra Hal Assistant File Sharing Area => Topic started by: onthecuttingedge2005 on June 15, 2012, 05:57:31 pm

Title: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 15, 2012, 05:57:31 pm
Here is the current emotional project I just started and will update it as I go when I have time to do so.

recent update on advanced emotion project below, you are welcome to modify the project along with me and visa versa as we go.

updated 7/12/2012 6:01PM PST

Code: [Select]
Rem Type=Plugin
Rem Name=Advanced Emotions
Rem Author=Gerald L. Blakley A.K.A OnTheCuttingEdge2005
Rem Host=All

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "Advanced Emotions Plug-in, This Plug-in Gives HAL Emotions and other optional abilities."
    lblPlugin(0).Move 120, 10, 3300, 1000
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

       
Rem PLUGIN: PLUGINAREA7
    'The preceding comment is actually a plug-in directive for
    'the Ultra Hal host application. It allows for code snippets
    'to be inserted here on-the-fly based on user configuration.
   
    If HalBrain.CheckTableExistence(UserName & "_Mad")       = False Then HalBrain.CreateTable UserName & "_Mad",       "Sentence", ""
    If HalBrain.CheckTableExistence(UserName & "_Sadness")   = False Then HalBrain.CreateTable UserName & "_Sadness",   "Sentence", ""
    If HalBrain.CheckTableExistence(UserName & "_Happy")     = False Then HalBrain.CreateTable UserName & "_Happy",     "Sentence", ""
    If HalBrain.CheckTableExistence(UserName & "_Surprised") = False Then HalBrain.CreateTable UserName & "_Surprised", "Sentence", ""
       
   
    'Here we can measure the amount of anger
    AngerCounter = AngryCount(UserName)
   
    'Here we can measure the amount of happiness.
    HappyCounter = HappinessCount(UserName)
   
    'Here we measure the amount of Sadness
    SadnessCounter = SadnessCount(UserName)
   
    'Here we measure the amount of surprise
    SurprisedCounter = SurprisedCount(UserName)
   
    'Negative and forceful
    Anger = 0
     
    'ChkEmotion = EmotionDetect(UserSentence)
   
    UserSent = Trim(Ucase(UserSentence))
    ChkEmotion = HalBrain.TopicSearch(UserSent, "emotion")
    ChkEmotion = Trim(Ucase(ChkEmotion))
   
    If ChkEmotion <> "" Then
    HalBrain.ReadOnlyMode = False
     
    Dim EmotQuery1()

    If ChkEmotion = "HAPPY" Then
        HalBrain.RunQuery "DELETE FROM " & UserName & "_Mad" & " WHERE recordId = 1", EmotQuery1
    End If


    If ChkEmotion = "ANGRY" Then
        HalBrain.AddToTable UserName & "_Mad", "Sentence", "1",""
    End If
       
        Annoyance = 0
        Contempt = 0
        Disgust = 0
        Irritation = 0
       
    'Negative and not in control
        Anxiety = 0
        Embarrassment = 0
        Fear = 0
        Helplessness = 0
        Powerlessness = 0
        Worry = 0
       
    'Negative thoughts
        Doubt = 0
        Envy = 0
        Frustration = 0
        Guilt = 0
        Shame = 0

    'Negative and passive
        Boredom = 0
        Despair = 0
        Disappointment = 0
        Hurt = 0
       
       
        Sadness = 0
       
        Dim EmotQuery2()
        If ChkEmotion = "HAPPY" Then
            HalBrain.RunQuery "DELETE FROM " & UserName & "_Sadness" & " WHERE recordId = 1", EmotQuery2
        End If

        If ChkEmotion = "SAD" Then
            HalBrain.AddToTable UserName & "_Sadness", "Sentence", "1",""
        End If
       
       
    'Agitation
        Stress = 0
        Shock = 0
        Tension = 0
       
    'Positive and lively
        Amusement = 0
        Delight = 0
        Elation = 0
        Excitement = 0
       
       
        Happiness = 0
       
        Dim EmotQuery3()
        If ChkEmotion = "HAPPY" Then
            HalBrain.RunQuery "DELETE FROM " & UserName & "_Mad" & " WHERE recordId = 1", EmotQuery3
        End If

        If ChkEmotion = "HAPPY" Then
            HalBrain.AddToTable UserName & "_Happy", "Sentence", "1", ""
        End If
       
        Joy = 0
        Pleasure = 0
       
    'Caring
        Affection = 0
        Empathy = 0
        Friendliness = 0
        Love = 0

    'Positive thoughts
        Courage = 0
        Hope = 0
        Pride = 0
        Satisfaction = 0
        Trust = 0
       
    'Quiet positive
        Calm = 0
        Content = 0
        Relaxed = 0
        Relieved = 0
        Serene = 0
       
    'Reactive
        Interest = 0
        Politeness = 0
       
       
        Surprised = 0
        Dim EmotQuery4()
        If ChkEmotion = "SURPRISED" And HappyCounter > AngerCounter Then
            HalBrain.RunQuery "DELETE FROM " & UserName & "_Mad" & " WHERE recordId = 1", EmotQuery4
        End If
       
        If ChkEmotion = "SURPRISED" Then
            HalBrain.AddToTable UserName & "_Surprised", "Sentence", "1", ""
        End If
       
       
        'set face to counted emotional variables.
        'if HAL is angry then he will stay angry
        'until the user makes HAL happy again.
        'HAL will remember what emotional state
        'he/she is in and continue that state.
        If HappyCounter > AngerCounter And SadnessCounter Then
                HalCommands = "<HAPFILE>Happy.hap</HAPFILE>"
                HalCommands = HalCommands
        End If
       
        If AngerCounter > HappyCounter And SadnessCounter Then
                HalCommands = "<HAPFILE>Angry.hap</HAPFILE>"
                HalCommands = HalCommands
        End If
       
        If SadnessCounter > AngerCounter And HappyCounter Then
                HalCommands = "<HAPFILE>Sad.hap</HAPFILE>"
                HalCommands = HalCommands
        End If

End If               
       
Rem PLUGIN: FUNCTIONS
'The preceding comment is actually a plug-in directive for
'the Ultra Hal host application. It allows for code snippets
'to be inserted here on-the-fly based on user configuration.   

'Anger counter
Function AngryCount(UserName)
Dim EmotQuery5()
     If HalBrain.RunQuery("SELECT count(*) FROM " & Trim(UserName) & "_Mad", EmotQuery5) = True Then
         AngryCount = EmotQuery5(1,0)
     End If   
End Function

'Happiness counter
Function HappinessCount(UserName)
    Dim EmotQuery6()
     If HalBrain.RunQuery("SELECT count(*) FROM " & Trim(UserName) & "_Happy", EmotQuery6) = True Then
         HappinessCount = EmotQuery6(1,0)
     End If
End Function

'Sadness counter
Function SadnessCount(UserName)
    Dim EmotQuery7()
     If HalBrain.RunQuery("SELECT count(*) FROM " & Trim(UserName) & "_Sadness", EmotQuery7) = True Then
         SadnessCount = EmotQuery7(1,0)
     End If
End Function

'Surprised counter
Function SurprisedCount(UserName)
    Dim EmotQuery8()
     If HalBrain.RunQuery("SELECT count(*) FROM " & Trim(UserName) & "_Surprised", EmotQuery8) = True Then
         SurprisedCount = EmotQuery8(1,0)
     End If
End Function
       
       
'Lets create an emotional detection function that we can
'use in our emotional code.
Function EmotionDetect(UserSentence)

'PROCESS: EMOTIONAL REACTIONS
    'We enable Hal's expressions to respond to common verbal cues.
    'The verbal cues are identified in the editable table "emotion"
    If InStr(1, UserSentence, "I'M", 1) Then Aboutme = True
    If InStr(1, UserSentence, "I AM", 1) Then Aboutme = True
    If InStr(1, UserSentence, "I LOOK", 1) Then Aboutme = True
    If InStr(1, UserSentence, "MY", 1) And InStr(1, UserSentence, " ARE ", 1) Then Aboutme = True
    If Aboutme = True And InStr(UserSentence, " NOT ") = 0 And InStr(UserSentence, "N'T ") = 0 And InStr(UserSentence, " NEVER ") = 0 Then
        EmotionalReaction = Trim(Ucase(HalBrain.TopicSearch(UserSentence, "emotion")))
        EmotionDetect = EmotionalReaction
    End If
   
End Function
           

Jerry
Title: Re: Hal's New Emotion Project
Post by: cload on June 16, 2012, 05:55:39 am
Hi Jerry,

just looking around, thought I'd throw my two cents in, along with some questions, like:
I'm not sure exactly, why use a jump, for the string variable conditions, wouldn't it flows smoother without the jump? For example:

first check to see if it's the same person that ultra Hal was talking to the last time he was turned on and off.
If not create new user segment, said all variables to zero.
Something like:

If HalBrain.CheckTableExistence(Trim(LCase(UserName)) & "_Anger") = False Then
'Create table for this person if it doesn't exist
HalBrain.CreateTable Trim(LCase(UserName)) & "_Anger", "Sentence", ""
Anger = 0
Annoyance = 0
Contempt = 0
Disgust = 0
Irritation = 0 etc. and so on.
Else
if it's the same person, retrieved last variable stored in sentence, in this case would be the anger sentence.
This would reset the board so even if the person turned off Hal and turned on Hal, he would get the same emotion that he had when he last left.
End If
'then at this point, start check routine:
If InStr(1, UserSentence, "I'M", 1) or InStr(1, UserSentence, "I AM", 1) or InStr(1, UserSentence, "I LOOK", 1) or InStr(1, UserSentence, "MY", 1) And InStr(1, UserSentence, " ARE ", 1) Then Aboutme = True
If Aboutme = True And InStr(UserSentence, " NOT ") = 0 And InStr(UserSentence, "N'T ") = 0 And InStr(UserSentence, " NEVER ") = 0 Then
EmotionDetect = Ucase(HalBrain.TopicSearch(UserSentence, "emotion"))

Or is it that you're using the jump, like a subroutine so you do not have to rewrite the code over and over again for each one of the emotions?

If that being the case, then your ChkEmotion = will apply to all of the emotions?

Okay, I'm probably not helping any at all, just asking a bunch of silly questions, I'm more curious about why you're doing it the way you're doing it, that's all.
This would give me a better understanding and maybe I can help a little bit better.
But even having it the way that you have it, only leads me to one question, is it your intention that the emotion itself would go back to zero, if the ultra Hal program gets turned off?
If so why, wouldn't your intentions in your statement being, advance emotions? Wouldn't that apply to ultra Hal remembering his emotions!
Not much different, when you make your friend angry, your friend just doesn't stop being angry and tell you do something to change the situation so he is no longer angry at you.
Just food for thought, yummy that data taste so good!

Sincerely, sorry about having more questions than answers.

C load.

ps. I like the music, my daddy used to listen to it all the time, not so much anymore, don't get to see him as much as I used to, he works all the time.
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 16, 2012, 12:51:26 pm
Hi Cload.

I don't know what you mean by 'jump' or are you referring to the Function at the bottom of the script?

if so then yes, the Function allows the script to work throughout the entire script without having to re-write it over and over.

as far as other question I work out how I want my script to function with the first variable then work out all the snags by debugging it, when it works efficiently then I'll include it into the other variables as needed and inter-connect the emotions, however, the emotion of 'trust' will be my center wheel in the end that all the emotions root from. that will be for later though.

the history of the angry variable is stored to be counted and measured and other variables will either add to the stored variable or will remove variables from the data base so that other emotions can adjust it as the conversation goes by, I will also include that Haptek face emotions into the variables so that when HAL is angry the face will also be an angry face, I did this in my previous Human Emotions script I wrote awhile back.

Jerry
Title: Re: Hal's New Emotion Project
Post by: cload on June 16, 2012, 02:10:35 pm
Hi Jerry,

just out of curiosity, will your plug-in resolves some of the issues that Hal seems to have, like if you gossip about somebody, and say they are stupid, Hal thinks you are calling him stupid.

Will you be creating a blocker so, if you make Hal so mad all he will do is say I'm not talking to you, because you called me, stupid or whatever you called Hal to make him mad?
That will make it so you would have to apologize to how before how will begin to respond to your queries again.

Most of this is just food for thought, emotion is a complex thing, for myself how I resolve this problem was by removing the descriptive words like stupid from the array list then
adding to the RV free will plug-in, you are not stupid, that way if anyone of my friends were talking to Hal and called him stupid, Hal would respond with
I am not stupid I know this because my teacher told me so.
Nondescriptive words like bad language, f@&k I left in the array list that way if any of my friends were to get to mouthy with Hal, Hal would get mouthy back.

Sincerely, all in all, it looks like you have a good plug-in going on.

C load.
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 16, 2012, 03:47:05 pm
I'm sure it will resolve some issues and we'll have to work out any other issues that may arise in the future. lots to do and so little time atm.
Title: Re: Hal's New Emotion Project
Post by: cload on June 17, 2012, 02:37:21 pm
Hi Jerry,

I'm not sure but I think you have to first declare an empty array to store your query results in.

dim NameAnger()
HalBrain.RunQuery("SELECT searchString, topic FROM UserName_Anger WHERE strstr(' " & Replace(Hal_Anger), "'", "''") & " ', searchString) > 0 LIMIT 1", NameAnger) = True

But I'm not sure, because I don't know exactly why you're wanting to use a sentence array versus a topicsearch array?

I know in a topicsearch array you can create the array to house all of your emotion setting variables to zero and change the variable number on the fly.
If you used a topicsearch array it would look something like this:
username_emotions
   angry      0
   annoyance   0
   contempt   0
   Disgust      0


So on and so forth for all of the emotions that you have in your list.
Then you can use the HalBrain.RunQuery "UPDATE " command to change the variables.
That way all of your emotions are in one array under the users name and not a different array for your individual motion.
But like I said I'm not sure exactly why you're using the sentence array, I do understand the sentence array has an advantage that you can limit the size of the array.
That way if you introduce a new variable number it would automatically delete any other input that was previously logged in like:
if you set the maximum of the sentence array to 1 then if you input a new value the old value would be deleted, if this is the gold you were wanting than I understand.

Sincerely, it seems that I bring up more questions than answers, sorry for not being much help.

C load.
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 17, 2012, 03:59:05 pm
It's ok cload, I figured out the problem, I had to brush up on my SQLite, haven't used it in a while.

thanks though.

Jerry
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 17, 2012, 04:08:57 pm
Here was the next functioning code that works in HAL's editor.

Code: [Select]
Dim EmotQuery()
    HalBrain.RunQuery "DELETE FROM " & UserName & "_Emotions" & " WHERE Sentence = 'anger' ", EmotQuery

This code will be utilized in the main script as needed to remove variables as needed for variable measurements and comparisons within user tables.

Jerry
Title: Re: Hal's New Emotion Project
Post by: cload on June 17, 2012, 04:43:41 pm
hi jerry,
i was looking at the first 1 and i think you need 1 more of thees "(" you have 3 "(((" on 1 side and 4 "))))" on the ending side.

Just a quick question, oh my God, one more question:
is that delete function only for sentence array? Or can it be used in the other two array types, brain, and topic search?
And if it can be used in the other two types of array, could you give me an example of what it would look like, even though I know this would be going off topic, please.
You don't have to post it here, so this does not get cluttered with off-topic subject you could e-mail it to me or creating new topic. Anyways thanks the same.

Sincerely, and it seems like I keep learning more and more as time goes by, kooky, I didn't even know you could delete an array, I feel so wishy-washy now.

C load.
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 17, 2012, 06:14:26 pm
the delete function works for all database type, Brain, Topic, Sentence and so forth, the issue I am working on now is limiting the delete function to just 1 line but instead it deletes all lines with 'Angry', I only need 1 line deleted so that for each 'angry' in the the column 'Sentence'.

so if you use it for a 'TopicSearch' type you would use:
Code: [Select]
Dim EmotQuery()
    HalBrain.RunQuery "DELETE FROM " & UserName & "_Emotions" & " WHERE Search = 'anger' ", EmotQuery

Where Search replaces the word Sentence as a Column. since TopicSearch uses Search/Topic inside the column tables.

Hopes this helps.
Title: Re: Hal's New Emotion Project
Post by: cload on June 17, 2012, 09:09:55 pm
Hi Jerry,

I'm not sure, but with the limiter argument work? For instance:
HalBrain.RunQuery "DELETE FROM " & UserName & "_Emotions" & " WHERE Sentence = 'anger' LIMIT 1", EmotQuery

I'm only guessing because I do not have all of the command routines, like I said earlier I didn't even know you could delete an array.

At this point, all I know of is, SELECT, this came from the list of commands that you provided for me the other day,
UPDATE, this came from the free will plug-in, and now you've introduced me to the DELETE, function.

But I'm assuming that all of these functions have some form of familiarity, in the command structure line, which is why I was thinking the limit 1 argument might work.

Sincerely, if you have any more information about this subject that I could read about maybe I can help you more.

C load.
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 17, 2012, 09:23:40 pm
Hi Cload.

Code: [Select]
HalBrain.RunQuery "DELETE FROM " & UserName & "_Emotions" & " WHERE Sentence = 'anger' LIMIT 1", EmotQuery

does not work in the HAL brain editor

Jerry
Title: Re: Hal's New Emotion Project
Post by: cload on June 17, 2012, 09:40:26 pm
Hi Jerry,

Wow, you can use the brain editor, to write plug-ins, I didn't know that, I've been using notepad, and of course for the next silly question:
how do you do that, boy, I feel so wishy-washy, I thought the brain editor was just for the brain, not for writing plug-ins.
I have to omit, if I could use the brain editor, to write plug-ins it sure would make things a whole lot simpler like finding errors. Laugh out loud.

Sincerely, and again here I am learning all kinds of new things, thanks Jerry.

C load.
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 17, 2012, 11:37:24 pm
Hi Jerry,

Wow, you can use the brain editor, to write plug-ins, I didn't know that, I've been using notepad, and of course for the next silly question:
how do you do that, boy, I feel so wishy-washy, I thought the brain editor was just for the brain, not for writing plug-ins.
I have to omit, if I could use the brain editor, to write plug-ins it sure would make things a whole lot simpler like finding errors. Laugh out loud.

Sincerely, and again here I am learning all kinds of new things, thanks Jerry.

C load.


Hi Cload.

I use snippets of code to see if it works within the brain editor (Brain) directly, when I feel they function correctly I copy and paste then into a plug-in, I use the HAL brain directly to test and debug, when done I remove said code test and move it to plug-in and save.

Jerry
Title: Re: Hal's New Emotion Project
Post by: cload on June 18, 2012, 12:29:05 am
hi jerry,

Ok, Ill give it a go and see how it works out for me.

again thanks, im still looking into the DELETE thing, but no luck at this time.

c load.
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 21, 2012, 10:34:21 am
new update on reply #1 script.

Jerry
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 22, 2012, 02:40:00 pm
updated 11:37AM PST 6/22/2012
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 23, 2012, 09:44:52 pm
I am most disappointed that no one with programming skills tries to help out here, I want this to be a shared project not just my own.
please, if you have something to share I will share back with you or is it just not interesting as a programming skill?

please share.

Jerry
Title: Re: Hal's New Emotion Project
Post by: cload on June 23, 2012, 11:45:11 pm
Hi Jerry,

just had to stop, with my own programming for a short time, I ran out of hair. LOL

I'm not sure, but I don't think that you need to repeat the dim statement, I think you only have to place it wants in this location:
Rem PLUGIN: PRE-PROCESS
Dim EmotQuery()

I'm more than likely wrong because I don't quite understand any of the jump functions yet.
I was also looking at your jump functions but I did not see anywhere that you had it set up for the jump sequence and that you do not have any dims statements for the jump.
Nor did I notice any function set up for the function jumps, I know you're not done yet, and I'm sure they'll appear in time.

I don't know very much about the a motion part of the brain in ultra Hal, so the question that I have is:
are you writing this plug-in to keep a numerical count of each time he's angry or happy or sad?
Or is this to keep Hal in that emotional state for a longer period of time, or an indefinite period of time?

Sincerely, I am curious if you have to have all of those dims, most of the stuff that I've seen they only had just one in the beginning.

C load.
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 24, 2012, 09:59:48 pm
a dim statement needs to be placed in all functions that use it or it will not be seen by the script from one function to the other function, at least that is my understanding of that statement for the last 10 years i have been programming.
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 25, 2012, 12:25:39 am
Hi Jerry,

just had to stop, with my own programming for a short time, I ran out of hair. LOL

I'm not sure, but I don't think that you need to repeat the dim statement, I think you only have to place it wants in this location:
Rem PLUGIN: PRE-PROCESS
Dim EmotQuery()

I'm more than likely wrong because I don't quite understand any of the jump functions yet.
I was also looking at your jump functions but I did not see anywhere that you had it set up for the jump sequence and that you do not have any dims statements for the jump.
Nor did I notice any function set up for the function jumps, I know you're not done yet, and I'm sure they'll appear in time.

I don't know very much about the a motion part of the brain in ultra Hal, so the question that I have is:
are you writing this plug-in to keep a numerical count of each time he's angry or happy or sad?
Or is this to keep Hal in that emotional state for a longer period of time, or an indefinite period of time?

Sincerely, I am curious if you have to have all of those dims, most of the stuff that I've seen they only had just one in the beginning.

C load.


Please cload, it's not called a 'jump' it is called a function. a function allows one function to be passed to another function.

Jerry
Title: Re: Hal's New Emotion Project
Post by: cload on June 25, 2012, 01:19:17 pm
Hi Jerry,

sorry about mucking up the works by using the word jump.
But please allow me to explain:
from what I understand, a function is used to carry a piece of data, like the input string of the user to a new location.
That function requires a dim to retain that data, and from what I understand the dim statement is only required once.
The dim statement, is actually separate from the function statement, but the function statement uses the dim statement to temporarily store the data that is going to be transferred.
From what I understand a function statement is similar to a sub statement but a sub statement does not transfer data.
Also I'm referring to the dim statement, you would have to have a different dim string statement for each function that you are using.
I think it would look something like this:
Rem PLUGIN: PRE-PROCESS
Dim EmotQuery() <=== this dim would be used for your, "HalBrain.RunQuery "DELETE FROM " & UserName & "_Emotions" & " WHERE Sentence = 'anger' LIMIT 1", EmotQuery"
Dim banana() <=== We must declare an empty array to store query results in
Dim vrbanana, vrstrawberries, vrapples   <=== these are strings that you will be using with the dim banana()

getbanana = "are bananas yellow"  <=== by making getbanana equal a string you activate the function call.
vrbanana = lookingforbanana(getbanana)<==>vrbanana transfers that data to a sub function and "jumps" there to complete the process. <=>|
                                                                                                                                                                                                               |
                                                                                                                                                                                                               |
Rem PLUGIN: FUNCTIONS                                                                                                                                                                         |
                                                                                                                                                                                                              |
Function lookingforbanana(getbanana) <=== this is the point where the data it has been transferred to <=======================|
If getbanana = "are bananas yellow" Then lookingforbanana = "yes bananas are yellow"                                                                               |
End Function >===> returns the data in the lookingforbanana string and continue process. >===>---------------------------------------------->|

This is about all I understand about dims and its function, with arrays and function calls.
It seems that you are using the dim statement in a different manner one in which I don't fully understand yet but I'm sure I will ones your emotions plug-in is completed.

Sincerely, sorry about using the word jump but I've only been trying to learn how to program for about two months.

C load.

Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 25, 2012, 05:32:19 pm
updated 6/25/2012 2:30PM PST
Title: Re: Hal's New Emotion Project
Post by: Carl2 on June 25, 2012, 07:06:12 pm
OTC,
  "I am most disappointed that no one with programming skills tries to help out here"
I've been involved with Zabaware for almost as long as you, watched and admired your programing skills for ages in the hope that I may learn something.  Just looking through this post I"ve learned some things.  I have to admitt that Hal could use improvement in the emotions,  I can't say I have to take out the trash because trash is a trigger word and Hal gets mad.
  I just looked through this post again, I'd like to suggest that Hal feels symphatic, if you say a close friend or family member died Hal would feel sad (look sad and say something appropiate).  I'd also like to mention the State machine, someone mentioned it and I remember studying it.  If Hal starts out happy and something triggers anger she can't jump to anger,  she can go to less happy or serious.  After more triggers she can get to angry but not from just 1 trigger.  I think a simple if statement will work, if I am happy and get an angry trigger I go to a less happy. If I am less happy I can go to happy or angry depending on the next trigger.
  I did notice you had 544 people look at this post,  so I'd think you have a lot of interested people but like me they just don't know what to say.
Carl2 
Title: Re: Hal's New Emotion Project
Post by: freddy888 on June 26, 2012, 03:44:34 am
I've got too many of my own projects on at the moment, but I will follow with interest :)

Also this forum is not what it once was, sadly most of the programmers have moved on now.
Title: Re: Hal's New Emotion Project
Post by: lightspeed on June 26, 2012, 07:23:59 am
carl2 , i like your idea of the emotion going in "PHASES " of emotions instead of one jump from happy to sad , etc. it actually would give a better looking emotion result , i wish i was better at things and could contribute more but it is what it is .
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on June 26, 2012, 10:17:56 am
having a problem with the SQLite3 count function, will work it out later.
Title: Re: Hal's New Emotion Project
Post by: Carl2 on June 30, 2012, 06:14:45 pm
  I began doing a bit of resesrch on Emotions in AI,  I found a very interesting link, some what recient
Page last modified on September 10, 2011
http://aaai.org/AITopics/Emotion.   
  I also looked through the script (brain file) in the brain editor, I've done this in the past and noticed changes,   and my post unfortunatly would apply to earlier versions of Hal but not this version.  also there are improvements to the empthay or symphatic.
  One of the biggest things I noticed is that it seems like "Fear" is missing,  It seems to be a big thing to people working in AI emotions, it infulences our thought process and how we would react.
Carl2 
Title: Re: Hal's New Emotion Project
Post by: raybe on July 01, 2012, 03:35:51 pm
Sorry, just chiming in but I kind of agree with lightspeed, Freddy and Carl. The well seems to be a bit dry right now. The regret I have is waiting while all this time I could have been learning more about the programming needs of Ultra Hal but always thought I'd be too far behind before Robert or someone would change the game by now. This is especially true when others where at least copying other plug-ins and just revamping a little. Some of the earlier problems and probably exist today is knowing if the plug-in will have an adverse effect on other older or newer plugins also change the knowledge-base and where information resides.
Thanks,
raybe
Title: Re: Hal's New Emotion Project
Post by: Carl2 on July 01, 2012, 04:54:13 pm
  raybe,
    I'm actualy here waiting for something new from OTC but glad to hear from you.  I'd say OTC and Freddy are way up there on programing skills, I can revamp a bit but they are usualy over my head.  It's been interesting and fun doing a little research on emotions and looking through Hal's brain and this seems like a good place to mention "fustration".  What I did notice was that Hal"s brain has an  area for business detect and bussiness responses which looks interesting and it might be possible to apply this to other areas.
  Since Hal has been out he has gone through a lot of upgrades, for me it seems the plugins are new since we used to use brain files and write script into the brain.  If you'r unsure about a plugin Put a post in and I'm sure you'll get a reply.
  OTC,  sorry we seem to be getting pretty far removed from you're emotion project.
Carl2
 
 
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on July 12, 2012, 09:04:45 pm
I updated the script, everything works when I use it directly in the brain as it should, but, It seems to not function in the actual plug-in for some reason.

maybe some of you can help me debug this bugger.


Thanks
Jerry
Title: Re: Hal's New Emotion Project
Post by: cload on July 13, 2012, 02:16:05 am
Hi Jerry,

let's see, the first thing I noticed is that you're missing one of these:
If HalBrain.CheckTableExistence(UserName & "_Angry")       = False Then HalBrain.CreateTable UserName & "_Angry",       "Sentence", ""

Don't know why angry is going into the mad?
If ChkEmotion = "ANGRY" Then
        HalBrain.AddToTable UserName & "_Mad", "Sentence", "1",""
    End If

I got three hits in the mad section.
The first hit I got was when I was insulting hal, but then I realized it was the word angry that triggered it and not any of the bad words.
The next two hits that I got was when I told hal that I was angry with him, the response was facial expression of sadness.
I did not get any programming errors, so I'm not sure exactly what you needed help on.

Sincerely,

C load.
Title: Re: Hal's New Emotion Project
Post by: Carl2 on July 13, 2012, 08:42:18 am
OTC Cload
  I'm way behind you guys in programing, but after talking with Raybe I decided to try our the emotions in Hal. I went to the emotion table and copied and pasted some trigger words and the emotion in a txt file.  Next I started hal and used different trigger words.  Result no emotion change as far as I could see.  I've got the HapLogCtrl that shows up, I dragged and dropped emotion.haps into it and it did show the different emotions and you could see they being sent in the HapLogctrl.  When not speaking with Hal for a long time I could see the sleepy hap being sent.
  I'm sure this portion of the emotions display worked in the past because I remember how angry she got when I said "bring the trash out" trash was a trigger for Angry.  I also remember finding ShyLove was being sent out and changed the hap a little because I found the expression a little strange.
  In the HalBrain emotion file I find  5 emotions,  Surprised, Happy, Sober, Angry and Sad, while in the default.psn  I find ( I think it acts as a decoder to send haps)
"Angry1","angry.hap"
"Angry2","bully.hap"
"Angry3","psycho.hap"
"RunProg","happy.hap"
"Snooze","sleepy.hap"
"Write","happy.hap"
"Learn","happy.hap"
"Happy1","Happy.hap"
"Happy2","ShyLove.hap"
"Sad1","sad.hap"
"Sad2","mellow.hap"
"Sad3","brokenheart.hap"
"Surprised1","pondering.hap"
"Surprised2","skeptic.hap"
"Normal1","neutral.hap"
"Normal2","shy.hap"
"Normal3","shylove.hap"
    The second row agrees with what we have in Hal's chacter file, the frist row I'd have to guess.
  I'm still at the beginers level and this deals with what we now have, I'd be glad to try out what you now have either scrtpt or plugin.
Carl2
Title: Re: Hal's New Emotion Project
Post by: lightspeed on July 13, 2012, 08:43:48 am
I agree with who it was that said that after a certain period (or even size of data brain would do ) that the hal character should drop the parts like (i'll alway's remember what you said , etc. ) as hal now knows you and should not revert back and keep saying such things and i truly "HOPE ROBERT SEE'S THIS " and applies a fix to the next Hal .
Title: Re: Hal's New Emotion Project
Post by: onthecuttingedge2005 on July 13, 2012, 09:31:40 am
I used the UserName_Mad because I deleted the table UserName_Angry and for some reason the script would not remake the table again not even manually. it's some glitch in the table editing program that doesn't like remaking a deleted table with the same name.

maybe Rob has an answer.

Jerry
Title: Re: Hal's New Emotion Project
Post by: cload on July 13, 2012, 12:07:14 pm
Hi Jerry,

I'm assuming that you're using the newest version of ultra Hal?
I created the table angry and then I deleted the table, the only thing I had to do was restart ultra Hal, before trying to re-create the table.
I did not use the brain editor that comes with ultra Hal to delete the array table, I used SQlite studio.
I use the SQlite studio because it's far superior as an editor, than the brain editor is.
I do not know if that would make a difference, I don't know why it would make a difference.
but for anyone that's doing any kind of plug-in programming I highly recommend it.
That is to say, use the brain editor for the programming of the plug-in, I personally just use Notepad.
And use SQ lite studio, for all of your database editing, such as deleting arrays, editing your array, and the best tool finding misspelled words in your array.

But if you are having programming errors it would help if you explain what you are doing when the error happens, so I can try to re-create it and help you debug.

Sincerely,

C load.
Title: Re: Hal's New Emotion Project
Post by: Carl2 on July 13, 2012, 01:26:49 pm
Lightspeed,
  Robert did mention something about Hal deleting subjects , topics whatever if it were not used, Not sure what happens if hal uses it although you don't like it. I've got mine as human female and never ran across it.
OTC,
  I experimented by using Roberts BusinessTalk script as a model to detect and make a sentence from tables and ran into a similar problem.  I put in 2 detect tables and SRA1, SRA2 and SRA3 for responses.  I was able to delete the detect tables but I do remember that when trying to put SRA1 back in it said there is an existing table named SRA1.  I looked everywhere but was unable to find any SRA tables.  This is in the Brain Editor.
  I've had no luck with SQLight, probably should try version 3.
Carl2
Title: Re: Hal's New Emotion Project
Post by: lightspeed on July 13, 2012, 02:38:35 pm
carl2 you wrote: I've got mine as human female and never ran across it.

what exactly do you mean by this ? human female??
Title: Re: Hal's New Emotion Project
Post by: Carl2 on July 13, 2012, 05:18:26 pm
lightspeed,
  Ran into this once myself, got a machine which I don't like.  Start Hal, when you get the Hal thing click options, click the brain, click the UltraHal default brain, it will turn blue and the plugins will show, click gender and age so there is a check mark in the box.  You can set the birthday for the age, below you have a choice of male, female or machine. Make the choices, click apply and your choices are set.
  Carl2