GuideMe Scripting Engine

Webteases are great, but what if you're in the mood for a slightly more immersive experience? Chat about Tease AI and other offline tease software.

Moderator: 1885

User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

bobhill wrote: Thu May 11, 2017 1:15 pm
Hi PG - thanks for the reply and for taking a look at this. Glad to see to will be fixed in next version! Also, I appreciate the effort you have put in to make the script engine, without it I would have never tried to take the time to learn JS!

Bob
Well, my goal was that people could learn a simpler script language instead of having to learn javascript, so not sure that's a win in my book....

I've been looking into this and so far through my testing the new version of the script engine is working properly in the new version of Guideme with only a few tweaks required. I had tightened up a lot of the code already so that's helping.

The one issue I have is that the state of the script is no longer saved if you close a tease and then re-open it later intending to carry on from where you left off. This was working in previous versions. I'm off to the GuideMe thread to contact philo about that.

PG
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Status update

Post by PlayfulGuy »

Hi everyone.

I figured it's about time I post some kind of update here. Sorry to have been so quiet about this project. I have been working away at adding the new features I wanted in this release and finding and fixing bug after bug after bug.

I have finally - just this past weekend - reached the point where I think all the coding changes are done and seem to be working. I'm busy now doing regression testing and making sure my new code hasn't broken anything else. That's the good news.

The bad news is that I've done all of this development in Guideme version 1.5, so once my final testing is complete I still have to update it for the latest version of Guideme and see how it behaves there. I've tried a few things here and there, and so far have been able to find ways to adapt the script engine it so it will work in either version.

Back in June I developed an all day tease for myself using the script engine and used it as a test platform. That paid off big since I found a few subtle bugs that might have otherwise slipped by, and I had a great day playing it! The all day tease will be included in the release as a sample, along with a number of other teases I've developed during testing, so there will be lots of material to explore.

There are so many new features and enhancements in the new version I'm sure I've missed documenting some of them. I've been trying to update the tutorial as I go, but I'm sure I'll miss something.

I don't have a timeframe in mind for release yet. Real life continues to be unpredictable and interferes with my schedule, and other people keep writing great teases that I have to try, but it's a lot closer now. :-D

Regards,

PG
User avatar
d3vi0n
Explorer At Heart
Explorer At Heart
Posts: 563
Joined: Fri Mar 25, 2011 10:42 am

Re: GuideMe Scripting Engine

Post by d3vi0n »

no worries! it's done when it's done! thx for your great work so far! :wave:
Try GuideMe to play Milovana Teases offline or create your own offline teases with highres images and videos...
Look at Hearts Club or Pilgrim Quest or My Succubus if you wanna see whats possible with GuideMe...
DerpZerp
Explorer At Heart
Explorer At Heart
Posts: 198
Joined: Thu Sep 28, 2017 1:25 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by DerpZerp »

Edit: I figured it out... Silly mistake here, but might be worth pointing out for anyone else :P I mistakenly assumed the images used in the tutorial were placed under an Images folder so Model/Sarah would be located in an images folder. So when I tried doing that in my own tease it couldn't find that image. So I adjusted my imageFolder to Images/Nature/Forest and now it works fine.

I just started creating my own tease using GuideMe and your scripting engine which so far looks pretty nice. Except for some reason I have created the most basic script and want to set the imgFolder to something else, but no matter what I change it to in the debug "Main" it says the image is Models/Sarah/no-o1.jpg. Even though my scripts look as follows:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>

<Tease scriptVersion="v0.1">
  <Title>Tease using the GuideMe Script Engine</Title>
  <Url></Url>
  <Author>
    <Name>DerpZerp</Name>
    <Url>http://www.milovana.com/forum/memberlist.php?mode=viewprofile&amp;u=24738</Url>
  </Author>
  <MediaDirectory>Temples</MediaDirectory>
  <Settings>
	  <AutoSetPageWhenSeen>False</AutoSetPageWhenSeen>
    <PageSound>false</PageSound>
    <ForceStartPage>true</ForceStartPage>
  </Settings>

  <Include file="Common/ScriptEngine.js" />
  
  <Pages>

    <Page id="start"> 
  	  <javascript>
  		<![CDATA[
  		function pageLoad() {
      
        // Load the script file
        <!-- **EDIT Change the line below to load your script file. -->
        loadScript("Scripts/Test.scr");   
      }

  		]]>		
  	  </javascript>
      <Text>
      Something went wrong. Check the GuideMe jscript.log
  	  </Text>      
  	  <Image id="SetInCode" />
      <Delay target="runScript" seconds="0" />	  
  	</Page>
    
    <Include file="Common/ScriptEngine.xml">
  </Pages>
