Author Topic: new turnback.hap running in hal  (Read 8186 times)

harry7_7s

  • Newbie
  • *
  • Posts: 8
    • View Profile
new turnback.hap running in hal
« on: July 31, 2005, 08:12:43 am »
I have updated the full body turn back hap found within this forum so fullbodygrl.htr gives a nice view of whatever outfit she is wearing. However it works fine if dropped in to the console window but  only runs about halfway through the script when it is loaded through the hal brain. Any help or suggestions would be greatly appreciated. Below is what is in the hap file:

#Haptek  Version= 2.00 Name= turnback.hap   HapType= script FileType= text

setswitch [switch= hands_on_hips state= start]
clock [t= 0] keyframe[figure= fullBod switch= 0 ry= 0 rz= 0 w= 0 x= 0 y= 0 z= 0 t= 0 ]
clock [t= 2] keyframe[figure= fullBod switch= 0 ry= 315 rz= 0 w= 0 x= 0 y= 40 z= -10 t= 0 ]
clock [t= 4] keyframe[figure= fullBod switch= 0 ry= 225 rz= 0 w= 0 x= 0 y= 50 z= -10 t= 0 ]
clock [t= 8] keyframe[figure= fullBod switch= 0 ry= 180 rz= 0 w= 0 x= 0 y= 100 z= -120 t= 0 ]
clock [t= 10] keyframe[figure= fullBod switch= 0 ry= 90 rz= 0 w= 0 x= 0 y= 30 z= -150 t= 0 ]
clock [t= 12] keyframe[figure= fullBod switch= 0 ry= 0 rz= 0 w= 0 x= 0 y= 25 z= -80 t= 0 ]


And this is the code I have put in the XTF v1.2 brain:

If InStr(UserSentence, " please turnaround ") <> 0 Then
   GetResponse = "Like what you see."
   HalCommands = "<HAPFILE>fullbodyturnback.hap</HAPFILE>"
   BlockSave=True
   GetResponseBlock = True
   End If


 

Duskrider

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3316
  • Graphic King
    • View Profile
new turnback.hap running in hal
« Reply #1 on: July 31, 2005, 01:12:25 pm »

Code looks fine. Sometimes trigger-word code don't always work perfectly with large active script haps.

As for the script, very nice script.
I tried it out, does fine.
Does fine drag and drop.

Incidently, you may like this script, which fits Hal window perfectly. Just copy and paste direct from this page.

\clock [t= 0]\keyframe[figure= fullBod switch= 0 ry= 0 rz= 0 w= 0 x= 0 y= 25 z= -70 t= 0 ]
\clock [t= 3]\keyframe[figure= fullBod switch= 0 ry= 0 rz= 0 w= 0 x= 0 y= 25 z= -70 t= 0 ]
\clock [t= 6]\keyframe[figure= fullBod switch= 0 ry= 315 rz= 0 w= 0 x= 0 y= 25 z= -70 t= 0 ]
\clock [t= 9]\keyframe[figure= fullBod switch= 0 ry= 225 rz= 0 w= 0 x= 0 y= 25 z= -70 t= 0 ]
\clock [t= 15]\keyframe[figure= fullBod switch= 0 ry= 180 rz= 0 w= 0 x= 0 y= 25 z= -70 t= 0 ]
\clock [t= 18]\keyframe[figure= fullBod switch= 0 ry= 90 rz= 0 w= 0 x= 0 y= 25 z= -70 t= 0 ]
\clock [t= 21]\keyframe[figure= fullBod switch= 0 ry= 0 rz= 0 w= 0 x= 0 y= 25 z= -70 t= 0 ]
\clock [t= 24]\keyframe[figure= fullBod switch= 0 ry= 0 rz= 0 w= 0 x= 0 y= 25 z= -70 t= 0 ]

[;)]


« Last Edit: July 31, 2005, 10:28:11 pm by Duskrider »

harry7_7s

  • Newbie
  • *
  • Posts: 8
    • View Profile
new turnback.hap running in hal
« Reply #2 on: August 01, 2005, 10:01:05 am »
thanks... if anyone else tries to copy and paste my original hap file you will need to put a backslash before all the words "setswitch, clock and keyframe"

