Hi everyone,
I am hoping to get some help essentially on what would be the correct Haptek Hypertext command syntax to trigger a series of morphs sequentially.
I am creating a php driven page which randomly parses an rss news feed for the latest text entries. It displays however many number of recent items I choose to then echo and send to the Haptek player for the character to speak using TTS.
Along with this php script I have additionally included a Javascript function "SetRandomThing()" which randomly changes morphs & textures for the character. It was found here -
http://www.haptek.com/tests/MorphsAndTextures/index.htmlSo for example - with 3 items chosen to parse and display - each echo would produce something like-
HapToDo_Add_JS(0.0, "SetRandomThing();");
HapToDo_Add_JS(0.0, "SendText('Hello this is text One');");
HapToDo_Add_JS(0.0, "SetRandomThing();");
HapToDo_Add_JS(0.0, "SendText('Hello this is text Two');");
HapToDo_Add_JS(0.0, "SetRandomThing();");
HapToDo_Add_JS(0.0, "SendText('Hello this is text Three');");
My problem is how the SetRandomThing() - Morph/Texture function, goes off 3 times in row quickly ending on the last one
and usually before the character has even finished speaking the text of the first parsed feed entry item.
What I want to have it do instead, is where the character would morph and speak text one, then morph again and speak text 2 and then morph again and speak text 3 etc .....doing each morph sequentially.
I have only a rudimentary comprehension of both PHP and Javascript and have been hacking my way through this by trial and error and to also understand the Haptek Hypertext commands.
I guess either in my php or Javascript I may perhaps need to include some kind of incremental function like
(i=0;i< x ;i++) where x would be however many number of entries I have chosen to display and so then increment each Haptek timing argument "HapToDo_Add_JS( 0.0," etc - so each series echo statements for each generated feed item would appear like - HapToDo_Add_JS(0.0, - HapToDo_Add_JS(0.1, - HapToDo_Add_JS(0.2, etc so as to create a timeline to fire each morph sequentially as the character speaks the next item.
Would anyone possibly know of what combination of specific Haptek Hypertext commands I might use to
affect pauses between each morph and spoken text entry, to make the character do each sequentially? Morph/Speak 1 - Morph/Speak 2 - Morph/Speak 3 etc? Am I perhaps missing something additionally like - \\loadmorph [name= "morph name" switch= morphs i1= 1]
If anyone might be able to offer any help I would really appreciate it.
Thank you.