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 »

spdrmn55 wrote:Can you give me some information on how to use variables? Can I use a variable to set the delay or metronome? How do I change a variable? Like if I wanted to add 20 to my variable. Thanks I'm really enjoying the simplicity of writing a tease using this!
Variable support in the script engine is still very limited. At present all you can do is set a variables value using a statement like
myVariable = somevalue
or delete the variable using a statement like
myVariable = ""

The main use is to communicate settings between scripts and regular GuideMe pages.

You can't do any math operations yet like adding 20, you can only define a new value by assigning it as above (myVariable = newvalue)

Variables can not be used for setting delays or metronomes, You can use the <RandomFrom ...> or <ChooseFrom...> tags, but that's all.

I do plan on adding basic expressions so you can do stuff like
myVariable = myVariable + 20
but I haven't had the time and energy to work on that lately. I've been busy with other stuff.

Glad you like it so far. I'd love to see some samples of scripts posted by others, so let's see them!
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 »

Hi All,

I've been away from Milovana for a bit. It's been a busy and stressful time. But, I have updated the script engine with support for basic expressions like "count = count + 1" and with new commands for playing video and setting the video folder.

I have updated the first post of this thread with the link to the new version.

Note regarding video support:
There is a subtle bug in Guideme 0.1.3 that causes video to fail if you play a video clip on two pages in a row. It seems to be a timing issue and I'm not going to bother Philo with it until the new release of Guideme comes out. I'll test again and go from there. Meanwhile, video does work, but you have to play some video, go to a non-video page, then play more video. If you do two video segments in a row the second video doesn't play, and no further video will play after that.

Modify at will:
And by the way, anyone that wants to is welcome to modify the script engine and release their own updates. I can't promise that I will continue work on this project from here on as life is taking some silly turns for me. Philo has indicated he may incoporate this into Guideme in the future, but meanwhile anyone has permission to modify it at will.

PG
User avatar
xman911
Explorer At Heart
Explorer At Heart
Posts: 390
Joined: Wed Feb 08, 2012 2:39 am
Gender: Male
Sexual Orientation: Straight

Re: GuideMe Scripting Engine

Post by xman911 »

Is this capable of making TeaseMe v0.1.4 compatible teases?!
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 »

xman911 wrote:Is this capable of making TeaseMe v0.1.4 compatible teases?!
No. It requires Guideme 1.3 or higher and doesn't work with Teaseme.
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 »

Have a super, super tiny fix in the scriptengine.js

Around line 1460, the regex to replace <myName> and others just needs a 'g' in there to do it globally and replace all instances of it. In one page if you use <myName> twice it'll only replace the first one.

Code: Select all

BEFORE:
text = text.replace(/<myname>/i,"[span]myName[/span]");

AFTER:
text = text.replace(/<myname>/ig,"[span]myName[/span]");
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:Have a super, super tiny fix in the scriptengine.js

Around line 1460, the regex to replace <myName> and others just needs a 'g' in there to do it globally and replace all instances of it. In one page if you use <myName> twice it'll only replace the first one.

Code: Select all

BEFORE:
text = text.replace(/<myname>/i,"[span]myName[/span]");

AFTER:
text = text.replace(/<myname>/ig,"[span]myName[/span]");
Thanks. The same actually applies to the adjacent lines that handle <mySubname>, <mistress1> and <mistress2>.

Glad to see you're still interested in this project. I've been working away on my other major project, and I'm thrilled to see that the new version of Guideme has been released. Didn't see that till just now. I'll be checking that out real quick. There are some of the new features I really could use.

Cheers!
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 »

PlayfulGuy wrote: Thanks. The same actually applies to the adjacent lines that handle <mySubname>, <mistress1> and <mistress2>.

Glad to see you're still interested in this project. I've been working away on my other major project, and I'm thrilled to see that the new version of Guideme has been released. Didn't see that till just now. I'll be checking that out real quick. There are some of the new features I really could use.

Cheers!
I changed them there as well :)

And I'm hugely interested in this still. I don't know if you saw my other thread with the maze tease, but I've been plowing away at that for a few weeks now, and the only reason I can stomach writing it is because it's driven by the script engine. So I have my page that is kinda like the scriptengine page you have where you navigate the maze, then when you encounter something it calls loadscript and sends you to the script engine, and then I exit back to my maze navigation.

I even kinda fudge it a bit because sometimes I want to jump to a label in a script, so before I load the script I also set a flag for where to jump, then have sort of a big if statement at the top to jump down to where I want to start. It's really working out well so far, though I only have my first encounter half way done.