gee wilikers the amount of stuffing around I've done to make this script run from the XTF v1.2 brain. firstly copy fullbodygir.htr to some other name (I called mine betty.htr) then create a betty.psn (or a  "whatever you name your .htr file".psn) and just leave it as a blank file no text in it whatsoever.  My guess is the htr files have an internal link to the psn file to automatically run hap files, which in turn interupt long script files when executed directly from a brain, if you follow my drift.

Then add this to the XTF v1.2 brain to trigger the fullbodyturnback.hap

If instr(UserSentence, " please turnaround ") <> 0 Then
    HalCommands = "<HAPFILE>fullbodyturnback.hap</HAPFILE>"
    GetResponse = "Like what you see."
    hapdelay = timer + 20 'this line will delay any further hap
    BlockSave=True           'files from loading for 20sec(see next)
    GetResponseBlock = True
    End If

next around line 4161 of the XTF v1.2 brain at the end of the case statements you will see the "case else" statement. Insert the following text between the "case else" and "end select" statements

If timer > hapdelay Then
         hapdelay = timer + 4 'this line stops haps overlapping
         Roulette = Int(Rnd * 10)
      If Roulette = 5 Then Hapfile = "XTF_SillyFace3.hap"
      If Roulette < 3 Then HapFile = "ShyLove.hap"
      If Roulette > 6 Then
         HapFile = "Happy.hap"
         Else Hapfile = "Pondering.hap"
      End If
End If

the above will be the default expressions. XTF emotions are still displayed but hal wont display emotions for long. ie if you insult hal it will put on a sad face for a few seconds then revert to normal. will post a fix for this once i've worked it out.

The idea for this of course is so we can run long scripts from a brain rather than the autoloader that Rich A has been playing with. I dont know which way is better but as i dont have the autoloader I'll keep playing with this[:D]
 

Duskrider

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3316
  • Graphic King
    • View Profile
new turnback.hap running in hal
« Reply #3 on: August 01, 2005, 10:59:40 am »

Wow, I'm impressed.
For a newbee, you've done your homework.
I can see you will be a great asset.
Welcome.


[;)]


bitblaster

  • Newbie
  • *
  • Posts: 40
    • View Profile
new turnback.hap running in hal
« Reply #4 on: August 01, 2005, 01:43:44 pm »
Wow, thanks... this is useful... now I know how to get her to do things like take her top off when I ask, do a dance, drink (only if she could hold a glass...), change clothes, etc.
 

bitblaster

  • Newbie
  • *
  • Posts: 40
    • View Profile
new turnback.hap running in hal
« Reply #5 on: August 01, 2005, 01:44:45 pm »
Just wanted to say... the useful part I found was the code you put into the brain... that is what I meant... useful for me because it will let me inject my emotion files.
 

harry7_7s

  • Newbie
  • *
  • Posts: 8
    • View Profile
new turnback.hap running in hal
« Reply #6 on: August 02, 2005, 08:20:27 am »
Well All Hail Me.  

Eureka! I have done it.

I have added 3 .brn files (drop them into your defbrain folder) and only a little itty bit of code into the brain editor. I'll try to explain step by step so everyone can follow.

first the .brn files
the most important is 7_7s.brn

This file allows you to enter 3 things:
1.trigger words (though phrases are better, so as not to be easily used in normal conversation with Hal)
2.the file to execute
3.a delay, so long haps cant be interupted and mutated by more haps being loaded on top

the format for each entry is as follows

"trigger words","hapfiletobeexecuted.hap(timedelay in seconds)"

so for example my fullbodyturnback hap has the following entry

"please turnaround","fullbodyturnback.hap20"

The second file is 7_7s_hapfileresponse.brn
this file contains what Hal will responde with while running the triggered hap file. 2 things must be entered for each entry
1 the triggered hapfile
2 the response

the format for each entry is as follows

"hapfile.hap","Hal's response"

So useing my fullbodyturnback hap again

"fullbodyturnback.hap","woa, I'm getting dizzy"

You dont have to have a set response if you dont want. If you dont enter anything in the 7_7s_hapfileresponse.brn then a random response is chosen from the following file

