1. Hey! Guest! The 33rd GMC Jam will take place between May 23rd, 12:00 UTC (Friday noon) and May 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

GM:S 1.4 Saving/Loading, where the player can choose what they call the save file.

Discussion in 'Programming' started by Eggyy, May 17, 2019 at 5:47 PM.

  1. Eggyy

    Eggyy Member

    Joined:
    May 13, 2019
    Posts:
    2
    I have 2 objects, called 'obj_save' and 'obj_load'.

    I'm not too sure how to do this, but how on earth do I set the files up so that the player can choose what they want the save name to be, and then load from that same save name. This way, the player can have multiple saves, with names that they wish.

    If possible, It would also be preferred if these saves could be placed in save files.
     
  2. Eggyy

    Eggyy Member

    Joined:
    May 13, 2019
    Posts:
    2
  3. Catan

    Catan Member

    Joined:
    Jun 20, 2016
    Posts:
    515
    A simple solution would be to use a dedicated forder that only contains save files. This allows you to generate a list of saves by using the file_find_* functions.

    Keep in mind though that not all characters are allowed to be used in a filename, and those may vary from one operating system to the other.

    A more robust approach may be to keep a “saves index” file that keeps a list of saved games and their user defined name, while in fact you are using something like an incremental number for the actual files.
     
    Last edited: May 18, 2019 at 12:46 PM
    Eggyy likes this.
  4. the_dude_abides

    the_dude_abides Member

    Joined:
    Jun 23, 2016
    Posts:
    486
    If you check in the manual under File Handling / File Systems / File System Functions, there are functions for giving a dialogue box to choose a save place and name.

    get_save_filename_ext(filter, fname, directory, caption);

    That might be a good place to look, though I haven't used it in ages and can't say 100% it is what you're looking for.
     
    Last edited: May 18, 2019 at 9:05 PM

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice