Zabaware Support Forums
Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: Carl2 on April 13, 2006, 02:15:07 pm
-
OTC,
Sorry for the delay in posting this, I'm not in much of a hurry anyways. Here is the scripting I'm using, It works with user input and no provisions have been made to include Hals input since it didn't work earlier. I'd like to include Hals input to trigger the loadskin haps'
Displayskindetect ( I created a detect table in the brn, written rather than a picture)
Search Topic
Wear the red blouse Loadskin1
Wear the blue blouse Loadskin2
wear the green blouse Loadskin3
Wear the dress Loadskin4
Code inserted in Hal 6 brn
Line 1827
Displayclothes = Halbrain.TopicSearch(UserSentence, WorkingDir & "Displayskindetect")
Select Case Displayclothes
Case "LoadSkin"
HalCommands = "<HAPFILE>Loadskin.hap</HAPFILE>"
Case "LoadSkin2"
HalCommands = "<HAPFILE>LoadSkin2.hap</HAPFILE>" Case "LoadSkin3"
HalCommands = "<HAPFILE>LoadSkin3.hap</HAPFILE>"
Case "LoadSkin4"
HalCommands = "<HAPFILE>LoadSkin4.hap</HAPFILE>"
' Case "LoadSkin5"
' HalCommands = "<HAPFILE>LoadSkin5.hap</HAPFILE>"
End Select
If Displayclothes <> "" And DebugMode = True Then
DebugInfo = DebugInfo & "A word in the user's sentence has triggered Hal To change clothes " & Displayclothes & VbCrLf
HalCommands = "<HAPFILE>" & HapFile & "</HAPFILE>"
End If
'End of Change skins
Loadskin.hap ( 1 of 4 being used )
#HaptekSDK Version= 1.0 HeaderLines= 2 HapType= command FileType= text
#Name= haptek_scene Icon= [ websters_icon ]
load [file= [D:HalA6Ultra Hal Assistant 6CharactersSSRed.jpg]]
(http://www.zabaware.com/forum/uploaded/Carl2/2006413141454_SandysDress.jpg"]SandysDress.jpg)
-
OTC
the picture didn't upload, I'll try again.
Sandy in a dress.
(http://www.zabaware.com/forum/uploaded/Carl2/2006413141736_SandysDress.jpg"]SandysDress.jpg)
(http://www.zabaware.com/forum/uploaded/Carl2/2006413141736_SandysDress.jpg"]SandysDress.jpg)
Carl2
-
OTC,
Here is a link, It' in the upload section
http://www.zabaware.com/forum/uploaded/Carl2/2006413141454_SandysDress.jpg
-
Hi Carl.
Try this modification I made and see if it works for you.
Rem Type=Plugin
Rem Name=Change Clothes
Rem Author=Carl2, Gerald L. Blakley A.K.A OnTheCuttingEdge2005
Rem Host=Assistant
Rem PLUGIN: PLUGINAREA1
Set XHalBrain = CreateObject("UltraHalAsst.Brain") 'Can not be HalBrain or an error will occure, For .brn files.
Dim MyDirectory
MyDirectory = SD()
Displayclothes = Halbrain.TopicSearch(UserSentence, WorkingDir & "Displayskindetect")
If Displayclothes <> "" Then
Select Case Displayclothes
Case "LoadSkin"
HalCommands = "<HAPFILE>" & MyDirectory & "Loadskin.hap</HAPFILE>"
Case "LoadSkin2"
HalCommands = "<HAPFILE>" & MyDirectory & "LoadSkin2.hap</HAPFILE>"
Case "LoadSkin3"
HalCommands = "<HAPFILE>" & MyDirectory & "LoadSkin3.hap</HAPFILE>"
Case "LoadSkin4"
HalCommands = "<HAPFILE>" & MyDirectory & "LoadSkin4.hap</HAPFILE>"
' Case "LoadSkin5"
' HalCommands = "<HAPFILE>" & MyDirectory & "LoadSkin5.hap</HAPFILE>"
End Select
End If
Rem PLUGIN: FUNCTIONS
Function SD()
SD = "C:\Program Files\ZabawareUltra Hal Assistant 6\Characters\"
End Function
If not I'll see what else I can do.
Jerry[8D]
-
OTC,
Thanks, I didn't expect such a quick response, again a busy next few days, I'll try it as soon as I can. Just made some changes to include the miniskirt.htr, into her wardrobe, looks okay even when she walks.
Carl2
-
OTC,
Just put your scripting in the brain and used a ' in my lines; running test. Error 1002 on line 445 in column 0. syntax error.
Line 445 is Function SD()
Carl2
-
quote:
Originally posted by Carl2
OTC,
Just put your scripting in the brain and used a ' in my lines; running test. Error 1002 on line 445 in column 0. syntax error.
Line 445 is Function SD()
Carl2
I tested the code directly into HAL6 brain for debugging and it work fine.
I think it might of been how you inserted the code.
The code I posted was designed as a plugin rather than a brain insert.
The code has to be modified differently for a copy and paste code for inside an actual Brain.
Place the code into a text file and name it ChangeClothes.uhp
then reboot HAL and then choose the Plug called [] Change Clothes
It should work.
Jerry[8D]
-
OTC,
Sorry, I'm use to cutting and pasting, you've made it easier and useful to more people which is a really good idea.
Just downloaded your EFA plugin. Excited about the learn by reading.
Carl2
-
quote:
Originally posted by Carl2
OTC,
Sorry, I'm use to cutting and pasting, you've made it easier and useful to more people which is a really good idea.
Just downloaded your EFA plugin. Excited about the learn by reading.
Carl2
I will be updating the E.F.A either tonight or tomorrow.
Upgrade includes.
1. Close Programs, This Function allows a User to ask HAL to Clase a program and HAL will do so on command.
2. Turning of Text learning so normal file Assistant can still be used without interference.
More to come.
Jerry[8D]
-
OTC,
Somehow I messed the whole thing up, changing scripting around. The brain works but my scripting stopped working. The debug says the loadskin is being sent but there is no changing when using Hal. If I drag a loadskin.hap the skin loads. I applied ' to remove my script and put your uhp in, I checked the box and It didn't work also. At this time I'm not sure where the problem is, I'll continue in the morning.
I've Changed this to SD = "DHal6abawareUltra Hal Assistant 6Characters\" , where it is located.
Carl2
-
quote:
Originally posted by Carl2
OTC,
Somehow I messed the whole thing up, changing scripting around. The brain works but my scripting stopped working. The debug says the loadskin is being sent but there is no changing when using Hal. If I drag a loadskin.hap the skin loads. I applied ' to remove my script and put your uhp in, I checked the box and It didn't work also. At this time I'm not sure where the problem is, I'll continue in the morning.
I've Changed this to SD = "DHal6\awareUltra Hal Assistant 6Characters\" , where it is located.
Carl2
Hi Carl.
If you use two back Slashes instead of one it will show up in the forum correctly when posting directories like so:
SD = "D:\Hal6\Zabaware\Ultra Hal Assistant 6\Characters\
When I debugged the custom directory it was working properly, I didn't have your hap files to debug them within the script but if you'd like to send those hap files then I will try and correct it for you on your load skin code.
Send your code and the files.
Best wishes Buddy
Jerry[8D]
-
OTC,
Made more attempts again today, still working on it. I can remember having a similar problem when I tried to get a modified character to load at startup rather than the loading the standard jpg supplied. After I got it working I looked through the files and didn't understand how it could work so I corrected them and it stopped working. It's working again so I should see how that works to straighten out the change clothes.
Carl2