Initial game values in zsdx

Started by Starlock, May 03, 2016, 04:16:11 AM

Previous topic - Next topic
Hey, I've just started to try and implement @froggy77 's level and xp system. However, his system is based around zelda roth and my game is based around zsdx code.

http://forum.solarus-games.org/index.php/topic,520.0.html

I believe the problem is declaring new savegame values, however nothing I've tried seems to work. I tried changing everything to roth, but that turned out to be a lot more trouble than I expected. I tried putting the values at the end of the savegames code and that didn't seem to do anything. Where should initial values be saved in zsdx?

There is no initial values for savegames : it exists or not. If it exists, when you call the getter, it will return its values, else it will return nil. (Source: http://www.solarus-games.org/doc/latest/lua_api_game.html#lua_api_game_get_value )

The initial values of a savegame in zsdx are in savegame.lua

Just search for set_initial_values in this file.
And initialize whatever values you want.