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

Post Reply
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, merry fucking christmas, that is excelent. Now I can stop writing edge increment commands and can clean up how I'm doing some other things, and oh man I can get rid of this stupid idea I had for using flags since I couldn't keep counts I could check, oh yeah.

This is pretty great!

I had a question about multiline pages on a command. Can you do things like this?

Code: Select all

ifSet myFlag image32.jpg, {
	style1 Hey there!\n\n
	style1 You rock
}
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 »

desertfox wrote:Welp, merry fucking christmas, that is excelent. Now I can stop writing edge increment commands and can clean up how I'm doing some other things, and oh man I can get rid of this stupid idea I had for using flags since I couldn't keep counts I could check, oh yeah.

This is pretty great!

I had a question about multiline pages on a command. Can you do things like this?

Code: Select all

ifSet myFlag image32.jpg, {
	style1 Hey there!\n\n
	style1 You rock
}
No. The way the If, ifSet and ifNotSet commands are implemented allowing a text block there is tough. I may implement it in the future because I have run across cases where it would have been useful. And clearly you have too, and since you and I seem to be the only ones using the engine that means 100% of the users would like that feature :-)

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

Script Engine Version 1.4 now available

Post by PlayfulGuy »

The latest version of the Guidme Script Engine (version 1.4) is now available. See the first post of this thread for links.

Download the new package and run the script "New in v1.4" for a quick demo of the new features.

The following changes and additions were made in this version:

Automatic edge counting.
Any button labelled "Edge", "Edged", "I Edged", "Edging", "On the edge" and other variations will trigger an automatic increment of the variable EdgeCount. The engine also sets the flag UserEdged so you can do something like

Code: Select all

ifSet UserEdged goto badBoy
You can change the value of EdgeCount in your script by assigning a new value like

Code: Select all

EdgeCount = 0 // reset the count
Automatic flags for UserCame and UserRuined
Any button like "Came", "I Came", "Ruined", "I Ruined", "I Came Mistress", etc. causes the engine to set the flag UserCame or UserRuined as appropriate so you can easily test for those conditions. It doesn't count them but if you think that would be useful I'll add it.

New If command
Syntax:

Code: Select all

if ( expression ) command
with full expression support and two special functions isSet() and isNotSet() so you can do things like

Code: Select all

if ( count >= 5) goto EnoughCounting

if ( count < 5 ) count = count + 1

if ( isSet(FlagA) and isNotSet(FlagB) ) goto Condition1

if ( isSet(FlagA+FlagB) ) goto Condition2

if ( count > 5 and isNotSet(UserCame) ) image1.jpg, You are the best!

The testing of flags uses the canShow() function provided by GuideMe so whatever syntax GuideMe supports can be used in a script. It supports both And and Or conditions and uses standard javascript syntax so you can have elaborate expressions like

Code: Select all

if ( ( isSet(FlagA) and isNotSet(FlagB) ) Or (isSet(FlagA) and count > 7) ) set UserIsAMachine
As with the existing ifSet and ifNotSet commands the command portion can be any valid script command.

Limitation At present if the command portion is a page command it can NOT use a text block like

Code: Select all

ifSet SomeFlag myImage.jpg {
  block of text for the page on the ifSet command
}

This will likely be added in future but for now it will break your script.

Displaying Variables in a Page
The value of any variable can be inserted into the text of a page using the short form tag <variableName>. So if you wanted to show the current edge count you could do

Code: Select all

image27.jpg, So far you've edged <EdgeCount> times.
or 
if ( EdgeCount == 5) Image27.jpg, You're up to <EdgeCount> edges now.
Repeat Parameter on Audio Command

A "repeat" parameter was added to the audio command so you can have the sound clip play more than once. Just specify the number of times you want to play as in

Code: Select all

Audio filename, 5 
to make it play 5 times for example.

Happy scripting!

PG
Last edited by PlayfulGuy on Wed Oct 12, 2016 4:23 am, edited 1 time in total.
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 »

Oh man, really nice feature set!

