Ai Dreams Forum

Chatbots => Haptek => Avatar Talk => .HAP Files => Topic started by: digitalteck on March 23, 2007, 06:10:16 pm

Title: Command Help
Post by: digitalteck on March 23, 2007, 06:10:16 pm
 :)

I am currently working on a scene, I can get all movements to work great except the line 34 snooze part   and the line 37  the background picture to change, It just goes black I even tried to load a picture from the web address I thought maybe the string needed a hyperlink so I picked a picture from the web. just goes black.   In my scene I wanted my girl to move in different postions the come back then yawn and look like she is sleeping. Does anyone know what the switch is for the character to look like they are sleeping. I tried snooze did not work. I have seen on Haptek Corperate page if I leave it up Lola looks like she was sleeping. I am inserting my full code from my test webpage just incase I am missing something if anyone can assist.
John

Code
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>

</head>

<body>
<SCRIPT src="HapPlayer411.js"></SCRIPT>

<SCRIPT src="HapToDoList.js"></SCRIPT>


<SCRIPT>
VFBox(300, 380, 'none');
</SCRIPT>
<!--script src="HapPlayerDebugger.js"></script-->
<SCRIPT>

            AddToInitQueue("UseBackground('loading.jpg', 'R');");
            AddToInitQueue("StartupWoman();");

     
            AddToInitQueue("HapToDo_Pulse();");
      AddToInitQueue("MainPart();");


function StartupWoman()
{
var downloader = new Downloader();

                  downloader.AddFile("fullbodgrl12.htr", "R");
                  downloader.AddFile("lighting2.hap", "R");
                 
downloader.DoIt();
UseFile("fullbodgrl2.htr", "R");
                  UseFile("hair.htr", "R");
                  UseFile("lighting2.hap", "R");
UseBackground("background2.jpg", "R");


}

function MainPart()
{
            HapToDo_Clear(0);
            HapToDo_Add_JS(00, "SendText('\\\\SetSwitchIntensity [switch= energyHigh f0= 0.565000 t= 50]');");
            HapToDo_Add_JS(01, "SendText('\\\\Translate [x= 0 y= -4 z= 10 t= 0]');");
            HapToDo_Add_JS(05, "SendText('\\\\Rotate [ y= -45 t= 10]');");
            HapToDo_Add_JS(08, "SendText('\\\\Translate [x= -3.2 y= 5 z= -25 t= 4]');");         
            HapToDo_Add_JS(11, "UseFile ('Intro.ogg', 'R');");
            HapToDo_Add_JS(13, "SendText('\\\\Translate [x= 0 y= 70 z= -170 t= 10]');");
            HapToDo_Add_JS(15, "SendText('\\\\setswitch [figure= fullbod switch= lookup state= a]');");
HapToDo_Add_JS(18, "SendText('\\\\setswitch [figure= fullbod switch= lookleft state= c]');");
            HapToDo_Add_JS(20, "SendText('\\\\setswitch [figure= fullbod switch= mouthhappy state= a]');");
            HapToDo_Add_JS(23, "SendText('\\\\setswitch [figure= fullbod switch= hands_on_hips state= start]');");
            HapToDo_Add_JS(28, "SendText('\\\\Translate [x= 0 y= -4 z= 10 t= 5]');");
            HapToDo_Add_JS(32, "SendText('\\\\setswitch [figure= fullbod switch= yawn state= a]');");
            HapToDo_Add_JS(34, "SendText('\\\\setswitch [figure= fullbod switch= snooze state= a]');");
      HapToDo_Add_JS(37, "SendText('\\\\LoadBackground [background= http://www.free-pictures-photos.com/clouds/cloud-04.jpg]');");


}


</SCRIPT>

</body>

</html>
Title: Re: Command Help
Post by: Freddy on March 23, 2007, 07:40:41 pm
Only had a quick look at this as I'm going out in a bit:

I'm not familiar with the HapToDo.js method, but I have an inkling that you might want to try changing:

