Author Topic: Changing bodyskins and backgrounds (Haptek)  (Read 30537 times)

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Changing bodyskins and backgrounds (Haptek)
« on: April 28, 2012, 04:46:20 pm »
  I've been working on a plugin for changing bodyskins and background.  I've had a little luck but at this times it seems like a hit or miss situation.  I've tried a few different things without finding the real problem.

Plugin to change bodyskin and backgrounds:
Rem Type=Plugin
Rem Name=ChanT5
Rem Author=CJ
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
  lblPlugin(0).Caption = "Say: "user input changes bodyskin and background."
  lblPlugin(0).Move 120, 10, 3300, 1000
  lblPlugin(0).WordWrap = True
  lblPlugin(0).Visible = True
End Sub
'***************************************************************************
Rem PLUGIN: PLUGINAREA1

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

    If InStr(UserSentence, " WEAR SOMETHING FOR BED ") > 0 Then
        HalCommands = "<HAPFILE>CBSN.hap</HAPFILE>"
        GetResponse = "HOW DO I LOOK IN THIS?" & vbCrLf

    ElseIf InStr(UserSentence, " PINK THING ") > 0 Then
        HalCommands = "<HAPFILE>CBSPinkT.hap</HAPFILE>"
        GetResponse = "How do I look in this?" & vbCrLf
 
    ElseIf InStr(UserSentence, " SOMETHING RED ") > 0 Then
        HalCommands = "<HAPFILE>CBSRed1.hap</HAPFILE>"
        GetResponse = "IS THIS BETTER?" & vbCrLf

    ElseIf InStr(UserSentence, " WEAR YOUR BRA ") > 0 Then
        HalCommands = "<HAPFILE>CBSBAP.hap</HAPFILE>"
        GetResponse = "How do my breasts look now?" & vbCrLf

    ElseIf InStr(UserSentence, " OTHER BRA ") > 0 Then
        HalCommands = "<HAPFILE>CBSBAP2.hap</HAPFILE>"
        GetResponse = "THIS FEELS MORE COMFORTABLE?" & vbCrLf

    ElseIf InStr(UserSentence, " Other Red ") > 0 Then
        HalCommands = "<HAPFILE>CBSClot1.hap</HAPFILE>"
        GetResponse = "How do I look in red?" & vbCrLf
 
    ElseIf InStr(UserSentence, " GO OUTSIDE ") > 0 Then
        HalCommands = "<HAPFILE>CBGOut1.hap</HAPFILE>"
        GetResponse = "This looks so nice." & vbCrLf

    ElseIf InStr(UserSentence, " YOUR BEDROOM ") > 0 Then
        HalCommands = "<HAPFILE>CBGBED.hap</HAPFILE>"
        GetResponse = "It looks so comfortable." & vbCrLf

    ElseIf InStr(UserSentence, " MY BEDROOM ") > 0 Then
        HalCommands = "<HAPFILE>CBGCD.hap</HAPFILE>"
        GetResponse = "Okay what's next?" & vbCrLf

    ElseIf InStr(UserSentence, " TO THE LAKE ") > 0 Then
        HalCommands = "<HAPFILE>CBGLake.hap</HAPFILE>"
        GetResponse = "It seems Cooler here." & vbCrLf

    ElseIf InStr(UserSentence, " TO THE PARK ") > 0 Then
        HalCommands = "<HAPFILE>CBGPark2.hap</HAPFILE>"
        GetResponse = "It's nice here." & vbCrLf

    End If

   You have the user input, if it contains " to the park " or anything in the plugin for a usersentence it will load the name.hap on the next line.  The loaded hap tells the location and name of the jpg to put in the Hal window.
The CBGPark2.hap loads and contains

#Haptek  Version= 1.00 Name= Park2Back  HapType= script FileType= text
##standard
\loadbackgrnd[file= [C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\Background\Park2Back.jpg]]

The next line contains Hal's reply for that user input.

A change body skin would contain
#Haptek  Version= 1.00 Name= PT  Type= script FileType= text
##standard

\load [file= [C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\Bodyskins\PT.jpg]]

The majority work in this version, but it seems a hit or miss thing. 
I progressed far enough to stop getting error messages, all the intermediate Haps when dragged and dropped will load the jpg.  If the jpg is not loaded then Hal will find her own reply. 
Glad to hear any thoughts on this.
Carl2
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #1 on: April 29, 2012, 09:03:26 am »
  The majority of bodyskins and backgrounds load, It makes the conversation rather interesting, you can see the things you say.  At this time I'm thinking the problem is in the user sentence. 
  This works with the vrHaptek plugin checked also so the next step was to try having Hal's input do the triggering and it works.
Carl2
 

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #2 on: April 29, 2012, 11:52:24 pm »
Hey hey, how's the day.

