Save & Load game, many attributes
Hi,
I am asking me, how I can made in my strategygame a loading/saving option for the user.
With only score it is not a problem. But in my game I have a lot of attributes like names, scores, positions, year-numbers and so on. How can I do that? Must I add for each attribe a attribute in the attribute-window?
Or is there a chance to save everything for example in a file?
I am asking me, how I can made in my strategygame a loading/saving option for the user.
With only score it is not a problem. But in my game I have a lot of attributes like names, scores, positions, year-numbers and so on. How can I do that? Must I add for each attribe a attribute in the attribute-window?
Or is there a chance to save everything for example in a file?
Answers
Hi @MarcoCol
Unfortunately there's no shortcuts in GSC when it comes to saving and loading attributes. So yes, you have to add a Save and Load Behaviour for each and every attribute you want.
If you want all of them to be saved and loaded, then yes. (So based on your example: with both Save and Load, that'll be 1600 Save and Load behaviours required...) :-(
If you do it right you could have only 1(!) Save Table behavior instead of hundreds ov Save/Load Attribute behaviors.
Check the Cookbook and the videos on gshelpers.com to have a better understanding on tables. On gshelper.com there should even be a video on saving attributes on a table.
D'oh! I forgot about Tables... :-) Good one from @MarkOnTheIron but remember though that loading and saving attributes this way involves a little bit more work to use them in the Rules, and that they all would be the equivalent of game attributes, i.e no self or scene attributes...
I'm in love with writable tables
@tshirtbooth OK, that's definitely swung it; I'm checking out attributes via Tables asap!