</Tease>
And the small test script

Code: Select all

imgFolder  Nature/Forest

First:
  forest.jpg { "hi" }
In the javascript console it says its loading "ShowScriptPage: Got image=Nature/Forest/forest.jpg, text=" "hi" ", delay=0, metronome=0", so I assume it should be my forest.jpg image but no image shows up...
The entire log:

Code: Select all

ShowScriptPage: Got image=Nature/Forest/forest.jpg, text=" "hi" ", delay=0, metronome=0
ShowScriptPage: page.buttons.length=0
ShowScriptPage: page.globalButtons.length=0
replaceTags: After phase 3 text=" "hi" "
replaceTags: After phase 2 text=" "hi" "
handleTextFormats: Result = [ "hi" ]
handleTextFormats: Checking style ["hi"]
getNextPage: Start of text block found.
getNextPage: command="forest.jpg { "hi" }"
processCommands: 2) index=15, command='forest.jpg { "hi" }'
processCommands: Skipping label First:
processCommands: 2) index=14, command='First:'
processCommands: 2) index=13, command='imgFolder Nature/Forest'
processCommands: Skipping label StartScript:
processCommands:  1) index=12, command=StartScript:'
processCommands: Starting...
getNextPage: Starting...
ShowScriptPage: starting...
loadScript: Exiting. Script start index=12
loadScript: Script load complete. Found 16 commands
loadScript: End of text block.
loadScript: Starting text block.
loadScript: line[7]='forest.jpg { "hi" }'
loadScript: Adding label 'first' with target index 14
loadScript: line[6]='First:'
loadScript: line[5]=''
loadScript: line[4]='imgFolder Nature/Forest'
loadScript: line[3]='// Here I set where to find my images. This folder (and it's subfolders) will be used for all images in the script'
loadScript: line[2]=''
loadScript: line[1]='// The guideme script always starts at the beginning of the script file'
loadScript: line[0]='// Any line that begins with a double slash, like this one, is a comment'
loadScript: lines read=8
loadScript: filetext.length=323
loadScript: Loading Scripts/Test.scr
ShowScriptPage: Got image=Nature/Forest/forest.jpg, text=" "hi" ", delay=0, metronome=0
ShowScriptPage: page.buttons.length=0
ShowScriptPage: page.globalButtons.length=0
replaceTags: After phase 3 text=" "hi" "
replaceTags: After phase 2 text=" "hi" "
handleTextFormats: Result = [ "hi" ]
handleTextFormats: Checking style ["hi"]
getNextPage: Start of text block found.
getNextPage: command="forest.jpg { "hi" }"
processCommands: 2) index=15, command='forest.jpg { "hi" }'
processCommands: Skipping label First:
processCommands: 2) index=14, command='First:'
processCommands: 2) index=13, command='imgFolder Nature/Forest'
processCommands: Skipping label StartScript:
processCommands:  1) index=12, command=StartScript:'
processCommands: Starting...
getNextPage: Starting...
ShowScriptPage: starting...
loadScript: Exiting. Script start index=12
loadScript: Script load complete. Found 16 commands
loadScript: End of text block.
loadScript: Starting text block.
loadScript: line[7]='forest.jpg { "hi" }'
loadScript: Adding label 'first' with target index 14
loadScript: line[6]='First:'
loadScript: line[5]=''
loadScript: line[4]='imgFolder Nature/Forest'
loadScript: line[3]='// Here I set where to find my images. This folder (and it's subfolders) will be used for all images in the script'
loadScript: line[2]=''
loadScript: line[1]='// The guideme script always starts at the beginning of the script file'
loadScript: line[0]='// Any line that begins with a double slash, like this one, is a comment'
loadScript: lines read=8
loadScript: filetext.length=323
loadScript: Loading Scripts/Test.scr
Creator of Maze of Desire (GuideMe tease).
DerpZerp
Explorer At Heart
Explorer At Heart
Posts: 198
Joined: Thu Sep 28, 2017 1:25 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by DerpZerp »

Ok so I have done a bit more playing around with the scripting engine and done more thinking of the custom maze I am setting up. I currently have 1 script file for a section of the maze with 35 rooms and when you enter a room with a girl encounter it sends you off to the script of that girl, this all works quite nicely.

