Save game data

  • #40, by afrlmeSaturday, 17. January 2015, 02:44 10 years ago
    1. you should not be declaring global variables unless you need them to be global. add local before variables to contain them to that particular script/function.

    2. I don't know why you declared it twice or why you bothered to create the variable to be honest as you ended up creating an additional 2 lines & variables for not much reason at all - well from my point of view as I tend to code compact. Less is more; or so some people say...
    print( Values["main_test"].String )
    Values["main_test"].String = "hello world"
    print( Values["main_test"].String )
    


    3. Why would it change in the .ved? The save files are what store changes made to the game, not the .ved or .vis file (in case of compiled game). Those files only contain the raw data which the engine uses to make the game work. So if you did that & saved the game, then quit the game & launched the game then loaded from that savegame or autosave (whichever you saved with) then tried printing the value of the string, it should return "hello world" but if you try printing the value from a new game then it would return "", nil or empty - or something along those lines.

    4. See this page, for more information on displayed texts.

    Imperator

    7278 Posts


  • #41, by minibigsSaturday, 17. January 2015, 02:52 10 years ago
    OK, I'm too tired ... thinking it through of course when the game is built, there will be no VED shipped with it hence your tactic of writing them out to the config.ini... I think I've finally got it straight, I'm not normally this dense, honest.

    Newbie

    79 Posts

  • #42, by minibigsSaturday, 17. January 2015, 02:53 10 years ago
    See the point with a save file as well, it's coming together slowly

    Newbie

    79 Posts

  • #43, by minibigsSaturday, 17. January 2015, 02:56 10 years ago
    I posted the remark about the config.ini before I saw your reply, I do understand it now, thanks.

    Newbie

    79 Posts