thnx for all this @CJW its a perfect christmas present
Now it works, thanks!
Glad to hear it, thanks for the headsup. Iāll try to work in a more intuitive error message for future iDevice users!
you are awesome
is the new name your save thing out yet?
@akatsuki9344 Thank you - Iām just glad I can help!
@Nocturnal_Stillness
If youāve yet to encounter any problems Iāll get working on the compatibility, ready for public use.
yeah i tried it on unnatural it works fine
Thereās an IE9 bug (IE8 seems to work fine believe it or not) that results in the following error:
http://gyazo.com/fcea94ccb95b4c5380681e95a3b7b894.png?1356885980
Everytime you try to do a āshownā save.
Iām trying to work on a solution but itās difficult seeing as the problem might be in the alertify.js library, not my own code.
Might have to revert back to standard js prompt boxes.
so when is the new type of save system coming?
Wow, Iām glad this was bumped as I hadnāt seen it. I guess itās on the wiki too and I missed it? Should be stickied for certain.
Typical that IE9 has issues with it, however, I think Iāll try implementing this once Iāve reached the end of the chapter on my wip.
@CJW - thanks for this, where would COG be without all of your helpful hacks/fixes/tips?
@akatsuki9344 It shouldnāt be too long now, all the functionality is there, I just want to ensure it catches incompatible browser configurations and problems without crashing the game.
@bawpie Iām really glad you like it! But it isnāt on the wiki just yet, and only the basic version is available to download.
@CJW - read the whole thread after posting (dāoh) so I see a more advanced version is in the works. Iāll stick with what I have for now, but will certainly implement the flashier version when itās out!
@Nocturnal_Stillness - thatās really nice, canāt wait for it to be released. Btw, you might want to update your game link on the wiki as itās broken
Looking for something that allows players to save āon the flyā (like save.js) but with multiple slots? Try the smPluginMenuAddon.js
Release - smPlugin.js
The new āframeworkā save system is done.
https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/code/save-framework/smPlugin.js
I donāt currently have the time or willpower to write up proper documentation for it.
Thereās a demo here, which should be enough to grasp the general concept:
https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/code/save-framework/index.html
Demo Code
https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/code/save-framework/scenes/startup.txt
Instructions and Basic Info in a Nutshell
-
Uses browser localStorage to store/restore generated between browser sessions on the same computer/device. Older browsers, some mobile browsers etc do not support localStorage.
-
If a browser doesnāt support localStorage the system shouldnāt stop your game from working, itāll only inform the player they canāt save - not actually ācrashā - let me know if it does.
COMMANDS:
*sm_init
Must be used before any other sm commands, right at the top of your first scene file is ideal. This initializes the system, checks for previous saves etc.
It takes two arguments, the name of your game and the number of save slots.
Try to choose these two values carefully when you first implement this system and stick with them. Changing the game name will result in loss of your playerās saves.
*sm_init mygame | 5
*sm_save
Does exactly what it says on the tin. Saves the game (if it can).
This one takes three arguments, the first two are compulsory and the last one is optional.
The first one is the slot number the game should save to, it HAS to be a ānumberā and it has to be a WHOLE number - it also has to be between 0 and your number of slots (as declared with sm_init).
*sm_save 3
The second argument on sm_save is the type of save, thereās two:
Hidden Saves & Shown Saves
Hidden saves will just save like that without any input from the player, nor any notification that a save has taken place.
Shown saves will prompt the player to save (but he can decline), itāll also allow them to rename a save, if they so wish.
Shown Save to slot 3
*sm_save 3 | true
Hidden Save to slot 3
*sm_save 3 | false
The last argument is optional (the above code examples will work) and is the save name. For both shown and hidden saves you can provide a ādefaultā name for a save - this is particularly useful for hidden saves, where the player cannot rename them themselves.
For example weāre coding our game and come to the end of a chapter - we donāt want to ruin the experience with a big ugly āplease saveā popup, so weāll do a hidden save. However, we want the player to know (when loading) exactly where he is - he wonāt remember āsavingā this one after all.
Hidden Save to slot 2 with a default name
*sm_save 2 | false | End of Chapter 5 - Close Call
Now when the player tries to load a save, this one will appear with that name.
If you donāt provide a default name a time and date will be used instead.
*sm_load
Much like sm_save, sm_load does exactly what you think it does; loads saves.
It takes the same two compulsory arguments as sm_save, the slot number from which it should be loading and the hidden/shown parameter.
Force load a game from slot 3
*sm_load 3 | false
Prompt the player to load a game from slot 3
*sm_load 2 | true
*sm_delete
Takes one argument, the slot number.
*sm_delete 1
*sm_delete 2
etcā¦
Again it has to be within the bounds of your defined number of slots, so watch that.
Deletion will ALWAYS prompt the player you canāt silently delete saves, yet. I might add it in if thereās popular demand.
Note on Slots
THINK! This is a do-it-yourself framework, not a automatic system like the save.js - There are many ways and means by which you can use these commands. Experiment a little, find what works for you.
If youāre going to mix manual and āautomaticā saving, keep the slots separate. Players wonāt be happy if youāre constantly overwriting their manual saves with automatic ones.
Say slot 0 is the automatic slot, donāt allow manual saves to slot 0. Simples.
Have fun, report bugs, make cool games etc etc ^^ā
Oh yeah⦠The system uses the typical js notifcation boxes, not alertify.jsā because IE kept throwing a tantrum and Iād personally rather have the functionality over the aesthetic appeal.
finally you rock !!! thanks very much
Fantastic job, @CJW. Thanks, especially, for making it so flexible. Iāve been tinkering with the system for a little while and wanted to confirm a few limitations.
-
Canāt load mid-scene?
I can easily save anywhere and load from anywhere, but the game always loads at the beginning of the scene where it saved. -
Canāt use variables to name saves?
For instance, using the player-chosen character name as the default save name causes an error.
Iām not complaining about either of these things. In fact, Iāve already more or less worked around them. I just wanted to make sure itās not my own stupidity overlooking something obvious.
@CS_Closet you can load mid scene I did it in unnatural it autosaves at a midway point and you can load it up from that point.