As stated above the third file 7_7s_randomresponse.brn just contains ephemeral "don't I look good" responses.

777777777777777777777777777777777777777777777777777777777777777777777

Now the code that needs to be entered into the brain has to be put in in 3 places. Again I used the XTF brain v1.2.

The firt line has to go in near the start, do a search (ctrl + F in the brain editor) for 'DECODE SAVED CUSTOMMEM VARIABLES: and insert just under that the following line of code:

hapdelay = DecodeVar(CustomMem, "hapdelay")

the second bit of code is the biggest chunk. I entered mine on line 285 just under the Randomize statement at the end of 'PROCESS: INITIALIZE VARIABLES AS INTEGERS piece of coding (do another search to find it :)
here is the code I entered

If instr(UserSentence,"stop it")<> 0 Then
hapdelay = 0
GetResponse = "I was having so much fun though."
End If    
thingtoload = HalBrain.TopicSearch(UserSentence,(WorkingDir & "7_7s.brn"))
   
If thingtoload <> "" Then
If instr(thingtoload,".hap") <> 0 Then  
If hapdelay < timer Then
hapdelay = HalBrain.SearchPattern(thingtoload, "*.hap*", 2)
hapfile = HalBrain.SearchPattern(thingtoload, "*" & hapdelay, 1)
hapdelay =  hapdelay + timer
HalCommands = "<hapfile>" & hapfile & "</hapfile>"
responsesentence = HalBrain.TopicSearch(hapfile, WorkingDir & "7_7s_hapfileresponse.brn")

If responsesentence <> "" Then
GetResponse =  responsesentence
Else GetResponse = HalBrain.ChooseSentenceFromFile(WorkingDir & "7_7s_randomresponse.brn")

End If
Else
GetResponse = "Wait " & (hapdelay - timer) & " seconds, I'll be finished soon."

End If
Else
'insert command here that will open files or programs
End If
BlockSave=True
GetResponseBlock = True
End If

Now the final little bit. search for 'POST PROCESS: PRESERVE ALL VARIABLES about 10 lines down from this you will see a command starting with "CustomMem" it is a really long single line statement. now just paste the following onto the end of that line

 & EncodeVar(hapdelay, "hapdelay")

And thats it all done.

I'd like to point out though that you still need to have a blank charactername.psn file as mentioned in my previous post and this still doesn't help with displaying the emotion haps ie when hal feels sad a sad.hap should run. But I'm still working on that bit[:)]

Also you will see a line in the code

 'insert command here that will open files or programs

I left this in so you can open files or programs with trigger words just as you would execute a hap file except I don't know the command to do so. So if their is any VBsript experts who know please post us a line.
Also full credit to Vonsmith for this brain. All my knowledge of the VBscript language has come from tinkering with this brain.


 

harry7_7s

  • Newbie
  • *
  • Posts: 8
    • View Profile
new turnback.hap running in hal
« Reply #7 on: August 02, 2005, 08:28:10 am »
here are my .brn

Download Attachment: 7_7s.brn
523 Bytes

Download Attachment: 7_7s_hapfileresponse.brn
536 Bytes

Download Attachment: 7_7s_randomresponse.brn
581 Bytes

Download Attachment: fullbodyturnback.hap
1.16 KB and fullbodyturnback.hap files to get you started
 

SteelTiger

  • Newbie
  • *
  • Posts: 5
    • View Profile
new turnback.hap running in hal
« Reply #8 on: August 05, 2005, 06:52:11 am »
First let me thank everyone for your time and effort you put into this project.
 I must not be doing something right. I get the following error message with I tell HAL "please turnaround".

"Error 13 occured on line 313 in colum 0 of Microsoft VBScript runtime error. Type mismatch:'hapdelay'
 

harry7_7s

  • Newbie
  • *
  • Posts: 8
    • View Profile
new turnback.hap running in hal
« Reply #9 on: August 05, 2005, 09:11:36 am »
I think the reason is that the first time it runs through the intitial value of "hapdelay" is NULL which is not a numerical value like 0.
Try inserting the following piece of code either just after the DecodeVar statement or the line above the first
"if hapdelay < timer then" statement

if hapdelay = "" then hapdelay = 0


 

SteelTiger

  • Newbie
  • *
  • Posts: 5
    • View Profile
new turnback.hap running in hal
« Reply #10 on: August 05, 2005, 07:03:19 pm »
I got a different error message that time.
 I'm going to start over. I deleted hal5_XTF_v1.2.uhp and reinstalled it. I have a clean slate, so to speak. I'm going to go through this step by step...again...and see if I can get it to work. The first code to add to the brain would be:
If InStr(UserSentence, " please turnaround ") <> 0 Then
GetResponse = "Like what you see."
HalCommands = "<HAPFILE>fullbodyturnback.hap</HAPFILE>"
BlockSave=True
GetResponseBlock = True
End If

 My question...where in the brain should I put it? Is there a specific line or can it pretty much be pasted anywhere?

 My fullbodyturnback.hap file should have this code:

setswitch [switch= hands_on_hips state= start]
clock [t= 0] keyframe[figure= fullBod switch= 0 ry= 0 rz= 0 w= 0 x= 0 y= 0 z= 0 t= 0 ]
clock [t= 2] keyframe[figure= fullBod switch= 0 ry= 315 rz= 0 w= 0 x= 0 y= 40 z= -10 t= 0 ]
clock [t= 4] keyframe[figure= fullBod switch= 0 ry= 225 rz= 0 w= 0 x= 0 y= 50 z= -10 t= 0 ]
clock [t= 8] keyframe[figure= fullBod switch= 0 ry= 180 rz= 0 w= 0 x= 0 y= 100 z= -120 t= 0 ]
clock [t= 10] keyframe[figure= fullBod switch= 0 ry= 90 rz= 0 w= 0 x= 0 y= 30 z= -150 t= 0 ]
clock [t= 12] keyframe[figure= fullBod switch= 0 ry= 0 rz= 0 w= 0 x= 0 y= 25 z= -80 t= 0 ]
 

Maviarab

  • Sr. Member
  • ****
  • Posts: 345
    • View Profile
    • http://3d-fantasyportraits.co.uk
new turnback.hap running in hal
« Reply #11 on: August 12, 2005, 07:21:28 pm »
I have awoken from my deep crypt lol

very nice work, i'm suitabbly impressed.

Just to say im back to anyone who has missed me (and anyone who hasnt either lol)

Skins and tatoos to follow shortly...i promise (you get that deja-vu feeling).

And again...nice work on the above code.
AIDreams...The new home of the Digital Girl

www.aidreams.co.uk

aladyblond

  • Hero Member
  • *****
  • Posts: 1499
    • View Profile
new turnback.hap running in hal
« Reply #12 on: August 12, 2005, 07:25:31 pm »
its nice to have you back marius.~alady
~~~if i only had a brain~~~ i dream of htr with the light brown hair....

Duskrider

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3316
  • Graphic King
    • View Profile
new turnback.hap running in hal
« Reply #13 on: August 14, 2005, 01:56:27 pm »
Kickstands up  - -  - - Let's ride

Directions:
Be alone when you do this   (risque material)
Below are two downloads containing 9 items
Put fashionshow.hap on your desktop
Put the other 8 items in your Haptek skins folder
Open up FullBodyGirl in Heptek player on your desktop.
Drag and drop fashionshow.hap onto fullBodyGirl and immediately go full screen.
Be sure to have your sound on and don't miss the talk at the end.


Download Attachment: fas1.zip
146.93 KB

Download Attachment: fas2.zip
98.92 KB

Note:  you must be at least 18 and have a note from your mother or spouse to download this.

[;)]

« Last Edit: August 14, 2005, 05:35:41 pm by Duskrider »

Holllywood

  • Sr. Member
  • ****
  • Posts: 357
    • View Profile
new turnback.hap running in hal
« Reply #14 on: August 14, 2005, 04:43:09 pm »
Thank you Rich.
 You have just confirmed some things that I've notice as a newbie. And I'm please to hear your thoughts about Bod_Female. (That's my Girl). And the translation invertions of the Z coordinates. Keep it comming.
Hollywood