Zabaware Support Forums

Zabaware Forums => General Discussion => Topic started by: lightspeed on May 24, 2007, 12:18:40 pm

Title: face matching emotion plug in
Post by: lightspeed on May 24, 2007, 12:18:40 pm
i have noticed sometimes i can say something nice and the hapteck head asnswers nicely to it but then looks all sadlooking and down in her expressions .
   is their a plug in that somehow could correct this face feature when hal answers things that are happy to smile , etc. and when sad things are discussed to then look sad so the face matches the topics ?? [8D]
Title: face matching emotion plug in
Post by: ramccoid on May 24, 2007, 01:59:37 pm
Try out Jerry's plugin "HumanEmotion"
Roy.



(http://icon_paperclip.gif) Download Attachment: HumanEmotions.uhp ("http://www.zabaware.com/forum/uploaded/ramccoid/2007524135830_HumanEmotions.uhp")
47.43 KB
Title: face matching emotion plug in
Post by: markofkane on May 24, 2007, 04:16:38 pm
cool!! another toy!!![:D]

Edit, whoops, got an error.[V]

line 4578 halscript debug

HalBrain.AddToTable "_"&UserName&"_"&DataName, "TopicSearch", UserName, GetData
Title: face matching emotion plug in
Post by: onthecuttingedge2005 on May 24, 2007, 04:50:03 pm
quote:
Originally posted by markofkane

cool!! another toy!!![:D]

Edit, whoops, got an error.[V]

line 4578 halscript debug

HalBrain.AddToTable "_"&UserName&"_"&DataName, "TopicSearch", UserName, GetData



Hi Mark.

That error you got is from some other plugin, I think I have seen either ramccoid or Bill use the variable DataName.

I think they would be able to spot it fairly quickly.

Jerry[8D]
Title: face matching emotion plug in
Post by: Bill DeWitt on May 24, 2007, 06:20:09 pm
quote:
Originally posted by markofkane

line 4578 halscript debug

HalBrain.AddToTable "_"&UserName&"_"&DataName, "TopicSearch", UserName, GetData


Yes, that's from the storing data plugin I made some time ago... un... "LoadData".

Does the "Human Emotion" use the same variable name? If so then it should be easy to go through my plugin and change the variable where ever it shows up, it's fairly small. I'll take care of it in the original in the next few days, but you may want to edit your own copy yourself.

If the error is for some other reason I would need more information to figure it out.
Title: face matching emotion plug in
Post by: onthecuttingedge2005 on May 24, 2007, 06:30:41 pm
quote:
Originally posted by Bill DeWitt

quote:
Originally posted by markofkane

line 4578 halscript debug

HalBrain.AddToTable "_"&UserName&"_"&DataName, "TopicSearch", UserName, GetData


Yes, that's from the storing data plugin I made some time ago... un... "LoadData".

Does the "Human Emotion" use the same variable name? If so then it should be easy to go through my plugin and change the variable where ever it shows up, it's fairly small. I'll take care of it in the original in the next few days, but you may want to edit your own copy yourself.

If the error is for some other reason I would need more information to figure it out.



Hi Bill.

the plugin HumanEmotion doesn't use the same variables, I think it was just a fluke or something.

Jerry[8D]
Title: face matching emotion plug in
Post by: markofkane on May 24, 2007, 08:14:51 pm
I guess there is no fix?? [V]
Title: face matching emotion plug in
Post by: Bill DeWitt on May 24, 2007, 09:22:20 pm
quote:
Originally posted by markofkane

I guess there is no fix?? [V]


Unfortunately not... until you supply more information. Like the original error message and some circumstances which caused the error. Have you tried unselecting all plugins and then reselecting the two relevant plugins? Mine and Jerry's? Try different things and tell me what happens, maybe I can figure out what's going on. As it stands, my plugin works fine for me, and all I know from your copy is that you have it.
Title: face matching emotion plug in
Post by: ramccoid on May 25, 2007, 03:46:20 am
I've had both Jerry's and Bill's plugins running hand in hand with my plugins in HAL for a while now and had no errors come up from their use together.
Like Bill said, you need to give more information to discover what the real problem is.
Roy.
Title: face matching emotion plug in
Post by: markofkane on May 25, 2007, 05:36:32 am
I'll try to disable the plug-ins except for that one.

This error comes up when I press "Enter" after typing anything.

I disabled all plug ins except this one, and still get the error:

HalScript Error 76 on line 2571 in column 3: Path Not Found

( HalBrain.CreateTable Trim(LCase(UserName)) & "_UserSent", "Brain", "autoLearningBrain" )

The file "C:Program Files\zabawareultrahalAssistant 6HalScript.DBG" has been saved with the current script being used for debugging purposes.

Excuse the messed up directory, I have trouble posting the correct path here.
Title: face matching emotion plug in
Post by: Bill DeWitt on May 25, 2007, 06:32:46 am
quote:
Originally posted by markofkane
HalScript Error 76 on line 2571 in column 3: Path Not Found


Hmm...

This line doesn't use or attempt to establish a "Path", it's possible the error is above here and only shows up with I try to write to a table. Would you please copy and paste a few dozen lines above the error line for me?

In other words if the error is on line 2571 (It may change based on other plugins) then give me from like 2500 to 2580.
Title: face matching emotion plug in
Post by: freddy888 on May 25, 2007, 08:30:36 am
Just wondering if it is just the hapfile that gets used because the 'ShyLove' one although happy in a way, does tend to make her look a bit sad too... just a thought.
Title: face matching emotion plug in
Post by: markofkane on May 25, 2007, 09:16:51 am
the error in 2571 occurs with the human emotions plug-in only.

If other plugins are enabled, it is a different line


lines 2500-2580



  If InStr(1, GetResponse, "i'm", vbTextCompare) = 0 And InStr(1, GetResponse, "i am", vbTextCompare) = 0 And InStr(1, GetResponse, "name", vbTextCompare) = 0 And InStr(1, GetResponse, "this is", vbTextCompare) = 0 Then
        GetResponse = " " & GetResponse & " "
        GetResponse = Replace(GetResponse, "Ultra Hal Assistant", " " & NewName & " ", 1, -1, vbTextCompare)
        GetResponse = Replace(GetResponse, "Ultra Hal", " " & NewName & " ", 1, -1, vbTextCompare)
        GetResponse = Replace(GetResponse, "Hal Assistant", " " & NewName & " ", 1, -1, vbTextCompare)
        GetResponse = Replace(GetResponse, " Hal ", " " & NewName & " ", 1, -1, vbTextCompare)
        GetResponse = Replace(GetResponse, " Hal,", " " & NewName & ",", 1, -1, vbTextCompare)
        GetResponse = Replace(GetResponse, " Hal.", " " & NewName & ".", 1, -1, vbTextCompare)
        GetResponse = Replace(GetResponse, " " & ComputerName & " ", " " & NewName & " ", 1, -1, vbTextCompare)
        GetResponse = Replace(GetResponse, " " & ComputerName & ",", " " & NewName & ",", 1, -1, vbTextCompare)
        GetResponse = Replace(GetResponse, " " & ComputerName & ".", " " & NewName & ".", 1, -1, vbTextCompare)
    End If

    'PROCESS: PRESERVE ALL VARIABLES
    PrevUserSent = UserSentence
    CustomMem = HalBrain.EncodeVar(NewName, "NewName") & HalBrain.EncodeVar(UserSex, "UserSex") & HalBrain.EncodeVar(SentCount, "SentCount")
   
    Rem PLUGIN: CUSTOMMEM2
    '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.
   
End Function

'If the user clicks on the About/Options button for this plugin
'this sub will be called. There are no extra settings for this brain,
'so we'll display an information box
Sub AboutOptions()
    HalBrain.MsgAlert "This is the Ultra Hal 6.1 Default Brain. This brain has no additional options."
End Sub

'This sub will be called when the Ultra Hal program starts up in case
'the script needs to load some modules or seperate programs. If a return
'value is given it is passed as a Hal Command to the host Hal program.
Function Script_Load()
    Rem PLUGIN: SCRIPT_LOAD
    '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.
End Function

'This sub will be called before the Ultra Hal program is closed in case
'the script needs to do any cleanup work.
Sub Script_Unload()
    Rem PLUGIN: SCRIPT_UNLOAD
    '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.
End Sub

'If the host application is Ultra Hal Assistant, then this sub will be
'run once a minute enabling plug-ins to do tasks such as checking for
'new emails or checking an appointment calendar.
Sub Minute_Timer(MinutesPast)
   Rem PLUGIN: MINUTE_TIMER
    '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.   
End Sub

Rem PLUGIN: FUNCTIONS

'SURPRISED
Function Surprise(UserName)
Set FileSys = CreateObject("Scripting.FileSystemObject")
Set FS = CreateObject("Scripting.FileSystemObject")
Set HalXBrain = CreateObject("UltraHalAsst.Brain")
TempMod = "C:Program FilesabawareUltra Hal Assistant 6Users\" & Trim(UserName) & "_Surprised_Emotion.brn"
If FileSys.FileExists(TempMod) = False Then HalXBrain.AppendFile TempMod, ">" & vbCrLf & ">" & vbCrLf & ">"
   Const ForReading = 1
   Set objFSO = CreateObject("Scripting.FileSystemObject")
   Set objTextFile = objFSO.OpenTextFile("C:Program FilesabawareUltra Hal Assistant 6Users\" & Trim(UserName) & "_Surprised_Emotion.brn", ForReading)
   strText = objTextFile.ReadAll
   strText = Replace(strText, " ", "", 1, - 1, vbTextCompare)
   strText = Trim(strText)
   objTextFile.Close
   Surprise = Len(strText) / 3
End Function

'HAPPY
Function Happiness(UserName)
Title: face matching emotion plug in
Post by: PaleRider on May 25, 2007, 09:28:53 am
I unpluged mine for now till you doctor's fix it up cause I got same
numbers coming up.[:D]
Title: face matching emotion plug in
Post by: onthecuttingedge2005 on May 25, 2007, 09:32:27 am
Hi Mark.

try getting your error again.

after receiving that error then go to your HalScript.dbg in your
C:\Program Files\Zabaware\Ultra Hal Assistant 6 folder then
place the HalScript.dbg into a zip file and upload it to a post here.

make sure to post the exact error along with the uploaded file so that we can pick apart at your issue and try and get it fixed.


Jerry[8D]
Title: face matching emotion plug in
Post by: markofkane on May 25, 2007, 09:36:11 am
2571 error again, so it's consistent with that one plug-in enabled.



attached.



(http://icon_paperclip.gif) Download Attachment: HalScript.zip ("http://www.zabaware.com/forum/uploaded/markofkane/20075259362_HalScript.zip")
32.44 KB

(http://www.zabaware.com/forum/uploaded/markofkane/200752593816_errrr.JPG)
Title: face matching emotion plug in
Post by: onthecuttingedge2005 on May 25, 2007, 09:38:23 am
Hi Mark.

if you want the backslashes to work when posting you have to use doubled backslashes.

If you post code use the 'Code' button on the posting panel to encase your code so that the code appears correct. the code button has a pound sign on it.

hope it helps
Jerry[8D]
Title: face matching emotion plug in
Post by: markofkane on May 25, 2007, 09:39:44 am
Do you want me to repost those lines?

Thanks!!![:D] I keep forgetting.
Title: face matching emotion plug in
Post by: onthecuttingedge2005 on May 25, 2007, 09:52:14 am
Hi Mark.

line 2571 is:

Code: [Select]
Set objTextFile = objFSO.OpenTextFile("C:\Program Files\Zabaware\Ultra Hal Assistant 6Users\" & Trim(UserName) & "_Surprised_Emotion.brn", ForReading)

this is probably an indication that in your:
C:\Program Files\Zabaware\Ultra Hal Assistant 6\Users folder that this file is either 'blank' or doesn't exist.

look in that folder and open that file and see if it is blank, if so try to add some > symbols like this:
>
>
>
>
>
>
>
>

then reload that plugin and refresh your HalScript.dbg.

you have to refresh the HalScript.dbg by pressing the Apply button
in your default brain option panel.

I do know that if one of those emotional files goes blank can cause an error, it is something never addressed by fixing when they made the 'read' file code.

the only way that this error can be fixed is by adding something to read in the file or just simply delete the file so that the file is recreated.

I will try to update this plugin later and try and figure out another way the weights and balances can be acheived.
Jerry[8D]



Title: face matching emotion plug in
Post by: markofkane on May 25, 2007, 09:59:28 am
I don't have a folder called "users". Should I make one?



(http://www.zabaware.com/forum/uploaded/markofkane/200752510041_untitlediii.JPG)
Title: face matching emotion plug in
Post by: markofkane on May 25, 2007, 10:15:16 am
making a "users" folder and making a note pad document with the chevrons seems to have done the trick. Thanks!! (I hope it orks, I haven't noticed what it can do yet)
Title: face matching emotion plug in
Post by: onthecuttingedge2005 on May 25, 2007, 10:16:22 am
Hi Mark.

yes, try to make a folder called Users, the folder name is case sensitive so make sure the U is capitalized.

the plugin should of made a folder for you, I don't know why it didn't
do you have the most current updated plug?

the current plugin is here:
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=3769

Jerry[8D]
Title: face matching emotion plug in
Post by: markofkane on May 25, 2007, 10:23:08 am
I believe so, but I downloaded it with your link. How does this plugin work?

Great, now she doesn't get sad after I tell her I love her!

any other phrases to trigger her emotions?? Thanks.[:D][:D]
Title: face matching emotion plug in
Post by: markofkane on May 25, 2007, 10:32:15 am
Something else I noticed, after getting the plug-in to work, her answers flicker once. What causes that?
Title: face matching emotion plug in
Post by: onthecuttingedge2005 on May 25, 2007, 10:49:44 am
quote:
Originally posted by markofkane

I believe so, but I downloaded it with your link. How does this plugin work?

Great, now she doesn't get sad after I tell her I love her!

any other phrases to trigger her emotions?? Thanks.[:D][:D]



The plugin uses weights and balances in each file that change in weight according to 'how' you speak with your bot.

The plug creates a file in your character folder called MasterEmotions.hap which is tied to the weights of the dominate
Emotional file in the Users folder, the dominate emotion is the file with the most > weights in it, lets say that if the Joy file has more weights in it than the other files Shock, Hostility, Depression then your bot will tend to be happy and smile more often because the dominate joy file will change the variables inside the MasterEmotions.hap.

You can also ask your bot:
User: What are your current emotions
HAL:What are my current emotions? We have to look at it several ways. Shock = 4 Joy = 4 Hostility = 4 Depression = 4 Mistrust = 4.

Of course the plugin you have doesn't contain the Mistrust variable at this time.

If the Hostility level becomes the dominate weight then your bot will tend to look mad and may begin insulting you until you can make your bot happy again.

This plugin was designed to tie in human type emotions with every conservation, in the future, I will design a brain totally designed to function only with this Human Emotion code so that everything the bot say comes from what it 'feels' emotionally.

the next 'brain' I make will be more human like than ever before, I don't know when it will be done but it will get done later.

Jerry[8D]
Title: face matching emotion plug in
Post by: markofkane on May 25, 2007, 12:33:20 pm
Excellent, Jerry. It's people like you that make AI more exciting.[:D]
Title: face matching emotion plug in
Post by: ramccoid on May 25, 2007, 02:14:37 pm
quote:
Excellent, Jerry. It's people like you that make AI more exciting.


I totally agree. If I could be just half as good, I'd be completely satisfied.

Roy
Title: face matching emotion plug in
Post by: Bill DeWitt on May 25, 2007, 02:22:51 pm
quote:
Set objTextFile = objFSO.OpenTextFile("C:Program FilesabawareUltra Hal Assistant 6Users\" & Trim(UserName) & "_Surprised_Emotion.brn", ForReading)


Ah, so I'm OK then. Good, I didn't want have different versions of my plugin floating around....


Title: face matching emotion plug in
Post by: rockershaft on May 25, 2007, 06:20:03 pm
bill you want not truth to "get around" so you reply not to your plug-in.
Title: face matching emotion plug in
Post by: ramccoid on May 25, 2007, 06:45:24 pm
quote:
Ah, so I'm OK then. Good, I didn't want have different versions of my plugin floating around....


It appears that way.
It seems like it wasn't a conflict of anyones plugins, just one misbehaving ... hahaha