I guess it'll be a while until I'm done, but really the script engine is working out great, really good stuff!

Also, big other project? Sounds good ;)
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 »

Philo, I had another audio question. This is an area I don't know too much about, but I'm noticing I can't play any audio and the metronome at the same time.

Is it possible to somehow get separate audio threads going so I could play two tracks at once? It would even better if I could add a 3rd ambient or song track of some sort over multiple pages.

I may just cut out audio queues from what I'm doing or just use them differently than having the metronome on the same page, I can work around, but that might be a nice future feature if possible.
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 »

desertfox wrote:Philo, I had another audio question. This is an area I don't know too much about, but I'm noticing I can't play any audio and the metronome at the same time.

Is it possible to somehow get separate audio threads going so I could play two tracks at once? It would even better if I could add a 3rd ambient or song track of some sort over multiple pages.

I may just cut out audio queues from what I'm doing or just use them differently than having the metronome on the same page, I can work around, but that might be a nice future feature if possible.
hmm interesting question.
Current logic replicates what TeaseMe does so that teaseme teases will still work.
If there is a Metronome it will ignore Audio
If there is no Metronome then it will play the first valid Audio it finds for the page (override audio from javascript is looked at first then the nodes from the xml)
Perhaps adding a flag to the guide to allow multiple audio and a metronome beat, so teases without would continue to work like teaseme.

Audio is already spun off into another thread (running vlc to play the audio), so there is no technical reason why multiple audio files couldn't be played, getting them to be in sync and start at the same time would be difficult.
Metronome uses java midi so again I don't see why it wouldn't be possible to play a beat and audio at the same time, again getting them in sync may be difficult.

Keeping track of multiple audio and stopping them if the page changes or the program exits gets more difficult, so I would have to think about how to refactor the code, but I think it would be possible.

Adding a don't stop on page change flag to audio should be fairly simple, it would play the audio until it finished, or it hit a page that had a new audio file or the program exited.
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 »

philo wrote:hmm interesting question.
Current logic replicates what TeaseMe does so that teaseme teases will still work.
If there is a Metronome it will ignore Audio
If there is no Metronome then it will play the first valid Audio it finds for the page (override audio from javascript is looked at first then the nodes from the xml)
Perhaps adding a flag to the guide to allow multiple audio and a metronome beat, so teases without would continue to work like teaseme.

Audio is already spun off into another thread (running vlc to play the audio), so there is no technical reason why multiple audio files couldn't be played, getting them to be in sync and start at the same time would be difficult.
Metronome uses java midi so again I don't see why it wouldn't be possible to play a beat and audio at the same time, again getting them in sync may be difficult.

Keeping track of multiple audio and stopping them if the page changes or the program exits gets more difficult, so I would have to think about how to refactor the code, but I think it would be possible.

Adding a don't stop on page change flag to audio should be fairly simple, it would play the audio until it finished, or it hit a page that had a new audio file or the program exited.
Whoops, I totally put this in the wrong thread, meant to be in the main one.

What I was trying to do was just use metronome stroking and then occasionally play a short clip to go along with it like 'stroke faster', so timing wouldn't be that important. For the longer running thread the idea was either background music or ambient audio. For example the maze thing I'm doing I have a generic ambient clip that everytime you move a step it picks a random start point and plays from there, so you don't hear the same 10 seconds each step.

For the dialog in the script engine since I can't figure out how to do the same thing, I just took the audio file and cut it myself in random places, then just manually dropping in like fireplace1 2 or 3 on each page. That part would be really nice to just start and loop a track, and tell it when to stop playing.

That does rule out using a song, since it jumping around would be too telling, so having some sort of on/off main background thread would be neat since you could do an epic soundscape or club music or whatever fits the teases setting.
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 changed them there as well :)

And I'm hugely interested in this still. I don't know if you saw my other thread with the maze tease, but I've been plowing away at that for a few weeks now, and the only reason I can stomach writing it is because it's driven by the script engine. So I have my page that is kinda like the scriptengine page you have where you navigate the maze, then when you encounter something it calls loadscript and sends you to the script engine, and then I exit back to my maze navigation.

I even kinda fudge it a bit because sometimes I want to jump to a label in a script, so before I load the script I also set a flag for where to jump, then have sort of a big if statement at the top to jump down to where I want to start. It's really working out well so far, though I only have my first encounter half way done.