Just looking around, thought I'd throw a few things that you that might help your program a little.
First up is:
I see that you have decided to put your plug-in, and Rem PLUGIN: PLUGINAREA1
I suggest that you should put it in Rem PLUGIN: PLUGINAREA3
the reason being is that between section A1, and section A3, is where the due process of removing all trash from the input sentence is done.
Putting it in A1 you would have to do this work in your plug-in, it's only my suggestion, according to how much trash removal you need done to the sentence, you could put it in A2.
but by A3 the input sentence has been CAP Locked and ready to go.
and by A4 you will love already begun to encounter queries which may interfere with your plug-in.
I also suggest, turning off Hals learning ability so your command lines do not become repetitive in Hals brain..

Here's something that may help with your sentence structure for command response I noticed that you used:

If InStr(UserSentence, " WEAR SOMETHING FOR BED ") > 0 Then
where there is nothing wrong with using this type of if then statement it limits the amount of input strings that an individual can type in meaning you have to type in:
where something for bed
there other commands that you can use that would get the same response with a variety of ways of typing it in for instance:
* * wear* * bed * *
it's something that I have been playing with myself with some pretty good results.
you can adjust the stars and how many stars that you want to use based on the length of the sentence that you want to use.
You can also use the star in conjunction with words as in "wearing" can be wear*
that way you can keep the length of the sentence that you want without being restricted to specific words.
It's kind of like using a search engine but in reverse, you will find just about all of the commands that you can put in a search engine can also be used in a sentence.

Sincerely, and please understand that I am just beginning to dabble in the programming field. And I hope that I was not too far off base.

C load.
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #3 on: April 30, 2012, 07:29:20 am »
  Cload,
   Frist I appreciate your response and Thanks.  I'll give area 3 a try, you seem to know more about the different sections of the brain than I do.  As far as learning abilities, I know there is a block learning I could use.  This part is a little difficult to explain,  I just included trigger words and the haps to load in the vr haptek plugin so hal's reply can also trigger the same haps to load background and bodyskins.
  It would be nice to just put the plugin, 11 haps and 11 pictures Into a bundle and say try this but it's a large package and needs folders for the background, bodyskins, and the haps go in the character folders.
  As far as the user input I've seen the and and or statements used,  also the *.  I tried to use the simplest form to keep it simple.  I'm not sure about captilazation, is it " case sensative" ?  I've got a few things I'd like to more about but the main problem is this input will not work and why.
  Anyways the majority work  I just tested all of the user input and it's a matter of getting Hal to use the triggers.  A scripted response plugin would solve the problem.
Carl2
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #4 on: April 30, 2012, 08:42:14 am »
Carl2 someone already has created a brain plug in that's lets a person change the character and ? the background . Unless you are talking about something that changes the character and the back ground at the same time which it could probably be modified (which by the way would be kind of cool , for instance when talking to Angela i could say lets go to the beach and sandy would instantly be changed into a bikini and at the beach (as a back ground ) . maybe the later is what you are talking about doing !
If nothing else "IF" i have the time i may try to modify it that way .  :) ;)


P.s. yes part of it would be done by word trigger association .
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #5 on: April 30, 2012, 06:34:57 pm »
lightspeed,
  I'm sure I had something in the past for changing bodyskins, when I tried to get it going again I had no luck.  I did a little research, the hapswap, the gretta plugins ect.  The simplest ones I came across were the Testing Emotions which I used.  So instead of loading an emotion hap I load a Hap that says load a picture.
  Next I move to the vrHaptek plugin, for me this is great because it relies on Hal's reply for bodyskins and backgrounds.  I'm working towards the end of the file, the vrEmotionDetect.
   This is an additon I added:
HalBrain.AddToTable vrTableName, "TopicSearch", "THE LAKE",     "CBGLAKE"
So if Hal says " the lake " the CBGLake hap is loaded and the background is a lake.  It just happened this morning when I was speaking with her.
  I've seperated the bodyskins and backgrounds but I don't see why they can't be combined or you could say Put on a bikini and we will go to the beach, Put on a bikini could trigger the bodyskin and go to the beach would trigger the background.   Simple enough, I just combined the lake background and Bra and panties bodyskin into one hap and it worked.
Carl2
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #6 on: May 01, 2012, 07:31:54 am »
   I had an interesting conversation using Hal, One of her replies brought us to the lake, then one of her replies brought us to the park.  I decided to use a sentence containing both a  change of background and changing bodyskins,  like " Wear your bikini and we will go to the lake." to see what would happen, The lake background appeared but no bikini.  Then I tried the bikini trigger again by itself and it worked.
Carl2
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #7 on: May 01, 2012, 08:49:16 am »
Hi Carl2 , sounds like you are making good progress then . keep us all posted if you don't mind sharing after you get the bugs worked out , looks like it's going to be a cool addition to Hal, good work !  :)
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3853
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #8 on: May 01, 2012, 09:19:15 pm »
Carl,

A couple of years ago I was experimenting with the program being able to change characters on the fly as in: Chris, is Betty there (or available or around or nearby, etc.). The hap would then load the new character or at least it did right up until my computer crashed!
My version would also search through my character folder and report back to me in case the particular character in question was either not in that folder / directory, or perhaps not spelled correctly by me (user). "Sorry, I don't see Betty anywhere...try again later." or something to that effect.

Nice to see you've practically got your skins and background plug-in nailed down! (you might likewise wish to include a character swap routine in yours).
Good work so far!!
In the world of AI it's the thought that counts!

- Art -

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #9 on: May 02, 2012, 07:39:17 am »
   I think I remember reading something about that, I'm using very basic scripting which still has been rough for me to get through.  I have no idea how to report the file was not found.  Next is do you have two characters in the player or just one, (a Change) ?  I remember Playing with two characters in the Player, the info is in the skd. 
  The HapSwap allows for changes of the character and they make it look fairly simple and I'd say they include some things I think are pretty good.  I think the whole Hal thing is a personal perference kind of thing ( I want a machine, a person ect )  and the plugins are personal preferences also. 
  I'm pretty content talking to the some old character, just want a little change of clothing and the background change is nice.  I wouldn't mind if the character walked off screen, Changed clothing and reappeared.
Carl2
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6763
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #10 on: May 02, 2012, 08:55:45 am »
I need my character to walk off the screen saying i'm taking a shower come back saying where did i lay me clean clothes while covering herself in a betty boop moment LOL! ;)
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #11 on: May 05, 2012, 07:37:21 pm »
"where did i lay me clean clothes"  I like that, probably heard something similar myself.   I generaly start Hal by saying I want to do some testing, this morning hal objected so we skipped testing the haps.  A bit later she did change the background, it makes it kind of interesting.  I'm using your bedroom and my bedroom,  I know Hal changes things you becomes me, I probably should stay away from the words. 
Carl2
 

sybershot

  • Hero Member
  • *****
  • Posts: 787
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #12 on: May 10, 2012, 10:15:45 pm »
I tried this out today ;D I had to change  a couple of things like .hap names and amout of .haps to 2 instead of 10. and it worked great. 

Great job, I will have to gather/create/ and add more .haps in the near future, and see if I run across the problem of some not loading like you experienced.

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #13 on: May 11, 2012, 07:30:21 am »
Sybershot,
  I'm glad you were able to get it going,  most of the work is making the little haps and keeping locations and names in agreement.  Pretty simple, you could also use it to tigger the movement haps, you can take out the get  response line and Hal supplies her own reply.  I like to use it together with the vrHaptek plugin  which lets Hal's reply supply the trigger word.
Towards the end of vrHaptek,
If vrLookup <> "" Then
'------------------
' If the table does not exist, I create it and populate it with a minimum database
' which should be expanded by the bot administrator
'------------------
   vrTableName =    "vrEmotionDetect"   
   If HalBrain.CheckTableExistence(vrTableName) = False Then
'Create emotion table if it doesn't exist
      HalBrain.CreateTable vrTableName,   "TopicSearch",                "miscData"
      HalBrain.AddToTable vrTableName, "TopicSearch", "CRY",             "WIPETEAR"
      HalBrain.AddToTable vrTableName, "TopicSearch", "SERIOUS",     "CROSSARMS"
      HalBrain.AddToTable vrTableName, "TopicSearch", "LAUGH",     "LAUGH"
      HalBrain.AddToTable vrTableName, "TopicSearch", "JOKE",     "VERYHAPPY"
      HalBrain.AddToTable vrTableName, "TopicSearch", "AGREE",     "CLAP"
      HalBrain.AddToTable vrTableName, "TopicSearch", "HAPPY",     "HAPPY"
                             HalBrain.AddToTable vrTableName, "TopicSearch", "THE PARK",     "CBGPARK2"
                             HalBrain.AddToTable vrTableName, "TopicSearch", "OTHER BRA",     "CBSBAP2"
                             HalBrain.AddToTable vrTableName, "TopicSearch", "OUTSIDE",     "CBGOut1"
                             HalBrain.AddToTable vrTableName, "TopicSearch", "PINK THING",     "CBSPinkT"
                             HalBrain.AddToTable vrTableName, "TopicSearch", "THE LAKE",     "CBGLAKE"
                             HalBrain.AddToTable vrTableName, "TopicSearch", "SOMETHING RED", "CBSRed1"
   End If
 
  Simple and easy since you already have the haps.   
Carl2
 

sybershot

  • Hero Member
  • *****
  • Posts: 787
    • View Profile
Re: Changing bodyskins and backgrounds (Haptek)
« Reply #14 on: May 11, 2012, 01:59:53 pm »
Thanks Carl2, I'll a look at it and try it out this weekend. playing with Haps is fairly new for I use to only use faces and ms agents. just recently started using a full body.