dupa

Author Topic: Displayskin Script  (Read 5297 times)

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Displayskin Script
« 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]]






 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Displayskin Script
« Reply #1 on: April 13, 2006, 02:18:37 pm »
OTC
  the picture didn't upload, I'll try again.
Sandy in a dress.




Carl2
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Displayskin Script
« Reply #2 on: April 13, 2006, 02:21:48 pm »
 

onthecuttingedge2005

  • Guest
Displayskin Script
« Reply #3 on: April 13, 2006, 08:12:47 pm »
Hi Carl.

Try this modification I made and see if it works for you.

Code: [Select]

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]
« Last Edit: April 13, 2006, 08:14:55 pm by onthecuttingedge2005 »

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Displayskin Script
« Reply #4 on: April 13, 2006, 09:44:34 pm »
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
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Displayskin Script
« Reply #5 on: April 16, 2006, 08:33:33 am »
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
 

onthecuttingedge2005

  • Guest
Displayskin Script
« Reply #6 on: April 16, 2006, 12:12:27 pm »
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]

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Displayskin Script
« Reply #7 on: April 16, 2006, 06:26:35 pm »
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
 

onthecuttingedge2005

  • Guest
Displayskin Script
« Reply #8 on: April 16, 2006, 07:10:46 pm »
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]


Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Displayskin Script
« Reply #9 on: April 18, 2006, 09:36:33 pm »
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
 

onthecuttingedge2005

  • Guest
Displayskin Script
« Reply #10 on: April 19, 2006, 12:55:38 am »
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]
« Last Edit: April 19, 2006, 09:56:40 am by onthecuttingedge2005 »

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Displayskin Script
« Reply #11 on: April 19, 2006, 09:41:15 pm »
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