Results 1 to 3 of 3

Thread: Saving/Loading in PGELua?

  
  1. #1
    Zasisem's Avatar
    Zasisem is offline -Hacks Enthusiast
    Join Date
    May 2010
    Posts
    316
    Rep Power
    8

    Default Saving/Loading in PGELua?

    I've been working on this project in pge lua for awhile, and I'm at a stand still. I have an idea of how it works, but does anyone know how to use it?


  2. #2
    Powerslave is offline Gone fishin -Hacks Titan
    Join Date
    Apr 2006
    Posts
    7,900
    Rep Power
    0

  3. #3
    Zasisem's Avatar
    Zasisem is offline -Hacks Enthusiast
    Join Date
    May 2010
    Posts
    316
    Rep Power
    8

    Default

    Quote Originally Posted by Powerslave View Post
    Thanks for the link, but that is not what I was referring to. I'm using PGELua, which is different from Lua itself.
    My question in need is "how" not "what" because I know what to save. I'm asking how do you save (whatever you save like say your current : high score, current level, health, money etc.) how would you save that information here's an example:

    Example:
    pge.utils.saveinit(“score = 10″, “GAME00000″, “Title”, “Sub Title”, “Detail”)

    Here's an explanation of what Got put in those quotations:

    pge.utils.saveinit(data, name, title, subtitle, detail)

    Parameters:
    data – The data to save, as a string.
    name – 8 character string for the name of the save.
    title – The title that is displayed in the savedata dialog.
    subtitle – The subtitle that is displayed in the savedata dialog.
    detail – The save detail that is displayed in the savedata dialog.

    What type of data can be saved between the first quotations? (data) variables of the Player can be put there right? Let's say we have this..

    Top of my script I have these variables for the player:
    Player = { x = 240, y = 136, width = 32, height = 32, Score = 0, Fuel = 1000, Health = 100}

    Now lets say your on the forst level of the game and your players score is now:

    Player.Score = 100

    Now we call a function to initialize the savedata function(i.e. pressing select will pop up the save dialog. We want to save the players score, and be able to load it later( I also need help with loading )

    Earlier I showed this:
    pge.utils.saveinit(data, name, title, subtitle, detail)

    Where and how would I be able to save the current score? (while still being able to load it later on) I can't put it where "detail" is because that only shows the the data that got saved. If I put [ "Score: "..Player.Score ] where detail is, it will(like I said) only "show" it. I'm guessing where "data" is, is where I put [ "Score: "..Player.Score ] would that be the place where I would put that? And be able to load it later? I'm sorry if this is very long.. but I've been working on this game for awhile

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •