Save progress in RPG

Ok, I'm making the one thing that every single QBasic programer has started...a RPG. A text RPG, to be exact. But, this isn't a spam for it. I want to know how to save the progress in the game. If you need source, it's pretty long so far and uses about 6 SUBs, so I won't post it here. Can anyone help?
[hr]
Webmaster Jordan
Bona Fide Q!Basic
ACOS Operating System Shell

Comments

  • Just write the values of all variables, one by one, to a text file. then load them back in a similar way.
    For example:

    [code]
    open "savefile.sav" for output as #1
    print #1, hp
    print #1, mp
    print #1, gp
    print #1, exp
    close #1
    [/code]

    do that with any and all variables which are necessary to record the player's progress

    the opposite of print # is input #. This example would load what was saved in the previous example.
    [code]
    open "savefile.sav" for input as #1
    input #1, hp
    input #1, mp
    input #1, gp
    input #1, exp
    close #1
    [/code]


    : Ok, I'm making the one thing that every single QBasic programer has started...a RPG. A text RPG, to be exact. But, this isn't a spam for it. I want to know how to save the progress in the game. If you need source, it's pretty long so far and uses about 6 SUBs, so I won't post it here. Can anyone help?
    : [hr]
    : Webmaster Jordan
    : Bona Fide Q!Basic
    : ACOS Operating System Shell
    :

  • Ok, thanks alot! Major help.
    [hr]
    Webmaster Jordan
    Bona Fide Q!Basic
    ACOS Operating System Shell

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories