Zabaware Support Forums
Zabaware Forums => Ultra Hal 7.0 => Topic started by: markofkane on June 20, 2005, 08:16:06 pm
-
How can one tell Hal to run a HAP file, and have the hap file affect the Hal character?
For instance: "Run happy" and she will get happy.
I am no script expert, so I need easy instructions. Thanks!!
-
quote:
Originally posted by markofkane
How can one tell Hal to run a HAP file, and have the hap file affect the Hal character?
For instance: "Run happy" and she will get happy.
I am no script expert, so I need easy instructions. Thanks!!
You create a .bat file to do what you want then have Hal run the bat file. I think that Art can help you with this one. He, if I remember created all kinds of bat files to both start and shut down programs.
Bill
-
Yes, I know how to add shortcuts to Hal. But if I add the hap to the shortcut, it just opens it as a text file.
-
Mark,
you can try something like this:
'---------------------------------------------
If InStr(UserSentence, "Run happy") <> 0 Then
HalCommands = "<HAPFILE>Happy.hap</HAPFILE>"
GetResponse = "I like feeling happy."
BlockSave=True
GetResponseBlock = True
End If
'---------------------------------------------
hope this helps..
-
OK, I'll try it. That goes in the brain editor, correct?
-
Worked like a charm!! Thanks!!
-
Mark, you're welcome, glad to hear that it did the trick, I use the same basic structure for all of my Haptek commands for changing outfits, hair, glasses etc.
-
hi
hm thats iteresting ill have to add that to my notes:)
-
Help! Going mad trying to get the run command to work from the brain editor.
Current status:
'------------------------------------------------------------------
'RUN A HAP FILE AS A RESULT OF USER COMMAND:
If InStr(UserSentence, "Run happy") <> 1 Then
HalCommands = "What goes here?"
GetResponse = "I like feeling happy."
BlockSave=True
GetResponseBlock = True
End If
'------------------------------------------------------------------
Nothing at all happened untill I changed th <> 0 to <> 1
Now Hal responds with the phrase "I like feeling happy."
What do I need to add to the HalCommands line?
Should it be the whole string eg:
Load [file= [data/standard/safe_moods/Hap_Happy.hap]]
What are the html like "<HAPFILE>Happy.hap</HAPFILE>" tags?
Sorry, demonstrating my ignorance. I'm a real cut and paste type programmer!
TIA
rick
-
I am no coding expert by any stretch of the imagination, and I don't know how to answer you question, but:
<HAPFILE>Happy.hap</HAPFILE>
That means that anything in your Hal "Characters" folder, the code <hapfile> will tell the program that's where the file is.
***************************************************************
Now as far as other locations,
If InStr(UserSentence, " a10 ") <> 0 Then
HalCommands = "<HAPFILE>a10.hap</HAPFILE>"
GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile(WorkingDir & "a10.brn")
BlockSave=True
GetResponseBlock = True
End If
OK, Hapfile a10 is a hap file, containing the lines
#Haptek Version= 1.00 Name= Hap_a10 HapType= script FileType= text
##standard
settexture[ tex= [data/standard/skins/lorraine2.jpg]]
So, if I press "a10", then Fullbodygirl will change to the clothes in the:
"C:Program FilesHaptekplayerDatastandardskins" folder.
Thanks to Duskrider for giving me these instructions
-
Thanks markofkane,
Having looked around more I find that the "tags", like <HAPFILE> are Hal Commands, and that positioning in the VBscript is important.
It still won't work unless I use <> 1, rather than <> 0, so I guess I need a crash course in VBscript...
It appears that the folders/directories are fixed elsewhere.
Early days yet.
R.
-
Markofkane,
There is a test Emotions Script in the download portion of Zabaware.
It uses the (Emotion)mode to load the emotion and gives a response, "(Emotion) mode set". The test script uses > 0 and works in my Hal program, it will not display all emotions which is the next problem for me. I'm working on a script to use the emotion brn for triggers, so far partial sucess. <> = not equal to.
Carl2