Now I was trying to start implementing some variables that persist through loading but also to be able to tell what you have and haven't done. For example I want to have you return to that specific spot in the maze after you are done with the girl encounter, so I was thinking if there is a way to easily set a variable number that holds the current room nr, so when I am done with the girl encounter on lets say room 13, I can just set the room_nr to 13 and load the script and it would continue normally.

I would like to do something like this:
Spoiler: show
if(persist_room_nr != 0) goto room(persist_room_nr)
Currently I tried setting the variable in the scriptVars which sets the room nr to 15:
scriptVars.put("persist_room_nr",15);

but when I do this check:
if(persist_room_nr == 0) goto Room4

It still goes to Room4 even though when I have my debugging window open it shows me that the value is actually changed to 15 right before.
Creator of Maze of Desire (GuideMe tease).
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

DerpZerp wrote: Mon Oct 09, 2017 2:13 pm Ok so I have done a bit more playing around with the scripting engine and done more thinking of the custom maze I am setting up. I currently have 1 script file for a section of the maze with 35 rooms and when you enter a room with a girl encounter it sends you off to the script of that girl, this all works quite nicely.

Now I was trying to start implementing some variables that persist through loading but also to be able to tell what you have and haven't done. For example I want to have you return to that specific spot in the maze after you are done with the girl encounter, so I was thinking if there is a way to easily set a variable number that holds the current room nr, so when I am done with the girl encounter on lets say room 13, I can just set the room_nr to 13 and load the script and it would continue normally.

I would like to do something like this:
Spoiler: show
if(persist_room_nr != 0) goto room(persist_room_nr)
Currently I tried setting the variable in the scriptVars which sets the room nr to 15:
scriptVars.put("persist_room_nr",15);

but when I do this check:
if(persist_room_nr == 0) goto Room4

It still goes to Room4 even though when I have my debugging window open it shows me that the value is actually changed to 15 right before.
Sorry for the late reply. I don't check in here as often as I'd like to. Life keeps me too busy.

What you have seems to be right, but without seeing more of the code I can't really say what's happening there. In Guideme 1.5 the script should simply continue wherever it left off when you reload the tease. If you're doing something more elaborate in a Guideme page on reload I'd need more info. I don't have time today to play with that at all, but perhaps over the weekend. Maybe post a a little more info and I'll see what I can figure out.

I am very close to releasing the new version of the script engine and am making that a priority right now.

Cheers!

PG
User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by bobhill »

Probably a simple question, but it's driving me nuts! In the XML that calls a script, how can I determine the number of edges that the user performed during the script?

Edit - I think I have this working now that I see EdgeCount is a scriptVar.
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

bobhill wrote: Fri Nov 03, 2017 5:34 pm Probably a simple question, but it's driving me nuts! In the XML that calls a script, how can I determine the number of edges that the user performed during the script?

Edit - I think I have this working now that I see EdgeCount is a scriptVar.
Glad you worked it out.
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

At long last I am very happy to say that the new version of the script engine is now available for download. Links are below, and as always, in the first post of this thread.

This new version includes many new features and countless bug fixes and improvements. The most complete source of information on the new commands and features is probably the file ScriptEngineChangeLog.txt which is in the ScriptTeases\Common folder. There is also an included tutorial New in v1.5 which lists much of the same information, but also demonstrates several of the new features. The information in this tutorial is also (mostly) replicated in the file New in 1.5.pdf in the ScriptTeases folder.

Here's a brief list of some of the key additions and features:
  • Vastly improved support for variables and expressions
  • Vastly improved handling of special tags like <ChooseFrom> and <Random>
  • Added a Call command to call another script. The calling script is suspended, the called script executes, and then the calling script resumes.
  • Added Wait and GetInput commands
  • Added some special pages and commands for debugging and recovering from errors
  • Added a ScriptPath variable that can be used to define a list of folders to search for include files etc.
  • The gosub command is now optional. You can specify the name of a GuideMe page or a script label as a command and a gosub is assumed. When invoking a script subroutine or Guideme page in this manner you can pass arguments to the page or subroutine
  • The above item means the script engine is now extendable. You can use GuideMe pages and javascript to create new commands. Javascript functions are included to allow GuideMe pages to retrieve arguments specified on the script command.
  • Added a default button. If a page has no buttons and no delays defined it results in a dead end. In this version, this is detected and a "Continue" is added automatcially. The button text can be changed, or this behavior disabled with the DefaultButton command.
  • Enhanced the Include command so it keeps track of which files have already been included and won't include the same file twice.
  • Vastly improved command and page parsing so it's much more intelligent and less error prone
  • Added isDefined() and notDefined() functions to test whether or not a variable is defined
  • Added functions and special keywords for simulating dice rolls
  • Added new pages, functions and resources for creating card games
  • Added alternate screen layouts to support card games, and so you can put the text on the left and an image on the right
  • Includes new sample teases: King vs Queen, Denial Card Game, Reena's Edging Game and Stroke By The Cards
  • Includes numerous sample scripts that you can use and or learn from
  • And more. See the file ScriptEngineChangeLog.txt for additional info.