LoadBackground [background=......

to

LoadBackground [file=.......

I'll see if I can find that switch later..gotta go.
Title: Re: Command Help
Post by: Duskrider on March 24, 2007, 12:40:33 am
I've seen a sleep command but I've never used it.

Although not java script you may perhaps work through the following.
It's timed to put her out for 20 seconds.

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

\SetSwitchIntensity [switch= blinks f0= 0.000000 t= 0.4]
\clock [t= 2]\SetReg [figure=fullbod name=blink f0=1.2000]
\clock [t= 22]\SetReg [figure=fullbod name=blink f0=0.0000]
\setswitch [switch= h_gest_02 state= a ]

(Might be nice to lay her down before putting her out)    ;)
Title: Re: Command Help
Post by: digitalteck on March 24, 2007, 02:35:12 am
Thanks

I'll give it a try

Do you also know what the commands are for hand guestures while talking in the script that I am using.

As I  am new to AIML I still tring to find the string codes

John

Title: Re: Command Help
Post by: Freddy on March 24, 2007, 11:48:27 am
If  you want to use the inbuilt switches that are already set up to do some animations (as you have been already) then I have attached a text file that lists all the ones in Haptek's fullbodygirl.  Depending on which model you are using some switches may be there or not...

The reason your snooze didn't work is because 'snooze' is not included in the fullbodygirl, it seems to only be in the head models.


There are also the individual body parts that can be set, like in Duskrider's example that uses the \SetReg command...

This guide lists most of the fullbody paramaters :

http://aidreams.co.uk/forum/index.php?topic=107.0

Good luck  :)
Title: Re: Command Help
Post by: digitalteck on March 24, 2007, 03:17:38 pm
 :)

Thanks  I appreciate the help and the information. I work with it later today!

John
Title: Re: Command Help
Post by: Duskrider on March 25, 2007, 05:54:48 pm
 
You asked for gestures so here they are.
Deciding which girl to use is quite important.
If I remember correctly these only work with ladybod (the black suited gal with glasses and single boob) and male haptars.
I use body_female and design haps for individual movements of body parts which you may also have to do with fullbodygirl.

JavaScript is as follows:
<tr><td align= center><font color= #5555aa>Talk Gestures</font></td></tr>
<tr><td align= left>Left Hand #1    </td><td><input type="button" value="Go" onclick="SendText('\\setswitch [switch= talkGestL1 state= start]');"></td></tr>
<tr><td align= left>Left Hand #2    </td><td><input type="button" value="Go" onclick="SendText('\\setswitch [switch= talkGestL2 state= start]');"></td></tr>
<tr><td align= left>Left Hand #3    </td><td><input type="button" value="Go" onclick="SendText('\\setswitch [switch= talkGestL3 state= start]');"></td></tr>
<tr><td align= left>Both Hands      </td><td><input type="button" value="Go" onclick="SendText('\\setswitch [switch= talkGestR1 state= start]');"></td></tr>
<tr><td align= left>Right Hand      </td><td><input type="button" value="Go" onclick="SendText('\\setswitch [switch= talkGestR2 state= start]');"></td></tr>
<tr><td align= left>Right Hand Point</td><td><input type="button" value="Go" onclick="SendText('\\setswitch [switch= talkGestR3 state= start]');"></td></tr>

A non-java time script example is
#Haptek Version= 2.00 Name= turnback.hap HapType= script FileType= text
#For all full haptars except fulbodygirl and body_female and Nadia

\clock [t= 5]\setswitch [switch= talkgestl3 state= start] # l high wave
\clock [t= 10]\setswitch [switch= talkgestr2 state= start] # r high wave
\clock [t= 15]\setswitch [switch= talkgestl2 state= start] # l low wave
\clock [t= 20]\setswitch [switch= talkgestr1 state= start] # both arms explain
\clock [t= 25]\setswitch [switch= talkgestl1 state= start] # l medium wave
\clock [t= 30]\setswitch [switch= talkgestr3 state= start] # r point
Title: Re: Command Help
Post by: digitalteck on March 26, 2007, 04:05:43 am
Thanks A lot Dusk!  :)
Title: Re: Command Help
Post by: digitalteck on March 28, 2007, 12:47:50 am
Thanks for all the switches.

