iiYO Community

Full Version: Trigger a save/load screen at game start
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to use a separate html page for the game main menu, with start and load buttons (links) on it, linked to the WS game. Is there a way to open the save/load screen on startup when the load button was clicked from another page. For example, by reading the "get" parameter (like .../index.html?action=load).

Guest

Edit: Woops, I should read the question properly...

You could put something like this at the end of the
Code:
<body>
tag in the HTML page where the game runs:

<pre>
Code:
<script>
(function () {
    if (location.href.match(/action=load/)) {
        WSE.functions.savegames(game.interpreter);
    }
}());
</script>
</pre>

Does this work?

Guest

I got an error "game is not defined", but then I put that inside the funcion just before "game.start();" and it works!

Thanks! Big Grin