most great games have multi save slots
either one can use multiple of each purpose of game attributes or using list.
multi save may make the game fill with far more game attribute than one save slots
solution 1: using list
solution 2: using code:
multi save slot with the same actor type , one may need to use one more game attribute to indicate the save slot.
applies to the load game button:
the "new crap" thing is optional but it can fix the issue that the value goes NaN while the value is still available.
solution 1 - in this case, 6 save slots
so for the "new crap":
one will just have to intilalise some the game attributes, otherwise part of the game attribute "list" to its initial state or desired start. Set game attributes or replace items in the list
the way one get list (make sure the value is available)
changing list such as addition (make sure the value is available)
using the game attribute the usual way, not recommended to fill the game attribute blanks the traditional way
score0
score1
score2
score3
score4
score5
in this case
in this case, for games with a lot of scenes and multiple save slots, so by using list, one can do so..But, beware, make sure the values in use in both lists is available otherwise it will not work. In this case, part of the camera behavior
solution 2 - save slot create "new game button", in this case,5 save slots
applies to the save slot |
applies to the "play button" or "load game button" which creates the "save slot" |
by using new way to fill the game attributes, it is less frustrating.
http://stencyl-nator.blogspot.my/p/blog-page_3.html
of course, the save won't work without
for values of each save slot with list
getting game attribute, can also be applied for various features besides multiple save slots
getting game attribute as list for code, since Stencyl 2.0 does not contain certain math function like Math.log() in snippet form
- its basic skeleton structure - (any list Attribute as Array)[list item Number]
- getting Game Attribute as list - (getGameAttribute("character Stats HP") as Array) [getGameAttribute("save slot") as Number]
- getting Game Attribute from fillable blanks as list - (getGameAttribute( _anyTextAttribute) as Array)[getGameAttribute("save slot") as Number]
Frustrasting "structural" errors and will not run
- (getGameAttribute(_AnyTextAttribute) as Array [Any numbers])
- (getGameAttribute _AnyTextAttribute) as Array)[_util_Number]
Frustrating "Structural" error that lets the geme run
- getGameAttribute(_anyTextAttribute) as Array [getGameAttribute("save slot") as Number]
=====================================================
=Next topic: list Game Attribute debug, important for game updates for upcoming stats. as stats, we have to convert it to numbers
intially, the unreplaced value of the list is [Object][Object] |
solution 2: the code method
the default save name for Stencyl is mySave. but any save name without the characters below can be used:
space
~
#
&
\
; and :
" and '
<,
>
?
if the save name includes these letters above, the game will no longer work.
how to use?
loadGame( this.a, function(success:Bool):Void
{
});
saveGame( this.a, function(success:Bool):Void
{
});
legend: this.a is a user-created variable in a behavior is in String or text.
Good post. I study one thing tougher on totally different blogs everyday. It can all the time be stimulating to learn content from different writers and observe a bit of something from their store. I’d favor to use some with the content material on my weblog whether or not you don’t mind. Natually I’ll offer you a link on your web blog. Thanks for sharing. see here
ReplyDelete