Solarus-Games English Forum

Solarus => Development => Topic started by: Starlock on May 03, 2016, 04:16:11 AM

Title: Initial game values in zsdx
Post by: Starlock on May 03, 2016, 04:16:11 AM
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?
Title: Re: Initial game values in zsdx
Post by: Renkineko on May 03, 2016, 07:46:03 AM
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 (http://www.solarus-games.org/doc/latest/lua_api_game.html#lua_api_game_get_value) )
Title: Re: Initial game values in zsdx
Post by: MetalZelda on May 03, 2016, 12:18:17 PM
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.