Saving Attributes Issues

KickingBehindsKickingBehinds Member, PRO Posts: 49
edited January 2012 in Working with GS (Mac)
Hi all,

I realise there are lots of saving attributes threads already, I was just having a few technical problems so had to make a new one, I apologize.

When I change an attribute in Scene 1, I am able to save it and then load it in Scene 2, however in my game there is a link back to Scene 1 and when I then go back to Scene 1 (not resetting the game, going back within the game) the value of that saved attribute is different (usually less than what it was saved as originally.

Has anyone else had this issue or is there anything I may be doing wrong?

Thanks,

SC

Comments

  • POMPOM Member Posts: 2,599
    edited January 2012
    Hey SC ,
    First , when you save attribute in scene 1 , there is no need to load it in scene 2 ,
    The purpose of saving attributes is for when you exit the game and the return to play it later , you can load all the progress you made in the previous session ,
    So no need to load attributes when you change scenes (the value will not change anyway)

    As for your problem , what happens in scene 2 to this attribute? do you change it ?

    Roy.
  • KickingBehindsKickingBehinds Member, PRO Posts: 49
    Hi Roy,

    With my game, without boring you with too much detail in Scene 1 (home screen) for Actor A some attributes are changed (i.e. the maximum speed as it is a racing game). Those changed attributes for Actor A need to be carried over to Scene 2 (the actual race). Going from what you said, then how do I ensure those changed attributes are carried over to Scene 2? The only way I have been able to do it thus far is by saving and loading, but more than happy to hear if there is a better way.

    Thanks again,

    SC
  • POMPOM Member Posts: 2,599
    Hey ,
    Create a game.attribute - integer - call it "maximum speed value"
    In scene 1 , right before you go to scene 2 ,
    change "game.maximum speed value" to the value you want , (and save it if you want this value to stay the same next time the player opens you game)

    Now in your scene 2 , simply access this attribute to whatever you need ..
    If you have more questions please ask.

    Roy.
  • KickingBehindsKickingBehinds Member, PRO Posts: 49
    Hi Roy,

    Thank you very much, one question (sorry I am still learning), will this change the actual speed that that Actor A moves at? The only reason I have been changing the maximum speed is that I have found it the most effective way to change how quickly the Actor moves.

    Thanks again,

    SC.
  • POMPOM Member Posts: 2,599
    Don't get me wrong i think max speed is a great way to limit your actors movement , especially while its possible to change this value in "run time"
    BUT , i think its wrong to use it the way you use it , in your actor (car) what type of behavior you use to move it around?
    move? move to? accelerate? change self velocity?

    Either way , i would suggest giving your car the appropriate speed you want instead of giving it a huge speed value but limit it with max speed .

    Also , if you are new (we all were) take a look at templates like "Overhead Car Race" and "Space Rocks Template" to learn about actors movements and velocity !
    :D
    Roy.
  • KickingBehindsKickingBehinds Member, PRO Posts: 49
    Hi Roy,

    To answer my question would I be better off creating an integer (as you suggested) and instead of changing the maximum speed attribute directly, make rules that when integer = 1, maximum speed = 20, when integer = 2, maximum speed = 21 etc? Therefore, I would be changing the integer (which remains constant across the scenes) and not the maximum speed.

    Thanks again,

    SC
  • POMPOM Member Posts: 2,599
    No mate , that wasn't my intention ,
    What i suggested is to make an integer , and give it the value of your desired speed ,
    so the in your car , lets say you have a behavior "move" than in the speed value of that behavior , use that attribute .

    Roy.
  • KickingBehindsKickingBehinds Member, PRO Posts: 49
    No worries, I understand now. Thank you very much for all your help.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You can make that speed value attribute in your actor and carry it through out your scenes.
  • jamies15-3jamies15-3 Member Posts: 94
    Hey all, dunno if this discussion is wrapped up, but I've been using GS for about a year now, never had a problem with saving attributes before, but the last few updates to games where the saves were working now don't work, I've check over them and dunno what it is, i see quite a few people are having similar problems since the last GS update, just wondering if anyone knows a fix?

    cheers
Sign In or Register to comment.