Will be able to go back and work some of that in and if I have energy may go back and revisit some teases that I wanted to make more use of if commands in, but I'll probably save that for plowing forward. When I'm finally done with everything I want to go back and give it a 'what if this is your second time going through the maze' pass to add more variety etc.

I should be able to get to and try out some of this stuff tonight, thank you again for the new features!
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 »

Edge counts and flags are working so, so nicely. I really have to go back to the start and play through everything I have to kind of make sure it's stayed consistent, so going back and fixing all my counters is a really good excuse.

I found a small bug maybe. The <myName> command looks like its getting pushed through as [span]myName[/span] when it comes out in the text. Did a really quick look in the scriptengine.js and saw the

Code: Select all

text = text.replace(/<myname>/i,"[span]myName[/span]");
text = text.replace(/<mysubname>/i,"[span]mySubName[/span]");
text = text.replace(/<mistress1>/i,"[span]mistress1[/span]");
text = text.replace(/<mistress2>/i,"[span]mistress2[/span]");
If I change them to have <span> around them, they resolve correctly, but wondering if you probably changed that to avoid stepping in the new <variable> stuff and might be a bad thing to be doing.
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 »

desertfox wrote:Edge counts and flags are working so, so nicely. I really have to go back to the start and play through everything I have to kind of make sure it's stayed consistent, so going back and fixing all my counters is a really good excuse.

I found a small bug maybe. The <myName> command looks like its getting pushed through as [span]myName[/span] when it comes out in the text. Did a really quick look in the scriptengine.js and saw the

Code: Select all

text = text.replace(/<myname>/i,"[span]myName[/span]");
text = text.replace(/<mysubname>/i,"[span]mySubName[/span]");
text = text.replace(/<mistress1>/i,"[span]mistress1[/span]");
text = text.replace(/<mistress2>/i,"[span]mistress2[/span]");
If I change them to have <span> around them, they resolve correctly, but wondering if you probably changed that to avoid stepping in the new <variable> stuff and might be a bad thing to be doing.
I seem to have had a lapse in thinking there. What you've done is probably the correct fix.

In the original version I did that replacement, then at the end of replaceTags() switched the square brackets back to angle brackets. This was so the code didn't waste time checking instances of <span> to see if it was a variable.
For some reason that I no longer remember I decided that this temporary use of square bracekts was no longer needed. I removed the code at the end that puts the angle brackets back but forgot to fix the code at the beginning.

I will update the download files, but unless you find other issues what you've done should be fine.

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 »

desertfox wrote: I found a small bug maybe. The <myName> command looks like its getting pushed through as [span]myName[/span] when it comes out in the text. Did a really quick look in the scriptengine.js and saw the

Code: Select all

text = text.replace(/<myname>/i,"[span]myName[/span]");
text = text.replace(/<mysubname>/i,"[span]mySubName[/span]");
text = text.replace(/<mistress1>/i,"[span]mistress1[/span]");
text = text.replace(/<mistress2>/i,"[span]mistress2[/span]");
If I change them to have <span> around them, they resolve correctly, but wondering if you probably changed that to avoid stepping in the new <variable> stuff and might be a bad thing to be doing.
I have uploaded new versions of the zip files with the corrected code. As always, see the first post of this thread.

PG
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 »

Hello! Still plugging away with the engine. One small comment on the exact same block of code in the last post here, I had a page with multiple <myName>'s on it and it was only replacing the first one, so changed the script engine to add g to the regex and seems to be working alright now.

~LN 1611 text = text.replace(/<myname>/gi,"<span>myName</span>");

just thought I would mention that if you wanted to update your master version for your project.

Also, I was going to post I was having trouble using the if stuff but it turns out that it really, really likes having you say "if (" vs "if(" to start the expression which was what was throwing it off so far. Once I got the if ( part its behaving just as expected now. Good stuff.
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 »

desertfox wrote:Hello! Still plugging away with the engine. One small comment on the exact same block of code in the last post here, I had a page with multiple <myName>'s on it and it was only replacing the first one, so changed the script engine to add g to the regex and seems to be working alright now.

~LN 1611 text = text.replace(/<myname>/gi,"<span>myName</span>");

just thought I would mention that if you wanted to update your master version for your project.

Also, I was going to post I was having trouble using the if stuff but it turns out that it really, really likes having you say "if (" vs "if(" to start the expression which was what was throwing it off so far. Once I got the if ( part its behaving just as expected now. Good stuff.
Thanks for those notes. I will add appropriate changes to my version. I never thought about the "if(" issue. I'm so accustomed to putting a space in there it just never occurred to me. I'll see how hard it is to allow for that. I've made several other updates to the script engine recently as well. I'll try and release something in the not too distant future.

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

Request for input

Post by PlayfulGuy »

To anyone who uses, or has used this script engine to write a tease:

I've discovered a bit of a design issue in the script engine that I think needs to be rectified, but I don't want to break too many scripts for people. It's not like you'd have to re-write anything already released with the script engine, but it would affect re-using scripts in other work that uses a newer version of the engine, or if you want to upgrade something you are working on to use the newer version.

Here's the issue:

In the current version of the engine (1.4) there are shortcut commands for buttons and global buttons - * (an asterisk) is short for Button, and ** (double asterisk) is short for GlobalButton. I was trying to write a script that just uses a random image in a page as in

*, (20..30) Some command to the player

Using a wildcard for the image. Unfortunately you can't because the script engine thinks this is a button command. Damn!

Since no one has said anything about this little bug I'm assuming no one is really using that shortcut form, so if I change it in the next version of the engine it shouldn't be a big deal.

My thoughts are to change the button shortcuts to @ and @@ instead of using * and **.

If you've written anything using the engine, what are your thoughts?

Like I said, existing teases based on an older version of the engine would continue to work just fine, it would just mean making a few edits if you wanted to reuse a script in some work based on a newer version of the engine.

PG
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 »

Man here I thought I had read the help/tutorial back to back and I totally missed the fact that you could shortcut buttons like that. I guess that was a good thing :)
User avatar
hosenguy
Explorer At Heart
Explorer At Heart
Posts: 321
Joined: Sun Jun 14, 2015 11:22 pm
Gender: Male
I am a: None of the above

Re: GuideMe Scripting Engine

Post by hosenguy »

I have found "TeaseMe-v0.0.7-Tease-MeetChayseEvans" and like the video aspect of this. Can anyone help me find other teases that utilize video?

This tease is very straight forward without any real branching. Seams this would be a good way to tie a few of the CH scenes into an interactive kind of story. Are there any? I haven't found them. :no:

Thanks
lestrian
Explorer At Heart
Explorer At Heart
Posts: 398
Joined: Tue Aug 30, 2011 5:45 pm

Re: GuideMe Scripting Engine

Post by lestrian »

PlayfulGuy: I haven't used the scripting engine, but breaking backwards compatibility is usually a bad idea. This seems more like a problem with the parser. Is the wildcard character already used for random files in the scripting engine? If so, then maybe there should simply be a special case where if it is followed by a comma then it is not a button. Otherwise, maybe you should introduce a new keyword/symbol for random image instead, such as the word random or the symbol "_".

hosenguy: Almost no teases use video. Some that do are Ultimate Man Test, Becoming Self Employed, FWB3.
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 »

lestrian wrote:PlayfulGuy: I haven't used the scripting engine, but breaking backwards compatibility is usually a bad idea. This seems more like a problem with the parser. Is the wildcard character already used for random files in the scripting engine? If so, then maybe there should simply be a special case where if it is followed by a comma then it is not a button. Otherwise, maybe you should introduce a new keyword/symbol for random image instead, such as the word random or the symbol "_".
I agree about breaking backwards compatibility, but as far as I know only desertfox and I have actually used the script engine to make anything. I think using * as a shortcut for button was a mistake because * is a filename wildcard already supported by GuideMe. I didn't think it all the way through, and that special case never occurred to me until later. Mistakes are made though, and they can be corrected.

@desertfox - that's funny because it was your suggestion really. One of the articles that you linked to in the early discussions used something similar.

PG
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 »

Yup, sharpest pencil in the box I am :)
Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests