Currently using Firefox 17.0.1
I had originally neglected to update my Firefox, but even after doing so I canāt replicate the issue.
Some options:
- Make sure save.js is the last script you include in index.html
- Redownload save.js (you may have got a very unlucky 10s gap version where I noticed a typo or something).
- Try another browser
- Post the firefox j/s console errors (if that means anything to you)
In the j/s console iām getting a āTypeError: Button is undefinedā on line 95 of the āsave.jsā file.
The problem seems to be in this area in save.js
function toggleAutosave(autosavebutton) {
if (saveMod.autoSave == false) {
button.innerHTML = āDisable Autosaveā;
saveMod.autoSave = true;
alert(āAutosave Enabled!ā);
return;
}
else {
button.innerHTML = āEnable Autosaveā;
saveMod.autoSave = false;
alert(āAutosave Disabled!ā);
return;
}
alert(ātoggleAutosave Error - Please inform the game developer!ā);
}
if I change the button.innerHTML to self.innerHTML it seems to work but the text inside the buttons does not change anymore.
Iām almost certain that youāve managed to get a dodgy file there, try redownloading save.js and replacing your current one. Iām 99% sure this will sort it, let me know if it doesnāt though.
EDIT: Yes, thatās an old file. Either redownload save.js or replace (autosavebutton) with (button).
Iād recommend the former as there may be other hidden issues with that version.
Donāt change it to self.
I tried re-downloading it and still experienced the same problem, iāve altered the file using my (admittedly minimal) knowledge of JS and it now seems to be working.
Iāve put the amended file here
http://www.4shared.com/document/A7hL_lxq/save.html
incase you fancy a look CJW?
I donāt have a 4shared account, donāt really want one either and you canāt seem to download it without one.
Iād love to take a look though, is there anywhere else you can upload it, dropbox, webs, mediafire or something?
Pastebin is very good too (just copy/paste, give link).
Please find below the public link to a sample game using the amended JS code that I am currently using for autosave in my game
http://dl.dropbox.com/u/129688634/sample%20autosave%20game/mygame/index.html
please note that I have disabled the messages for āenableā and ādisableā autosave deliberately because I donāt intend to have them in the finished game that I am working on.
And here is a dropbox link to the amended save.js file that I am using currentlyā¦
http://dl.dropbox.com/u/129688634/sample%20autosave%20game/save.js
It would have been easier to just replace autosavebutton with button rather than all those other buttons with autosavebutton, but Iām glad you got it working.
Sorry about the bork!
No worries, itās a very useful system (and is helping speed up my testing of my current planned game no end) - also itās helping me to slowly learn a bit about javascript so itās all good
Iāve trimmed it down a bit to use ābuttonā rather than āautosavebuttonā as described and is all working fine - thanks very much for the advice
Thank you very much for reporting that, after a closer look at my files I discovered the problem.
There are different code blocks that fire depending on your browser and whether your playing locally or online, in the local block Iād neglected to pass the button as a parameter, hence the error.
I didnāt pick up on it as I was using the dropbox (online) hosted version to test it.
Dāoh! Seems extremely appropriate right about now
Iāve fixed it anyway, thanks again - thereās no telling how long something that obscure might have continued to go on unnoticed!
If anyone has downloaded the enable/disable update before this post, please re-download it!
One thing Iāve learnt is that if you get an error and choose to load the game you get a different error message. But you only have to fix the first error to sort both out.
Iām not entirely sure what you mean?
I think that @Nocturnal_Stillness means that, if you encounter a game stopping error and then attempt to load a saved game, it produces a different error message (presumably because it is trying to continue the same scene?); I have found that if you just load it again after that then the load function rolls the game back to slightly earlier and is normally error free.
When I was testing I got an error about indentation so I clicked the load button to reload the last save and I got an error talking about a missing choice. The line mentioned had no choice but once I fixed the indentation error the choice error didnāt reappear.
@Largejo @Nocturnal_Stillness Ah, well the system saves every page - so naturally if you get an error on a page and then try to reload (said page), it is going to break, no question about itā¦ Sadly thereās not a lot I can do about that
Iām interested in your situation though Largejo, Iād expect it to behave more like with Nocturnal_Stillness.
It might be that errors are thrown by choicescript before the save is made, depends on the order of function call?
LOL mine isnāt a situation so much since it works great for me whilst tested my WIP game; the way mine seems to work is that, if I have 2 scenes for example (scene1 and scene2) that follow on from each other and scene2 has a game stopping error, when I load the first time it will reshow the error, if I reload it again then this time the save game will roll back to scene1.
This isnāt a problem for me, quite the contrary, it works very well and is allowing me to test sections of the game without having to play right through from the start everytime
Thatās cool if admittedly unintentional functionality ^^
It might be because youāre using the enable/disable toggle version, whereas Nocturnal_Stillness is not.
I didnāt think you could sort it as the save works fine. Just wanted to let you know as I spent a good hour trying to locate the second error yesterday before I realised what was causing it.
Are you still thinking about save slots?
@Nocturnal_Stillness Yes, though how Iād include them Iām not sure.
I donāt really think 3*3 buttons is going to work very well, but to do anything more complicated like integrating it into the choice boxes requires a more complex installation or the overwriting of half the scene.js fileā¦
Any ideas on that front?
Iām happy to do it - Iām just not sure how you guys would want to go about it.
I presume the simple installation/un-installation is something you want to retain.