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 »

slavejack wrote: Fri Nov 17, 2017 11:23 am
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:
That tool works just fine. I'm not sure what you're expecting to find. You write your scripts in a text editor like Notepad. The debug tool you're referring to is not used in writing or debugging scripts run by the script engine. The Guideme page ShowScriptPage is the page that manages the script execution so that's what you will always see when a script is running.

When you load GuidemeScripts.xml the GuidemeScripts page shows you the menu of available scripts. You then select a script, the script is loaded into memory by the script engine, and then the "runScript" and ShowScriptPage pages manage the execution of the script.

If you look in ScriptTeases/Scripts you will find the script files (*.scr). Open one of these in Notepad or a similar text editor (I use PsPad, an excellent editor with syntax highlighting etc.)

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: Fri Nov 24, 2017 3:40 pm 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.
You weren't that late to the party, but I was wondering where you were :-)

The script engine itself works properly in Guideme 1.5 and Guideme 3.3, but unfortunately 3.3 still has some bugs and limitations. Guideme 3.4 I found broke some things that 3.3 had fixed, or had some other issue that I can't recall at the moment. The main issue (in Guideme 3.3 and 3.4) that affects the script engine is that the state of the script is no longer saved properly and the script data gets damaged, so you can't close a tease when a script is in progress and then pick up where you left off. Hopefully this will be fixed in a future release of GuideMe.

In the last few (many) weeks I have been playing with Technical Forms which was written using the script engine and Guideme 1.5. I tested it with the new version of the script engine in both Guideme 1.5 and 3.3 and it worked properly with only a very slight modification to the main xml file (see spoiler below).

figroll did something very interesting in this tease. The tease always restarts at the beginning, and the script file is reloaded every time the tease is opened, but it uses flags to control which items are available on the main menu so you can sort of pick up where you left off. Basically this creates a simple checkpoint system, and the tease allows you to resume at the most recent checkpoint, or at any of the previous checkpoints. It's a very slick way of doing it and nicely circumvents the saving issue in Guideme 3.3/3.4. I'm sure figroll didn't implement it this way for that reason, but his design just happened to be a nice solution to this problem. We can always learn new stuff seeing how others do things :-) .

If the saving issue is fixed in a future version of Guideme the new version of the ScriptEngine should work without change.

Workaround for the script data corruption issue in Guideme 3.3/3.4
Spoiler: show
In the main xml file of the tease, in the Settings section make sure that ForceStartPage is true.
In the pageload function of the "start" page add a call to ExitAllScripts() which is a new function in the new script engine version. A basic pageload function for example could be

function pageLoad() {
// Reset the script environment
ExitAllScripts();

// Load the script file
loadScript("SomeScript.scr");
}

Since the script is loaded fresh on every run of the tease you avoid the issue of the corrupted script data, but all other flags and variables etc. get restored properly. The script itself then just needs to properly initialize imagefolder etc and then use flags (or other variables) to decide where to begin or resume the script.

For example, your script could start with something like

ImageFolder Images

ifSet Checkpoint1 goto Checkpoint1
ifSet Checkpoint2 goto Checkpoint2
ifSet Checkpoint3 goto Checkpoint3
ifSet Checkpoint4 goto Checkpoint4
ifSet Checkpoint5 goto Checkpoint5

// Otherwise show the main menu, or start at the beginning of the tease, or whatever.
Regards,

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

Update: Script Engine v 1.51

Post by PlayfulGuy »

Since releasing version 1.5 of the script engine I have discovered and fixed a few bugs, and enhanced the Wait command. The first post has been updated, and you can also download the new version here: Download Script Engine v1.51.

Bug fixes and enhancements in this release:
  • The Wait command was not working. I had somehow left out the secondsUntil() function which is required for the Wait command.
  • I also updated the Wait command to accept optional "Image name" arguments. It had been coded to use the same image as the previous page, but this wasn't flexible enough. The second time I went to use the command in an actual tease I wanted to be able to specify an image so I added that ability.
    The Wait command now accepts the following syntax
    Wait duration unit [Image imagename] "Page Text"
    Wait until time [Image imagename] "Page Text"
    Wait until time tomorrow [Image imagename] "Page Text"
    The [Image imagename] arguments can also appear after the "page text" arguments
    If you use the Wait command note that
    Wait until 7 pm This Wait command uses the image from the previous page
    will not parse correctly. If the word "image" appears in the page text you must enclose the page text in quotes as in
    Wait until 7 pm "This Wait command uses the image from the previous page"
  • SECountEdge() is a function included in the script engine to count edges. For integration into larger projects this function will call the function CountEdge() if it exists. I fixed a typo where I was checking for countEdge with a small "c" instead of with a capital.
  • Updated filename handling so that if the first word is a wildcard image spec that doesn't match anything, or if it appears to be an image spec like myimage.jpg or myimage.gif (or .png) but the image doesn't exist it, it will be ignored and won't break the delay and or metronome arguments.
  • Updated the loadScript() function to reset variable TodaysEdgeCount if the date has changed. Previously this variable only got updated the first time you edged on the new date.
  • Fixed a bug where TodaysEdgeCount was not being initialized properly if it didn't exist.
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

Update: Script Engine 1.52

Post by PlayfulGuy »

I discovered that version 1.51 broke the handling of filenames that contain spaces. Version 1.52 fixes this. Hopefully. Image specs that contain spaces must be delimited with a comma.

If you've already downloaded version 1.51 you can just download the updated ScriptEngine.js attached to this post. Otherwise download the full version 1.52 package here: ScriptEngine 1.52

PG
Attachments
ScriptEngine.js.1.52.zip
(34.89 KiB) Downloaded 89 times
amythx
Explorer
Explorer
Posts: 36
Joined: Fri Sep 11, 2015 7:04 pm
I am a: Submissive

Issues using latest builds

Post by amythx »

Hi PG!

1. I ran into this trying out the GSE-tutorial's GotoCommand-part:

Code: Select all

gotoTarget: No Label or Page named GuidemeDemoPage was found.
2. This happens at the start of loading GSE:

Code: Select all

Script file "Scripts/myScript.scr" not found.
Are these related to the fact I'm running latest versions of both GuideMe and GSE?

Amy
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

Update to version 1.53

Post by PlayfulGuy »

I've discovered another bug in the script engine that affected passing arguments to another label. If the arguments are omitted, trying to use if notDefined(Arg1) to detect that didn't work properly. This is fixed in verison 1.53. The updated .js file is in the attached zip, or download the complete package from the first post of this thread.

Happy New Year all.
ScriptEngine.js.1.53.zip
(34.77 KiB) Downloaded 130 times
Last edited by PlayfulGuy on Sun Jan 06, 2019 5:22 pm, edited 1 time in total.
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: Issues using latest builds

Post by PlayfulGuy »

amythx wrote: Fri Jan 05, 2018 2:03 pm Hi PG!

1. I ran into this trying out the GSE-tutorial's GotoCommand-part:

Code: Select all

gotoTarget: No Label or Page named GuidemeDemoPage was found.
2. This happens at the start of loading GSE:

Code: Select all

Script file "Scripts/myScript.scr" not found.
Are these related to the fact I'm running latest versions of both GuideMe and GSE?

Amy
Which XML file are you loading in Guideme?

To run the tutorial, open GuideMe, then load GuidemeScripts.xml. You will be shown a list of the available scripts. You can then select Tutorial and you're off to the races. I just tested this in both Guideme 1.5 and Guideme 3.4, I am not able to reproduce this issue.

The only reference to "Scripts/myScripts.scr" is in ScriptTease.xml, which is a template you use to create your own standalone tease. It's not intended to be run "as-is". You need to edit that line and replace myScript.scr with the name of your script. I suspect you have edited this file and put in Tutorial.scr, but the tutorial requires other files that are not included by that template, specifically ScriptEngineExtras.xml. That file contains the GuidemeDemoPage that is being reported as missing, as well as some other pages meant to illustrate how to use some features and functions provided by the script engine. If you look near the end of that template file you'll find some other <Include> commands that are commented out. You would need to copy or edit one of those to be

Code: Select all

<Include file="Common/ ScriptEngineExtras.xml" />
to include the missing pages. Also, search that file for the string "**Edit" and you'll find notes about what to change at the indicated spots to make a customized XML file for your tease. More complete instructions are included in the comments at the beginning of ScriptTease.xml. However, this is not required to run the tutorial, you can view it as described above.

Hope that helps,

