Keeping a condition even after game exit

  • #1, by brut69Sunday, 08. May 2016, 21:48 8 years ago
    I am trying to setup a way so that when the player finishes the game it will let him "Unlock" another game option. This needs to be done at the beginning where the player can select whether to start a new game or load a previous one. The problem is that the condition needs to be remain changed without loading or saving it each time the player starts the application.
    The only way I figured out to do it is to have the game load the previous save game at the beginning of the application. This is not very professional though as the player will be auto-loaded into his previous game without being able to first select what he wants to do (Unless I call it a "feature" and be done with it)
    Any ideas?

    Great Poster

    266 Posts


  • #2, by sebastianSunday, 08. May 2016, 23:05 8 years ago
    you could do this with your config ini and read out a string at the beginning of the game.
    when config.ini contains the string, set condition to true.
    the only problem i see here is that it could easily be changed by the people manually when they know what string is needed.
    For config.ini stuff see here:
    http://wiki.visionaire-tracker.net/wiki/Read/Write_Config.ini_(CMS)

    Another thing could be to use steam or gog galaxy achievements which could be checked at the beginning...

    Thread Captain

    2346 Posts

  • #3, by afrlmeMonday, 09. May 2016, 01:17 8 years ago
    Just have it create an autosave / quicksave file after completing the game. Any autosave save slot you don't want to use is fine. Then you can check on game launch if autosave #? exists if so set condition y to true end if.

    You could also write to an external file & read it on game launch too, but it's more obvious than simply creating a save game file. wink

    Imperator

    7278 Posts

  • #4, by ke4Monday, 09. May 2016, 10:12 8 years ago
    Would it be theoretically possible that Vis would have an option for conditions if they are suppose to be classic or independent of saves data? It would work the same as reading from config file but it would be happening inside of the engine in the .vis file and done automatically? Without needing to script reading/writing functions.

    Key Killer

    810 Posts

  • #5, by sebastianMonday, 09. May 2016, 12:00 8 years ago
    #feature request grin

    Thread Captain

    2346 Posts

  • #6, by afrlmeMonday, 09. May 2016, 13:34 8 years ago
    Well I suppose they could use an external file that encrypted data gets written to (like the save files) that is dedicated to conditions & values that could be read on game launch. It's worth asking for as it would be useful for things like achievements & bonus unlocks too.

    Imperator

    7278 Posts

  • #7, by ke4Friday, 13. May 2016, 10:12 8 years ago
    I can immagine that making more complex menus would get pretty simple. No more need to know using Lua to read from files, even though it's not that hard it would extend the no programming skills purpose of Visionaire.

    Key Killer

    810 Posts

  • #8, by afrlmeFriday, 13. May 2016, 11:59 8 years ago
    Complex menus will always be complicated. As soon as you start adding in custom option choices that the user can tweak, such as fullscreen / window mode, subtitle language, voice language, independent volume levels, aesthetic graphic options, etc, all of which somehow need to be remembered by the game engine. I believe they will always require Lua script, as it would be complicated for the devs to implement some kind of system in which we would be allowed to create custom fields & determine what they should be used for inside of the engine itself.

    P.S: there's only so many things you could get away with, with conditions & values alone.

    Imperator

    7278 Posts

  • #9, by ke4Friday, 13. May 2016, 12:27 8 years ago
    Yeah i didn't realize that it's not only about true of false conditions.

    For example i have in my menu option to turn on/off the subtitles it just needs one condition to know if it's supposed to set or clear font to character, but that needs to be done through Lua too. Is that what you meant?

    Anyway it could be useful for the achievements & bonus stuff as you mentioned.

    Key Killer

    810 Posts

  • #10, by afrlmeFriday, 13. May 2016, 12:45 8 years ago
    Yeah kind of. Languages for example would be best done by setting / reading a string value, which can only be done via Lua script. You could use the integer bit of a value too I suppose, but string would save time in general as you could simply use 1 line of Lua script to update the selected language instead of multiple if queries & action parts.
    game.StandardLanguage = Languages[ Values["lang"].String ]
    

    Personally, for me, only using stored conditions & values would add additional work on top of what I already do. I often opt to use Lua solutions when available as I can write a line or a few lines of code that would probably require 10+++ actions & if queries to do with action parts alone. Sometimes I mix & match, but only if it's the faster workflow solution.

    I find looking at loads of blocks of queries done inside of the editor somewhat confusing. It's a bit easier now that the blocks are more clearly defined & can be collapsed / expanded, so you can more easily tell what you are looking at, but I still find them messy to look at.

    In the at begin of scene in the first scene of the ALLD demo we should be releasing soon-ish, there is an if query that must be at least 100 action parts or something mad. I don't remember adding them all, actually might not have been me, but I can tell you that debugging that action block was super fun & easy (not). razz

    Imperator

    7278 Posts

  • #11, by ke4Friday, 13. May 2016, 12:56 8 years ago
    I'm not trying to avoid Lua as i like to use it, pretty much for the same reasons. I just got the idea & now i understand why there's no function like that in the engine.

    I guess you mean you use Lua for "special" things as i don't see much a point in using it for simple stuff like character speaking or adding item unless it's not part of a bigger function.

    ..it will be more fun with the colors and new stuff for Lua in the new Vis, it will get even more clear then.

    Key Killer

    810 Posts