I have another question: is it possible to create a button that randomly chooses between three(or more) non-consecutive pages like page2, page15 and page32 or pages with different names like Red, Green door and Blue portal?(fake names just to give you an example)
Any idea about why I can't play the script? I checked the XML you attached and they're identical.
tigrotto wrote: ↑Mon Oct 08, 2018 11:21 am
I have another question: is it possible to create a button that randomly chooses between three(or more) non-consecutive pages like page2, page15 and page32 or pages with different names like Red, Green door and Blue portal?(fake names just to give you an example)
Yes that should be possible with javascript. The first solution that comes to my mind would be an array with the possible pages from which one would be randomly chosen than given back the page as an variable to the target of the button.
I pu an example .js file in the zip
The page in the main xml would look more like this
Ambossli wrote: ↑Mon Oct 08, 2018 1:14 pm
Yes that should be possible with javascript. The first solution that comes to my mind would be an array with the possible pages from which one would be randomly chosen than given back the page as an variable to the target of the button.
Thanks. It was more curiosity rather than something I really need at the moment, but who knows...
Ambossli wrote: ↑Mon Oct 08, 2018 1:14 pm
you could look at pilgtrimquest it uses quite a bit of javascript
I will, although I'm pretty sure I won't understand much...
Not sure if it's ok to ask here, but PG has been gone and I really could use some help. Also apologies for the cross post.
I've been reading the prior posts regarding 0.3.3, 0.3.4, 0.3.6 and 0.3.7, trying to determine which version is ok to use with Script Engine 1.5 (or 1.53). With Script Engine 1.5 and GM 0.3.6 or 0.3.7, when I exit a script back to GM, the page ShowScriptPage text block displays (Something went wrong), but then GM proceeds to the correct GM page (so the text display is extraneous, but does not crash the program). This does not occur in 0.3.3 or 0.3.4. But I think that there are saving problems with 0.3.3 and 0.3.4 that were fixed in 0.3.6? Also, I read a memory/image loading issue exists in 0.3.4? My head hurts just typing all this!
I could go back to earlier GM versions, but I hate to give up the javascript debugging in GM. I also need certain features added in Script Engine 1.5, so can't revert with it.
lawman5297 wrote: ↑Wed Oct 03, 2018 7:23 pm
philo, Could you use the onclick property of a XML button to call a global JS that would load the current page (into a variable?) and then reload that page when the button is clicked? This way I could just insert the button on each page without the need to edit each one. What would the code for this be if it is possible?
The easiest way is to go to a dummy page and the use the page load on that page to go back to the previous one.
(the count stuff is just so you can see it is working)
So a page with overRide.setPage(guide.getPrevPage()); in the page load will bounce you back to the page you came from
I am back on this or perhaps this is different. I want wait until the page changes then return to the previous. How can I do that? The reload feature works great but after using it what I really need to be able to do is return to previous. THX
You could use a var and get on every page the "guide.getPrevPage", so when you click on the reload button and redirect to an other page the var has still the page you want to return?
Page 1
This page you want to return
Page 2
var lastpage = guide.getPrevPage
Button reload
Page relaoad
Using the var lastpage for next page -> jump to Page 1.
Just an idea, not sure if this will work.
You are just changing the point where you set the var for the previous page and do this on every page again even if the button will not hit on the next page.
lolol2 wrote: ↑Sat Oct 13, 2018 10:11 am
You could use a var and get on every page the "guide.getPrevPage", so when you click on the reload button and redirect to an other page the var has still the page you want to return?
Page 1
This page you want to return
Page 2
var lastpage = guide.getPrevPage
Button reload
Page relaoad
Using the var lastpage for next page -> jump to Page 1.
Just an idea, not sure if this will work.
You are just changing the point where you set the var for the previous page and do this on every page again even if the button will not hit on the next page.
Would rather not add to every page if possible. As in the reload philo helped me with I would like to just be able to add a button, much easier. Philo, lolo2, ideas? THX
lawman5297 wrote: ↑Sat Oct 13, 2018 2:34 am
I am back on this or perhaps this is different. I want wait until the page changes then return to the previous. How can I do that? The reload feature works great but after using it what I really need to be able to do is return to previous. THX
Try something like this.
It saves the previous page when you click reload
Then goes back one page.
This is a problem if you come from the reload page and then click the reload button again
(It then just starts looping back to reload over and over)
If you click reload twice in a row it will keep you on the same page.
If you want to go back multiple pages, it is possible but gets more complex, you have to maintain a list of pages and then look up the page you came to reload from, to work put where it needs to go back to.
lawman5297 wrote: ↑Sat Oct 13, 2018 12:40 pm
And I would guess since it broke the variable audio and does not reload the previous page I have made some errors. Assist? THX!
If you want to send me a copy of the tease xml I can have a look what is going on.
It is easier to do if I debug it.
lawman5297 wrote: ↑Sat Oct 13, 2018 12:40 pm
And I would guess since it broke the variable audio and does not reload the previous page I have made some errors. Assist? THX!
If you want to send me a copy of the tease xml I can have a look what is going on.
It is easier to do if I debug it.