PG
User avatar
lmind
Explorer At Heart
Explorer At Heart
Posts: 341
Joined: Sat Nov 10, 2012 8:15 am
Gender: Male
Sexual Orientation: Straight
I am a: Submissive
Location: California, USA

Re: GuideMe Scripting Engine

Post by lmind »

In the scripting engine, is there an equivalent to the Math.floor() function? Or a way to invoke the Math.floor() function?
For example: X=Math.floor(290/100) would set X to 2.

Also...

Is there a remainder operator?
For example: X=290%100 would set X to 90.

Thank you!

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

lmind wrote: Sat Feb 03, 2018 2:28 pm In the scripting engine, is there an equivalent to the Math.floor() function? Or a way to invoke the Math.floor() function?
For example: X=Math.floor(290/100) would set X to 2.

Also...

Is there a remainder operator?
For example: X=290%100 would set X to 90.

Thank you!

-lmind
Hi Imind. Sorry for the late reply. Haven't been around Milovana much lately.

In version 1.5 and later of the script engine both of those will work.
You can use Math.floor() and then calculate the remainder as follows
x = Math.floor(290/100)
r = 290 - (100 * x)

or simply use the remainder operator as in

x = 290%100
or
x = 290 % 100

You can generally use any javascript function, operator or expression. I say generally only because I haven't tested them all, but as far as I know they all work.

Cheers

PG
coolkun
Curious Newbie
Curious Newbie
Posts: 3
Joined: Thu Apr 06, 2017 1:38 pm

Re: GuideMe Scripting Engine

Post by coolkun »

Hey guys!

I dowloaded this Scripting engine and I would like to try creating some tease, but I've a pretty basic problem - I can't run the tutorial (as well as some teases I downloaded). When I try to load GuidemeScripts.xml only "Something went wrong" appears. I'm not sure exactly which part of javascript log should I post here, but the last few lines look like this:

org.mozilla.javascript.EcmaError: TypeError: Cannot read property "index" from null (pageScript#24)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3951)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3929)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3962)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3981)
... etc

Any ideas what can cause this bug? I guess it's somewhere on my side, but I really don't have an idea where..
Thanks in advance for any advices..
philo
Explorer At Heart
Explorer At Heart
Posts: 831
Joined: Sun Jan 08, 2012 3:10 pm
Gender: Male
Sexual Orientation: Straight
Location: UK

Re: GuideMe Scripting Engine

Post by philo »

coolkun wrote: Wed Apr 11, 2018 6:06 am Hey guys!

I dowloaded this Scripting engine and I would like to try creating some tease, but I've a pretty basic problem - I can't run the tutorial (as well as some teases I downloaded). When I try to load GuidemeScripts.xml only "Something went wrong" appears. I'm not sure exactly which part of javascript log should I post here, but the last few lines look like this:

org.mozilla.javascript.EcmaError: TypeError: Cannot read property "index" from null (pageScript#24)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3951)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3929)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3962)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3981)
... etc

Any ideas what can cause this bug? I guess it's somewhere on my side, but I really don't have an idea where..
Thanks in advance for any advices..
Which version of GuideMe are you using? if it is the latest there has been as change to the way files ending in .js are loaded.
If you are using 0.3.6 then you wil need to delete the header and footer from the .js files.
So the following from the top of the file
<GlobalJavascript>
<![CDATA[

and the following from the bottom of the file
]]>
</GlobalJavascript>

Other than that I can't really help.


(note: the one in the first post in the GuideMe thread isn't the latest I am waiting for d3vi0n to update that)
Guita
Explorer
Explorer
Posts: 6
Joined: Wed Mar 14, 2018 11:55 am

Re: GuideMe Scripting Engine

Post by Guita »

Something people might find interesting:

I wanted to create branching dialogue in a tease, for instance, have the player edge for the mistress a random number of times, each time through a different path to avoid the tease becoming too repetitive.

A simple

Code: Select all

Edges = min..max
goSub EdgeLoop
// tease continues on...

// somewhere near EoF:
EdgeLoop:
	if ( Edges <= 0 ) return
	
	goSub RandomBranch<random min, max>
	
	Edges = Edges - 1
goto EdgeLoop
might've worked, but it can technically repeat itself before the loop exits, which annoyed me a bit. However unlikely it is to happen...

So I decided to try an "Array" and a fisher-yates (aka the first one people steal from stackoverflow) shuffle within the script engine:

Code: Select all

//-------------------------
// Edging block called from here, in the main body of the tease:
//-------------------------

EdgeAgainForMistress:

	mistressEdges = min..max // max needs to be equal to number of branches
	goSub EdgeForMistress
	
	// more teasing here in my case
	
	mistressEdges = min..max
	goSub EdgeHoldForMistress
	
	// optional loop back to EdgeAgainForMistress if the player's really keen
	// otherwise tease continues	

//-------------------------
// Subroutines in here:
//-------------------------

ShuffleArray:
	loopCounter = 8 // again needs to be the number of possible branches
ArraySetup:
	If ( loopCounter <= 0 ) goto ArraySetupEnd
	
	vArray<loopCounter> = loopCounter
	
	loopCounter = loopCounter - 1
	goto ArraySetup
ArraySetupEnd:
	
	loopCounter = 8 // again needs to be the number of possible branches
	
Fisher-Yates:
	if ( loopCounter <= 0 ) return
	
	Index = 1..loopCounter
	savedElement = vArray<loopCounter>
	vArray<loopCounter> = vArray<Index>
	vArray<Index> = savedElement
	
	loopCounter = loopCounter - 1
goto Fisher-Yates


EdgeForMistress:
	goSub ShuffleArray
EdgeLoop:
	if (mistressEdges <= 0) return

	branchNumber = vArray<mistressEdges>
	goSub EdgeBranch<branchNumber>
	
	mistressEdges = mistressEdges - 1
goto EdgeLoop


EdgeHoldForMistress:
	goSub ShuffleArray
EdgeHoldLoop:
	if (mistressEdges <= 0) return
	
	branchNumber = vArray<mistressEdges>
	goSub EdgeHoldBranch<branchNumber>

	mistressEdges = mistressEdges - 1
goto EdgeHoldLoop

// -----------------------------------
// Branches go here.
//------------------------------------

EdgeLoop1:
	// tease the player
return

EdgeLoop2:
	// tease the player a different way
return

EdgeHoldLoop1:
	// etc....
return

EdgeHoldLoop2:
	// etc....
return
Likely waaaaaay overkill, but I like the effect this gives. Also probably way faster and possibly easier to do in javascript, but I was curious to see if it could be done entirely in the script engine. Works well with the 8 branches I'm using in my tease, but takes a few seconds to shuffle a deck of cards or something like that...
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 »

Guita wrote: Thu Apr 26, 2018 12:36 pm Something people might find interesting:

I wanted to create branching dialogue in a tease, for instance, have the player edge for the mistress a random number of times, each time through a different path to avoid the tease becoming too repetitive.
Spoiler: show
A simple

Code: Select all

Edges = min..max
goSub EdgeLoop
// tease continues on...

// somewhere near EoF:
EdgeLoop:
	if ( Edges <= 0 ) return
	
	goSub RandomBranch<random min, max>
	
	Edges = Edges - 1
goto EdgeLoop
might've worked, but it can technically repeat itself before the loop exits, which annoyed me a bit. However unlikely it is to happen...

So I decided to try an "Array" and a fisher-yates (aka the first one people steal from stackoverflow) shuffle within the script engine:

Code: Select all

//-------------------------
// Edging block called from here, in the main body of the tease:
//-------------------------

EdgeAgainForMistress:

	mistressEdges = min..max // max needs to be equal to number of branches
	goSub EdgeForMistress
	
	// more teasing here in my case
	
	mistressEdges = min..max
	goSub EdgeHoldForMistress
	
	// optional loop back to EdgeAgainForMistress if the player's really keen
	// otherwise tease continues	

//-------------------------
// Subroutines in here:
//-------------------------

ShuffleArray:
	loopCounter = 8 // again needs to be the number of possible branches
ArraySetup:
	If ( loopCounter <= 0 ) goto ArraySetupEnd
	
	vArray<loopCounter> = loopCounter
	
	loopCounter = loopCounter - 1
	goto ArraySetup
ArraySetupEnd:
	
	loopCounter = 8 // again needs to be the number of possible branches
	
Fisher-Yates:
	if ( loopCounter <= 0 ) return
	
	Index = 1..loopCounter
	savedElement = vArray<loopCounter>
	vArray<loopCounter> = vArray<Index>
	vArray<Index> = savedElement
	
	loopCounter = loopCounter - 1
goto Fisher-Yates


EdgeForMistress:
	goSub ShuffleArray
EdgeLoop:
	if (mistressEdges <= 0) return

	branchNumber = vArray<mistressEdges>
	goSub EdgeBranch<branchNumber>
	
	mistressEdges = mistressEdges - 1
goto EdgeLoop


EdgeHoldForMistress:
	goSub ShuffleArray
EdgeHoldLoop:
	if (mistressEdges <= 0) return
	
	branchNumber = vArray<mistressEdges>
	goSub EdgeHoldBranch<branchNumber>

	mistressEdges = mistressEdges - 1
goto EdgeHoldLoop

// -----------------------------------
// Branches go here.
//------------------------------------

EdgeLoop1:
	// tease the player
return

EdgeLoop2:
	// tease the player a different way
return

EdgeHoldLoop1:
	// etc....
return

EdgeHoldLoop2:
	// etc....
return
Likely waaaaaay overkill, but I like the effect this gives. Also probably way faster and possibly easier to do in javascript, but I was curious to see if it could be done entirely in the script engine. Works well with the 8 branches I'm using in my tease, but takes a few seconds to shuffle a deck of cards or something like that...
Brilliant work, and I love seeing other people explore what the script engine can do.

One change I would make is to only do the array setup once at the beginning of the tease, and then just shuffle it as desired. There's no need to recreate it each time. Do the setup once, and then ShuffleArray is just Fisher-Yates. That will speed it up too.

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 »

I'm having trouble with calling a custom javascript function in the Scripting Engine. I know that it has to be used in an expression, so I have an unused variable "vTemp" and I try to call my function like this: vTemp = fChangeXP(20)

I've tried a variety of formats, but none are working and the text is displayed like ordinary text. Any help is appreciated.

I'm using ScriptEngine 1.50 and GM 0.3.7.

I have a separate issue using 1.53 with 0.3.7, the scriptengine.js file doesn't load (which is why I'm using 1.50).

thanks!

Update - ok, as usual, a simple user error. I had the javascript function calls inside the "{}" brackets. All I needed to do was move them outside the brackets. A three hour lesson.

Code: Select all

	01.jpg, 10, 120 {
		<vG1HeaderText>
		Hi, <vUserName>, I’m Alex. I’m glad you finally got here! Stroke 20 times.\n
	}
	vTemp = fChangeXP(20)
	vTemp = fUpdateHeaderText()
Last edited by bobhill on Thu Sep 27, 2018 2:31 pm, edited 1 time in total.
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 »

I am calling a script from a GM page.

On the final page of the script, I have buttons to exit, such as "North", "South" and I have GM pages that these buttons should go to. Here's the updated code:

Code: Select all

Leave:
	set visited_AlexGrey
	vTemp = fUpdateEncounter(vModelName)
	vTemp = fUpdateHeaderText()
	11.jpg, {
		<vG1HeaderText>\n
		gt Now leave! You can go West or North.. \n
		button North, onScriptExit = "Dorm121"
		button West, onScriptExit = "Dorm112"
	}
	Exit
I've tried various methods - and they do go to the correct GM page, but for some reason, the text portion of ShowScriptPage is displayed ("Something went wrong") before proceeding to the target GM page called from the script. I don't see anything in the js or gm logs that indicate why this is happening. I've stepped through the js code and and ShowScriptPage appears to be working. It recognizes the "Exit" command in the script and goes to the correct target GM page - it's just that ShowScriptPage displays the <text> component before 'target' is loaded.

This is the part of ShowScriptPage that is being executed. Upon the 'return' command, is when the text is displayed.

Code: Select all

        // Check for an Exit command (exit the script)
        if ( page.text == "exit" ) {
          // Exit the script and go somewhere else
          jscriptLog(myName+"Exiting script " + page.filename);
          target = ExitCurrentScript();
          overRide.setPage(target);
          return; // And go do it.
        }
EDITED: Updated script code, identified code in ScriptEngine.xml, and combined with next post


Update: this happens with Script Engine 1.50 and GM 0.3.7 combination but not with Engine 1.50 and GM 1.5.32b, so I guess it's a compatibility issue in one of the GM updates?
Last edited by bobhill on Thu Oct 11, 2018 10:20 pm, edited 3 times in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests