Auto save when playing online?

OurJud
30 Oct 2016, 17:21

Is this a function of online play or do I need to provide a 'save' link somewhere on my page?

It's a Text Adventure but I've removed the command function to make it behave like a Gamebook, meaning the player can't simply type 'save'.

I found this, which is exactly what I want to do, but I can't make head nor tail of her instructions. Can anyone translate to English, please?

http://textadventures.co.uk/forum/quest/topic/4685/autosave#41117


The Pixie
30 Oct 2016, 18:09

There is a save button that will get added to your game anyway. Do you want more than that?

She is talking about adding a timer that will trigger every so often to do a save, which is what an autosave is, but is not quite what you describe. If you look at the tutorial, it uses a timer to control a bee; it should be just like that, but does request (RequestSave, ""). And with a rather longer delay.


OurJud
30 Oct 2016, 20:08

The save button won't be there because I've used CSS to hide that ugly blue bar where the save button sits.

The autosave timer option is just what I'm after, but I get the impression there's more to do than she explain in her tutorial. For instance she says enter the value to control how often the autosave kicks in, but she doesn't explain where I enter the value.


OurJud
30 Oct 2016, 20:22

Right, this is what I did.

I clicked on my first room, then selected the 'scripts' tab, and entered:
request (RequestSave, "")
in the 'Before entering the room for the first time'

Then I clicked on 'Game' in the left pane, selected the 'script' tab and entered:
_EnableTimer (timer1name)
SetTimeout (1) {
DisableTimer (timer1name)
}
_
into the 'start script' section.

Then I uploaded the game, but get this error when I run it:

Error running script: Error compiling expression 'timer1name': Unknown object or variable 'timer1name'


OurJud
01 Nov 2016, 23:50

I'm bumping this as its something I need to know I can get working properly before I put too much work into this thing.

Why can't I just add a line of code somewhere that does an autosave every X number of minutes?

I know the one above is supposed to do that, but I can't make head nor tail of her instructions.