Howdy, Stranger!

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

Categories

Save progress in RPG

Bona_Fide_QBona_Fide_Q Member Posts: 17
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

  • billywm664billywm664 Member Posts: 176
    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
    :

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

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    ______ [ http://forcoder.org ] free video tutorials and ebooks about < Assembly Scratch PL/SQL Go Objective-C Perl C# C PHP C++ Python R Delphi Visual Basic .NET JavaScript Ruby MATLAB Swift Visual Basic Java LabVIEW Scheme Rust Apex Lisp Bash Transact-SQL Clojure Crystal Dart FoxPro Alice Fortran Ada Kotlin Erlang VBScript ABAP ML Lua Scala D Prolog Awk Julia Hack Logo SAS COBOL F# /> ________

Sign In or Register to comment.