Save medals and unlocked rooms

UtopianGamesUtopianGames Member Posts: 5,692
edited November -1 in Working with GS (Mac)
Hi Guys,

I have started on Bumps and wondering if for eg i have 20 scenes/rooms with gold silver and bronze awards and each room is locked or unlocked is it possible to save everything in one go or will i have to save unlock room 1 unlock room 2 gold medal room 1 silver medal room 3 etc etc.

I would love a save game that saves everything! but cant seem to find it or even think it exists,

Darren.

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    For each attribute you use to determine if something is locked or not you'll need to save it and then load it upon enetering your unlocks page. One thing i guess you could try and expermient with is having a global save.

    e.g. Lets say you finish your level. You could have a rule that says when level is finished change save game to 1 and change scene to whatever.

    Now you could maybe have a rule that says, if game save = 1, save attribute room unlock 1, room 2 unlock etc etc

    Then at the start of your next scene or just after it changes originally you could have it change game save back to 0. That would in theory save all the attributes at once, saves individually doing it each time, you could just implement the change between save to 1 and save to 0 and it would save everything for you.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Darren, Saving and Loading of games is a pre-requisite of one of my projects too, and I was really glad to learn that this is possible. There's a couple of posts about this recently, which would be of help, I'm sure; only posted in the last couple of days or so, perhaps check them out.

    Basically, you'd set up all of your variables as game attributes. These would be updated as the game is played, e.g WhatLevel would be updated when moving to another level with WhatLevel=WhatLevel+1 (if moving from room to room is linear); or WhatLevel-1 if your going back to a previous room. Other variables would be whether or not you've bronze, silver or gold awards (boolean attributes); whether or not a room is locked, whether or not an item has been picked up, etc.

    Then in the Rules of a Save button, you'd use a whole bunch of Save Attribute behaviours, one for each variable. Then in your Continue Game button, you'd use the exact same amount of Load Attribute behaviours, + a way of telling it to go to the start of the level saved.

    Because this is really important to my adventure game as well, I want to get round to making an example of Loading and Saving. I'll let you know the link when I do, if you like.

    :-)

    ---------------------------------------------------------------
    Spiral Gyro Games

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • quantumsheepquantumsheep Member Posts: 8,188
    gyroscope said:
    Other variables would be whether or not you've bronze, silver or gold awards (boolean attributes); whether or not a room is locked, whether or not an item has been picked up, etc.

    I would make an integer attribute called MedalValue.

    This will let you define what medal you have using just one integer variable rather than checking three boolean values. See below:

    Integer Medal Value=1

    If player gets bronze then change variable MedalValue to 1 - Display "You got Bronze!"
    If player gets silver then change variable MedalValue to 2 - Display "You got Silver!"
    If player gets gold then change variable MedalValue to 3 - Display "You got Gold!"

    Then you could do stuff like multiply the level score by the number so you can actually change the score the player gets based on what medal you get:

    Change attribute level.score to level.score*MedalValue

    Getting a bronze medal will therefore give you the normal score for that level. (score multiplied by 1)

    Getting a silver or gold will multiply your score (which you couldn't do without more mucking about with more variables - score multiplied by 2 or 3 depending on medal).

    Hope that helps. I've been digging deep into scoring mechanisms for 'Project K' in an effort to increase replayability! :D

    Cheers,

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    quantumsheep said:
    I would make an integer attribute called MedalValue.

    This will let you define what medal you have using just one integer variable rather than checking three boolean values. See below:

    Integer Medal Value=1

    If player gets bronze then change variable MedalValue to 1 - Display "You got Bronze!"
    If player gets silver then change variable MedalValue to 2 - Display "You got Silver!"
    If player gets gold then change variable MedalValue to 3 - Display "You got Gold!"

    that's neat, QS; thanks!

    :-)

    ---------------------------------------------------------------
    Spiral Gyro Games

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • RattleheadRattlehead Member Posts: 485
    I have the same type of deal going on where I have each scene as an unlockable stage and I just save and load game level variables; 1 = stage unlocked, 0=stage locked. I then update the scene that displays all my stages accordingly.

    I also have a bronze, silver, gold medal system and I have that running the exact same way that QS hinted at with integer variables. Then when the player beats the stage it displays the appropriate medal.

    Both work great.
  • quantumsheepquantumsheep Member Posts: 8,188
    Rattlehead said:
    I have the same type of deal going on where I have each scene as an unlockable stage and I just save and load game level variables; 1 = stage unlocked, 0=stage locked. I then update the scene that displays all my stages accordingly.

    I also have a bronze, silver, gold medal system and I have that running the exact same way that QS hinted at with integer variables. Then when the player beats the stage it displays the appropriate medal.

    Both work great.

    /hugs you

    /hears your head rattling

    /steps away, slowly...

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • RattleheadRattlehead Member Posts: 485
    @QS: LOL!

    I was more amazed that I managed to figure out something and it was done along the same lines that someone else had done. I must be paying more attention in class lately.
Sign In or Register to comment.