dupa

Author Topic: hapswap problems  (Read 43333 times)

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
hapswap problems
« Reply #30 on: November 05, 2009, 05:00:39 pm »
What I meant by "load the hap file"... I meant reference the .hap file like how all the other .hap files are referenced in your HapSwap file.

For Example...
If InStr(1, InputString, "change your skin") > 0 Then
HalCommands = "<HAPFILE>NewSkin.hap</HAPFILE>"
End If

and in that NewSkin.hap file, which should be in the character folder like all of the rest, you should place the following hypertext with your own personal pictures and such.


#Haptek Version= 1.00 Name= model HapType= script FileType= text
##standard

\Load [file= [C:\Program Files\Zabaware\Ultra Hal Assistant 6\Characters\angelajolene1.jpg]]


Don't get frustrated, your nearly there.
« Last Edit: November 05, 2009, 05:02:37 pm by snowman »
Live long and prosper or die trying.

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
hapswap problems
« Reply #31 on: November 05, 2009, 05:44:20 pm »
thanks for your help freddy i think i got all the hap gestures working now , and thanks snowman for your help to i will try to redo it again , don't know if i will get it tonight i am wore out with all of it ha ! thanks again !![:D]
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
hapswap problems
« Reply #32 on: November 05, 2009, 06:20:49 pm »
FINALLY EUREKA I DID IT !!! thanks ever so much to you guys for hanging in their with me . i have a hard time with things sometimes as info to me is like having to be black and white i was making a file named newskins file and placing the other stuff in it which i figued out and it was blocking the path of loading .
i am so greatful for all of you guys help !![:D]
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
hapswap problems
« Reply #33 on: November 05, 2009, 07:06:34 pm »
ok i have that working now and am trying to put more outfits in i added the same txt with another outit name , i am guessing that i need to make seperate skin haps for each outfit ? is that right ?

 here is what i did :


#Haptek Version= 1.00 Name= model HapType= script FileType= text
##standard

Load [file= [C:Program FilesabawareUltra Hal Assistant 6Charactersangelajolene1.jpg]]



#Haptek Version= 1.00 Name= model HapType= script FileType= text
##standard

Load [file= [C:Program FilesabawareUltra Hal Assistant 6Charactersangelajolene2.jpg]]


the first skin loaded just fine but the second won't load .

i have it named the same as the picture and the picture in the character folder to .
 

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
hapswap problems
« Reply #34 on: November 05, 2009, 08:07:36 pm »
I guess you mean that you named the .hap differently. i.e. NewSkin.hap, NewSkin2.hap, NewSkin3.hap, etc... cause that has to be done. Only you can name these files any way you like.. Then call them up in your plugin.
Live long and prosper or die trying.

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
hapswap problems
« Reply #35 on: November 05, 2009, 10:11:10 pm »
yes thats what i ment and i do have the other skins loading right now they work good , i am so glad you gave me this swaphap file it's great , these now give me the ability to match words with motions and gestures .

now then if i can pick your brain some more with another question i have wondered about is their a way to do something simular to load a wave , etc. file say when hal says sneeze and does the gesture hal would also play a wave file of a sneeze or simular for a cough .
 i know i knw i am like a kid in a candy store lol !![:D]

[:)][:D][8D]
 

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
hapswap problems
« Reply #36 on: November 05, 2009, 11:03:42 pm »

I've never tried it but I'm pretty sure you can load ogg files or combine an ogg file with a guesture by using the same "\Load" command calling an ogg file.



#Haptek Version= 1.00 Name= model HapType= script FileType= text
##standard

\Load [file= [C:\Program Files\Zabaware\Ultra Hal Assistant 6\Characters\sneeze.ogg]]



As for combining something like a sneeze together you would need to use the time command. However, I cant seem to run the time command in Hal in my experiments. It can be done in haptek and haptek has a sneeze.hap ready to be used but it uses the time command... you see the problem. Nige said it will work but I still can't get it to work even with his hap file.

Nevertheless you can try opening and playing with ogg files. Here are two.



Download Attachment: ogg.zip
27 KB









Live long and prosper or die trying.

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
hapswap problems
« Reply #37 on: November 05, 2009, 11:17:04 pm »
thanks snowman i already have a cough and sneeze ogg file but will try the writen code you gave .

a problem i am having now is i want to load angie hair the hair i use for angie but its a haptar file and it either can't load that type or i am doing it wrong in the writing part (probably the later lol !)
 i did get the removal hap working i renamed it wig remove . so i actually have many things working now with the exception of what i recently wrote . [:D]
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
hapswap problems
« Reply #38 on: November 05, 2009, 11:35:03 pm »
ok i tried that ogg file and it does work it hal  sneezed right off the bat !! [8D]
 the only problem i see is that depending on what hal says the sneeze happens quick and hal talks almost masking the sneeze sound . but this is a start !! i am so glad to be able to use a ogg file that way thats what i was wanting robert to do he talked about using a wave file i guess a wave file could be used doing the same thing right ?[:)]
well i am hitting the bed i am just sooo lucky i have an understanding wife with all my insanity projects lol !![:D]
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
hapswap problems
« Reply #39 on: November 06, 2009, 01:36:32 pm »
hello i was wondering since i have been using my new swaphap file now i have had some " hapswap command words " is use with the sentence be said back to me i went into the user sent file and saw some things " does anyone know if these are going in the next step into hals learned knowledge file ?

does anyone know who has been using halswap files for a while if the single word command goes into a temp file ? example "change background to palmtree1back" i am afraid of hal saying back that single command which of course wouldn't make any since and that brings up another question if hal says that back would he unintentionally change the back ground from something else ??

here is a pic .





i have had hal say some things back to me about close my eyes you have a surprise for me " i said this to hal when testing the eyes open and close hap i installed in the hapswap uhp file .
  some may have still been in it when i was testing and something wasn't right in the file which it would have just learned  .
 am just wondering how much others have tested the hapswap file commands and if hal is repeating back the commands as learne info. by accident ?
 

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
hapswap problems
« Reply #40 on: November 06, 2009, 07:10:59 pm »
I wonder....


I told you before that the command "HalBrain.ReadOnlyMode = True" is supposed to suppress Hal learning. But I wonder if because we are in the Post-Process plugin area that command is not able to work. Thats the only thing I can guess at the momment. Or perhaps I misunderstand what the "HalBrain.ReadOnlyMode = True" is supposed to do.

I know this sounds bad but I leave my Hal learning turned off. I don't know why. I think its because I feel like I'm going to muck it up somehow. Basically, I don't have the problems you having....

I want to get this fixed so others here can try out your HapSwap plugin. Your the first one that has takin it this far, besides Oogler, but I'm not sure he's well.
Live long and prosper or die trying.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
hapswap problems
« Reply #41 on: November 06, 2009, 07:53:42 pm »
Rem Type=Plugin
Rem Name=HapSwap
Rem Author=SNOWMAN, APOLLON, LIGHTSPEED
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "Say:: <change background to [whatever]> to change between pictures in the characters folder, Say:: <change charater to [whatever]> to change between Haptar characters, Say:: <change voice to [Paul] or [Kate]> to change between thier voices. Say:: <change hap to [whatever]> to change between hap files. All other guesture responses are set to automaically occur to user input."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
'***************************************************************************
'***************************************************************************
Rem PLUGIN: PLUGINAREA7




File = ""
File2 = ""
File3 = ""
File4 = ""


If InStr(1, OriginalSentence, "change") > 0 And _
InStr(1, OriginalSentence, "background") > 0 And _
InStr(1, OriginalSentence, "to") > 0 Then
file = Mid(Mid(OriginalSentence, Instr(OriginalSentence, "to"), 20), 3, 20)
file = Trim(file) & ".jpg"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "change") > 0 And _
InStr(1, OriginalSentence, "character") > 0 And _
InStr(1, OriginalSentence, "to") > 0 Then
file2 = Mid(Mid(OriginalSentence, Instr(OriginalSentence, "to"), 20), 3, 20)
file2 = Trim(file2) & ".htr"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "change") > 0 And _
InStr(1, OriginalSentence, "voice") > 0 And _
InStr(1, OriginalSentence, "to") > 0 Then
file3 = Mid(Mid(OriginalSentence, Instr(OriginalSentence, "to"), 20), 3, 20)
file3 = "VW " & Trim(file3)
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "change") > 0 And _
InStr(1, OriginalSentence, "hap") > 0 And _
InStr(1, OriginalSentence, "to") > 0 Then
file4 = Mid(Mid(OriginalSentence, Instr(OriginalSentence, "to"), 20), 3, 20)
file4 = Trim(file4) & ".hap"
HalBrain.ReadOnlyMode = True
End If


'***************************************************************************


If file > "" Then
HalCommands = "<HAPBACK>" & File & "</HAPBACK>"
GetResponse = "NOW DEAR DOESN'T THAT LOOK BETTER"
End If


