Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    How to save player location and stats even after exiting?

    Coding
    3
    10
    829
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • poof92
      poof92 last edited by

      I can't seem to figure out how to save my players location and then load it when I press c.y! Sorry I can post any code at the moment

      1 Reply Last reply Reply Quote 0
      • vinicity
        vinicity F last edited by

        I think the easiest way to achieve this is to use Pianofire's Persistent Data functions.

        Take a look at the thread here (it has got some nice examples):
        https://fuzearena.com/forum/topic/781/persistent-data

        And here is a link to the project:
        https://fuzearena.com/catalogs/view/5501

        poof92 1 Reply Last reply Reply Quote 4
        • poof92
          poof92 @vinicity last edited by

          @vinicity but I'm not to sure on how to use it I think I save with savestore but loadstore doesn't do anything

          1 Reply Last reply Reply Quote 0
          • vinicity
            vinicity F last edited by

            LoadStore() reads from the file and populates your store. But if there is no save file it won’t do anything. It returns true if there was a save file to read and false otherwise.

            Once you have read the file with loadStore() you can use getValue(“name”) where name is the name you have given the value, for instance “score”.

            1 Reply Last reply Reply Quote 0
            • vinicity
              vinicity F last edited by

              Sorry, I forgot to write that you need a global variable for the store like this:
              store = []

              The you can populate the store with the values you want to save like this:
              SetValue(“score”, 12345)

              And finally, for actually saving your store to the save file, you do:
              SaveStore()

              poof92 1 Reply Last reply Reply Quote 2
              • poof92
                poof92 @vinicity last edited by

                @vinicity hmmm it's confusing for me could get an example

                1 Reply Last reply Reply Quote 0
                • pianofire
                  pianofire Fuze Team last edited by pianofire

                  I have done an example for you : 6QA63MNDNN

                  You don't have to understand it all in order to be able you use it

                  Cursor keys move the red dot. Y restores the position to the last save and X saves the position and exits

                  1 Reply Last reply Reply Quote 1
                  • poof92
                    poof92 last edited by

                    Ok thanks I'll give it a try

                    1 Reply Last reply Reply Quote 0
                    • poof92
                      poof92 last edited by

                      It kind of works now when I got to getvalue with the press of a button my player stops moving

                      1 Reply Last reply Reply Quote 0
                      • poof92
                        poof92 last edited by

                        I got it work now thanks for all the help

                        1 Reply Last reply Reply Quote 3
                        • First post
                          Last post