Below is a plugin for having the user input change backgrounds and bodyskins. I've
been using this type of plugin for years, the problems I've had with it in the past have been
removed. You can copy and paste this into notepad, Save As at the bottom you would
change Save As Text to All files and write Chant5.uhp. The Chant5.uhp is placed in
the Ultra Hal assistant 6 folder and should be visable in the brain portion of the
options and should be checked to be used.
This is the Chant5.uhp :
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>CBSPT.hap</HAPFILE>"
GetResponse = "How do I look in this?" & 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>CBGPark.hap</HAPFILE>"
GetResponse = "It's nice here." & vbCrLf
End If
The GetResponse line is a scripted response and can be left out,
Hal usualy supplies her own answer.
Next we need the hap that actually loads the jpg's. and we have 4 which are placed
in the Characters folder The CBSN.hap is labled similar to the uhp in notepad as are
the other three.
#Haptek Version= 1.00 Name= CBSN HapType= script FileType= text
##standard
\load [file= [C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\Bodyskin\Nu2M.jpg]]
#Haptek Version= 1.00 Name= CBSPT HapType= script FileType= text
##standard
\load [file= [C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\Bodyskin\PT.jpg]]
The background haps look like this
#Haptek Version= 1.00 Name= CBGLake HapType= script FileType= text
##standard
\loadbackgrnd[file= [C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\Background\LakeBack.jpg]]
#Haptek Version= 1.00 Name= CBGPark HapType= script FileType= text
##standard
\loadbackgrnd[file= [C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\Background\ParkBack.jpg]]
So we should have 4 Name.haps we place into the characters folder which will load the bodyskins
and backgrounds. I have not supplied the jpg's which are pic's of the bodyskins and backgrounds.
This should give you the idea of how it works, you can add to it modify or whatever.
To complete this project I go into the vrEmotionDetect table located in the brain editor and add the subject
and resulting hap that is called. This is optional the uhp will work without doing this.
Subject Topic
TO THE LAKE CBGLake
TO THE PARK CBGPark
WEAR SOMETHING FOR BED CBSN
SOMETHING PINK CBSPT
The above allows Hal's input to make the same bodyskin and background changes as the user can.
You already have the haps for this that you supplied earlier.