I still have an issue with changing the backgroud picture in my sequence. If  I load background.jpg in the cue

var downloader = new Downloader();

                  downloader.AddFile("fullbodgrl12.htr", "R");
         downloader.AddFile("mover.hap", "R");
                  downloader.AddFile("lighting2.hap", "R");
                 
         downloader.DoIt();
         UseFile("fullbodgrl2.htr", "R");
                  UseFile("hair.htr", "R");
         UseFile("mover.hap", "R");
                  UseFile("lighting2.hap", "R");
         UseBackground("background.jpg", "R");



the background loads

Then if I use this in the sequence
HapToDo_Add_JS(20, "SendText('\\\\LoadBackground [file= background2.jpg]');");

The background goes black won't load the other picture.  But If I name background2 the same as the cue background it does not change.

I'm lost

John
Title: Re: Command Help
Post by: dan on March 28, 2007, 01:00:44 am
Hi Digitaltech,

I was curious what does the HapToDoList.js look like, is it just a blank to use?, and sometimes I've noticed you have to put the path in with LoadBackground [file= background2.jpg] or have it in the player directory.  In the original code I couldn't get fullbody to load with
downloader.AddFile("fullbodgrl12.htr", "R");  but it worked with the
UseFile("fullbodgrl2.htr", "R"); when I changed the name to 12, but then nothing else, unless it was cleared then filled in the haptodolist, but then I didn't have it all set up nor loaded with fullbod for it to work with, but it looked pretty cool to try.

Thanks for posting all this.
Title: Re: Command Help
Post by: digitalteck on March 28, 2007, 02:25:18 am
Dan I'll look throgh the hap to do list.

I have noticed also that if I do change a the name of the character it does not load but I found out it is certain scripts on the page that does this. The one I have now allows me to change it. If I use hapteks script on thier corperate page or other bot pages I seen it acts up

Above in my first post is the entire html script and code that works on my test page.  If I can get the background to change at different sequences then I can finish putting the rest of the script up so when she moves in different postions in the window I can have a different background.

John
Title: Re: Command Help
Post by: Freddy on March 28, 2007, 04:31:55 pm
Hmm, well I have tried using the HapToDoList.js in one of my current projects but as yet have had no joy with it either.

Instead of HapToDo_Add_JS I was using HapToDo_Add_HT which (it explains in the Haptek guide under Java programming) should send a line of HyperText to the player.  That I haven't got to work.

I'm still working on my code, if I find out anything I will let you know, but so far I haven't got a solution.
Title: Re: Command Help
Post by: Carl2 on May 31, 2007, 12:57:50 am
  I was just looking through this forum and although I'm spending most of my time with Hal just talking I'm attracted to this type of work.  In the past I'd looked at the available Htr's and noticed that different characters offered different numbers of movements, I'd just checked this again and the number of movements is missing. 
Carl2
Title: Re: Command Help
Post by: Freddy on May 31, 2007, 10:17:16 am
Not sure exactly what you mean...is it that some htr's don't have the full movements?
Title: Re: Command Help
Post by: Carl2 on May 31, 2007, 01:31:31 pm
  Possibly the best way for me to explain is the differences between fullbodygirl and bodyfemale (besides the jiggle),  I tried using both with the different animation haps and found body female did not respond to quite a few.  I did notice that people had made some special haps for body female but in general fullbodygirl had more hap movements she was capable of using.
  I'd also noticed while looking through the download section  in characters that  different numbers of movements were available to different characters.  It's been awhile but I had thought it is what the numbers were indicating.
Carl2
Title: Re: Command Help
Post by: Freddy on May 31, 2007, 05:53:59 pm
Yes I found the same thing with a lot of models too - some of the heads also do not contain the full code for morphs although they do appear in the model definition file.  Basically you have to add the animations to models as you make them and it seems not all of the models released have all of the animations.  Mainly its a case of trial and error to see which animations a model contains.