Download here: Script Engine 1.5

Please let me know if you find any bugs, and to lavish me with praise if you're so inclined.

PG
slavejack
Explorer At Heart
Explorer At Heart
Posts: 249
Joined: Sat Oct 13, 2007 1:03 pm

Re: GuideMe Scripting Engine

Post by slavejack »

Wow, gonna have lots of fun with your sample teases!
Found one bug in Reena's Edging Game in the spoiler;
Spoiler: show
During the double strokes the card drawn was a 10 of hearts but the text called it an ace, red...can't recall the suit.
Also the debug tool, DL32.0.4, doesn't seem to work with this tease...that's the only one I've tried so far. :-)
User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by bobhill »

PlayfulGuy wrote: Mon Nov 13, 2017 2:23 am This new version includes many new features and countless bug fixes and improvements.
omg - it's like a whole different engine! :rolleyes: :-D I guess I need to review several of my scripts! :yes:
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

slavejack wrote: Mon Nov 13, 2017 12:13 pm Wow, gonna have lots of fun with your sample teases!
I hope you do. I've personally found the King vs Queen one to be a lot of fun, but of course I wrote it for me :-D
slavejack wrote: Mon Nov 13, 2017 12:13 pm Found one bug in Reena's Edging Game in the spoiler;
Spoiler: show
During the double strokes the card drawn was a 10 of hearts but the text called it an ace, red...can't recall the suit.
Interesting. I'll see if I can reproduce that.
slavejack wrote: Mon Nov 13, 2017 12:13 pm Also the debug tool, DL32.0.4, doesn't seem to work with this tease...that's the only one I've tried so far. :-)
I don't actually know what debug tool you refer to. I use the debug screen in Guideme all the time, but I generally do all of my development work in Guideme version 1.5. Version 3.3/3.4 still has bugs when it comes to saving and restoring the state of a tease when a script is in progress.

PG
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

bobhill wrote: Tue Nov 14, 2017 3:35 am
PlayfulGuy wrote: Mon Nov 13, 2017 2:23 am This new version includes many new features and countless bug fixes and improvements.
omg - it's like a whole different engine! :rolleyes: :-D I guess I need to review several of my scripts! :yes:
Good luck! Take time looking through the sample teases, tutorials change log file. I tried to include lots of examples of what can be done. I've gotta say even I'm impressed with what I've accomplished. :-)

PG
slavejack
Explorer At Heart
Explorer At Heart
Posts: 249
Joined: Sat Oct 13, 2007 1:03 pm

Re: GuideMe Scripting Engine

Post by slavejack »

PlayfulGuy wrote: Thu Nov 16, 2017 2:56 pm
I don't actually know what debug tool you refer to. I use the debug screen in Guideme all the time, but I generally do all of my development work in Guideme version 1.5. Version 3.3/3.4 still has bugs when it comes to saving and restoring the state of a tease when a script is in progress.

PG
Sorry...guess my explanation wasn't very good. The tool I was speaking of the the one that pressing Alt+D gets you into. I noticed that on the upper-right corner of GuideMe the script page is not displayed. Instead it says "show script page" or something like that. In the debugger it says the same thing and no other information shows about that page. I did notice that there were a few pages of one of the samples that did show, however I can't recall what one it was now...I'd have to play all of them again to find it. :w00t:
desertfox
Explorer At Heart
Explorer At Heart
Posts: 365
Joined: Mon Dec 03, 2012 7:26 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by desertfox »

Welp I slept right through this release! Going to check it out, looks like a lot of awesome stuff.

Guessing it looks like still should be aiming for GM 1.5 then as well?

Reading through the changes, good god man, you have not been idle! Really awesome amount of stuff in here.
Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests