Author Topic: VBScript line to load viewer  (Read 7747 times)

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
VBScript line to load viewer
« on: May 02, 2008, 08:14:25 pm »
I'm looking for a piece of VBScript code that will load files, haps, htrs, etc to the haptek viewer that Hal is using without using the Hal commands.  Anyone know the VBScript lines I need?

Thanks,
Jake
Austin, Texas, USA, Earth

onthecuttingedge2005

  • Guest
VBScript line to load viewer
« Reply #1 on: May 02, 2008, 11:45:06 pm »
Hi Jake.

Here you go.

<SHOWHAL>
<HIDEHAL>
<SHOWCAL>
<SHOWEVENTS>
<SHOWOPTIONS>
<MICOFF>
<MICON>
<MICTOGGLE>
<VIEWCHAT>
<AUTO>miliseconds</AUTO>
<AUTOOFF>
<HALPAD>
<HALPAD>file-path</HALPAD>
<VOICE>new voice</VOICE>
<SPEAK>Text to speak</SPEAK>
<DIAL>Phone</DIAL>
<HAPBACK>jpeg path</HAPBACK>
<AGENTXY>X,Y</AGENTXY>
<MSAGENT>Anim name</MSAGENT>
<HAPFILE>Hap file</HAPFILE>
<HAPTEXT>Hap text</HAPTEXT>
<RUNPROG>Prog name</RUNPROG>
<RESPOND>User sent</RESPOND>
<CUSERNAME>New user name</CUSERNAME>
<CHALNAME>New Hal Name</CHALNAME>
<RUNCMD>1 line of VBScript</RUNCMD>

You can use them like this.
HalCommands = HalCommands & "<HAPFILE>Hap file</HAPFILE>"

Jerry[8D]

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
VBScript line to load viewer
« Reply #2 on: May 03, 2008, 02:08:31 am »
Thanks for the reply, OTCE2005.  Yep, I've been using those and they work OK, but I'm looking for something else... I'm looking for a piece of script that will load the files into the Haptek viewer that Hal is using independently of the Hal program.  A piece of script that would emulate dragging and dropping the file into the Haptek Console.

Thanks!
Jake
Austin, Texas, USA, Earth

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
VBScript line to load viewer
« Reply #3 on: May 27, 2008, 02:06:19 am »
nudge... nudge... anyone?
Austin, Texas, USA, Earth

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
Re: VBScript line to load viewer
« Reply #4 on: March 03, 2011, 01:03:49 am »
Still looking for this if anyone has run across it?
Austin, Texas, USA, Earth

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: VBScript line to load viewer
« Reply #5 on: March 03, 2011, 09:11:42 am »
This may help, I use it to load the character In Hal or the HapRegestry, pretty sure it works in the HapPlayer.
I put it in Notpad and add the .htr extension.

##standard
#HaptekSDK Version= 1.0 HapType= command FileType= text

\load [file= [C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\Characters\AIactive.htr]]

\load [file= [C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\Characters\SSNRMT 2048.jpg]]

\load [file= [C:\Program Files (x86)\Zabaware\Ultra Hal Assistant 6\Characters\Position.hap]]
 
It looks like you should be able to use it, If I'm missing something let me know.
Carl2
 

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
Re: VBScript line to load viewer
« Reply #6 on: March 03, 2011, 08:39:15 pm »
Thanks for the reply, Carl2, but that's not what I'm talking about.  That's the Haptek Hypertext format that you can put in a HAP text file then drag and drop the file into the HapTek player to execute the HAP file.

I have been given answers that are Hypertext to use in a HAP file, Javascript to be used in a HTML document and instructions of how to do it in a Visual Basic Project, but all these are different then what I'm looking for.  I want the few lines of text that you would put in a text file that would access the HapTek API and send one command to it... you would then name that text file "something.vbs" and would be able to double click on it and run it like any other .vbs script file.  The best answer I've gotten so far is the Visual Basic Project how to, but a Visual Basic Project contains a bunch of files and again, I'm not looking for that, I just want 1 "something.vbs".

Anyone?  Anyone know how to make a few lines of text in a .vbs script that will access the HapTek API and send 1 command?

Thanks!   :)
Austin, Texas, USA, Earth

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
Re: VBScript line to load viewer
« Reply #7 on: March 03, 2011, 10:07:05 pm »
I've never tried using it for anything, but the entire main user interface window is exposed to the vbscript with all its objects and functions as an object called "FrmAss" 

The character engine (whether MSAgent, Haptek, or Ogre) can be referenced with:
FrmAss.HalFace.object

If Haptek is the active character engine, you have access to these methods:
Sub Refresh()
Sub Options()
Sub StartAnimation()
Sub StopAnimation()
Sub LoadFace(WorkingDir As String, filename As String)
Sub Speak(TextString As String)
Sub HapFile(filename As String)
Sub HapBack(filename As String)
Sub HapSendText(strText As String)
Sub Translate(x, y, z, t)
Sub Rotate(x, y, z, t)
Function HapQuery(strQuery As String)
Function GetCurFigure() As String
Function LoadEngine(EngineGUID As String, Optional VoiceName As String) As Boolean

Properties:
ScaleWidth() As Single
ScaleHeight() As Single
AutoRedraw() As Boolean
FaceExpression() As String
BackColor() As OLE_COLOR
Transparent() As Boolean
ShowBackgroundArrows() As Boolean



So if I understand your post correctly, the commands tyou are looking for are:
FrmAss.HalFace.object.HapSendText "Some hap text to send to haptek"
HaptekResponse = FrmAss.HalFace.object.HapQuery("A query to ask of haptek")

In theory, these should work from inside a Hal VBScript, but I've never tried it. You'd have to look at Haptek documentation to see what you can actually send or query from Haptek.

If you try using this and an engine other than Haptek is selected, the script will error and fail.
« Last Edit: March 03, 2011, 10:09:20 pm by Medeksza »
Robert Medeksza

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
Re: VBScript line to load viewer
« Reply #8 on: March 03, 2011, 10:28:57 pm »
Thanks for the reply, Medeksza!  Looks like you are on the right track of what I'm looking for.  My main problem is syntax... I don't do enough programming these daze to remember all that stuff, so typically I try to find a SMALL completely working script that maybe just does one or two things (you know, small), then use it to get my syntax correct and add or change what is needed to get what I want done.  Often, a 2000 line script of mine, started out as a 20 line script I found elsewhere that just showed me the HOW of it.

I will take what you posted and see if that will get me there... and THANKS again for the reply... I appreciate it!  BUT... I still would LOVE it if someone could post a little 3 to 20 line text of a .vbs that actually would run when you double click on the file, that would make the HapTek player appear with a character in it and send just 1 HAP file to that window.  I could take that little file and turn it into some really cool BIG files... just got to find the little working example.
Austin, Texas, USA, Earth