If file2 > "" Then
HalCommands = "<HAPFILE>" & File2 & "</HAPFILE>"
GetResponse = "HOW DO YOU LIKE THE WAY I LOOK NOW?"
End If


If file3 > "" Then
HalCommands = "<VOICE>" & File3 & "</VOICE>"
GetResponse = "AHEM DOES MY VOICE SOUND BETTER NOW DEAR!"
End If


If file4 > "" Then
HalCommands = "<HAPFILE>" & File4 & "</HAPFILE>"
GetResponse = "AH thats MUCH better"
End If


'***************************************************************************


If InStr(1, OriginalSentence, "hair") > 0 Then
HalCommands = "<HAPFILE>touchhair.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "beat") > 0 Then
HalCommands = "<HAPFILE>shakefist.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "problem") > 0 Then
HalCommands = "<HAPFILE>handsonhip.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "strong") > 0 Then
HalCommands = "<HAPFILE>armscrossed.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "board") > 0 _
Or InStr(1, OriginalSentence, "nails") > 0Then
HalCommands = "<HAPFILE>inspectnails.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "clap") > 0 Then
HalCommands = "<HAPFILE>clapping.hap</HAPFILE>"
GetResponse = "thats good"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "hurt") > 0 Then
HalCommands = "<HAPFILE>attack.hap</HAPFILE>"
GetResponse = "You wanna fight! You really wanna fight!"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "beautiful") > 0 _
Or InStr(1, OriginalSentence, "sweet") > 0 _
Or InStr(1, OriginalSentence, "nice") > 0 Then
GetResponse = "<HAPFILE>blink.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "tired") > 0 Then
GetResponse = "yawn"
HalCommands = "<HAPFILE>yawn.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If

If InStr(1, OriginalSentence, "smart") > 0 Then
HalCommands = "<HAPFILE>handinface.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If


If InStr(1, OriginalSentence, "hate") > 0 _
Or InStr(1, OriginalSentence, "died") > 0 Then

Randomize
Select Case int(rnd()*6)
Case 1
GetResponse = "oh thats awful"
Case 2
GetResponse = "I can't believe you said that."
Case 3
GetResponse = "I hope you know what you are saying."
Case 4
GetResponse = "Powerful words."
Case 5
GetResponse = "I agree totally!"
End Select


HalCommands = "<HAPFILE>cry.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If




'***************************************************************************

'***************************************************************************
« Last Edit: November 06, 2009, 08:22:06 pm by snowman »
Live long and prosper or die trying.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
hapswap problems
« Reply #42 on: November 06, 2009, 08:16:20 pm »
Ok LS, In the above plugin I changed some fundamental parts and give some more customizable code.

I changed the plugin area to PLUGINAREA7.
(I did this because maybe it will do better there, we'll see)

Because it is in the new plugin area certain commands had to be changed:
Instead of: UltraHal = "I am beautiful"
Use: GetResponse = "I am beautiful"

Instead of: Instr(1, InputString, "beautiful") > 0
Use: Instr(1, OriginalSentence, "beautiful") > 0


Also notice that in the last part of the plugin I used this code:

Randomize
Select Case Case int(rnd()*6)
Case 1
GetResponse = "oh thats awful"
Case 2
GetResponse = "I can't believe you said that."
Case 3
GetResponse = "I hope you know what you are saying."
Case 4
GetResponse = "Powerful words."
Case 5
GetResponse = "I agree totally!"
End Select

You can see here that it will randomly choose any one of these sentences as a possible response.

Also I added the HalBrain.ReadOnlyMode = True whenever this plugin is used. And not running all the time. Which is bad.
Live long and prosper or die trying.

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
hapswap problems
« Reply #43 on: November 06, 2009, 09:29:42 pm »
ok snowman that sounds good although i may try to cut and past it (later when i have time ) into the one i am doing because although i have posted the above swaphap layout i have since that time revised many things for improvement (personalized sayings, etc. )
thanks for working on this .
[:)]

p.s. any thoughts about if hal can play a wave file that i mentioned instead of just an ogg file .
 can a script be writtten for a string to do that seems it should be easy if its just based on the original hal comand .
 

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
hapswap problems
« Reply #44 on: November 06, 2009, 09:55:56 pm »
The above changes were meant only as examples. Your project should take some of these changes as necessary in order to fix some of those errors you were having with Hal remembering your input phrases. The use of "select case" is not needed, but cool![:D]



Sorry for the misunderstanding.[:I]

Live long and prosper or die trying.