I guess it'll be a while until I'm done, but really the script engine is working out great, really good stuff!

Also, big other project? Sounds good ;)
I had not seen that thread so thanks for pointing it out. I have intentions of implementing much of that functionality in the script engine - load a script and specify a start label. Ideally you could set a variable in javascript like

Code: Select all

var startLabel = "StartPoint10"
and then in the script just start it with

Code: Select all

goto startLabel
. The processing of the goto command just needs to be updated to check if the target matches a defined variable as well as a page or label.

And yeah, it will be a while before that other project is ready for the public, but I'm making good progress. I'm mostly building it for myself, so that keeps me motivated. Integrating the script engine is an important component.

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

I think making what you like is really the only way to make something good. If there is one thing I can get out of the feedback I see on various projects here, it's that each person's taste in girls or pacing or anything else is so varied, it is impossible to find any kind of 'center' on content choice.

I've decided that was what I'm going to use to judge what I put in the maze thing. I'm surprising myself by working a bit on it each night (some nights more productive than others ;) ), I think because of that same thing. I'm also kind of a huge gamer, and love world building, so I'm sort of slowly building out lore in my head and doing a few game like elements in it, while I've been leaving the tease sections as placeholder. I don't think that's ending up what people would be looking for in a maze tease but I think its kind of what I'm looking for and maybe someone else will like it.

Honestly I don't think I'd be working my project as much without the script engine in there, so again a huge thanks for making it. So soldier on, I think whatever you are making has got to be really interesting and look forward to seeing what it is.
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 »

A new version of the script engine (version 1.2) is now available. See the first post of this thread for the link. The new version has been modified so that a scripted tease can be closed and then opened again later and it will continue from where it left off. This supports longer teases like all day teases, or more elaborate designs like mazes that might take several play sessions to complete.

Have fun, and please let me know if you find any issues.

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 »

Might have found an issue, though could be doing something wrong. It does come back to the page but it seems to not have saved the audio or buttons when it comes back. On the page I was testing it just had local buttons and an audio above the page definition.

I looked in the logs real quick and the page.buttons.length value was printing out to 0, so it must lose it somewhere in there, I'm not quite sure where to track that down. It gets the images and texts ok though on the reload.

Just to double check the update, I replaced the scriptengine.xml and the scriptengine.js files, and in the main xml that you load from guideme I left the same as I had it before like this:

Code: Select all

 <Page id="scriptengine"> 
  	  <javascript>
  		<![CDATA[
  		function pageLoad() {
       			 var encounter = scriptVars.get("encounter");
			loadScript(encounter);
		}
  		]]>		
  	  </javascript>
      <Text>
      Something went wrong. Check the GuideMe jscript.log
  	  </Text>      
  	  <Image id="SetInCode" />
	<Button target="maze_main">Back</Button>
      <Delay target="runScript" seconds="0" />
</Page>
I wouldn't kill yourself on this either or stop your momentum too much on your other project if it's getting in the way, people shouldn't leave in the middle of a script anyhow ;)
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:Might have found an issue, though could be doing something wrong. It does come back to the page but it seems to not have saved the audio or buttons when it comes back. On the page I was testing it just had local buttons and an audio above the page definition.

I looked in the logs real quick and the page.buttons.length value was printing out to 0, so it must lose it somewhere in there, I'm not quite sure where to track that down. It gets the images and texts ok though on the reload.

Just to double check the update, I replaced the scriptengine.xml and the scriptengine.js files, and in the main xml that you load from guideme I left the same as I had it before like this:

Code: Select all

 <Page id="scriptengine"> 
  	  <javascript>
  		<![CDATA[
  		function pageLoad() {
       			 var encounter = scriptVars.get("encounter");
			loadScript(encounter);
		}
  		]]>		
  	  </javascript>
      <Text>
      Something went wrong. Check the GuideMe jscript.log
  	  </Text>      
  	  <Image id="SetInCode" />
	<Button target="maze_main">Back</Button>
      <Delay target="runScript" seconds="0" />
</Page>
I wouldn't kill yourself on this either or stop your momentum too much on your other project if it's getting in the way, people shouldn't leave in the middle of a script anyhow ;)

I'll look into this and get back to you. Pretty sure I know what's happening. And don't worry about taking me away from my other project. It's a long term thing (been at it a year already) and I would have encountered this issue soon enough myself and had to fix it anyway.

PG
Post Reply

Who is online

Users browsing this forum: heftigeruser and 48 guests