Game and Scene Attributes

NMansellNMansell Member Posts: 143
edited November -1 in Working with GS (Mac)
If I wanted to load say a attribute on startup, could I do this even though it is set to Scene Attribute or would it need to be link to the Game Attribute List?

Thanks.

Comments

  • hotMagichotMagic Member, PRO Posts: 266
    Those saved keys are just that, saved keys. You can load them into a game/scene/actor variable. So it just depends on your needs.
  • NMansellNMansell Member Posts: 143
    thanks. just out of interest do the images insert themselves into the project so if I delete the original it won't affect the gameproject file?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    That's right. :-)

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

  • NMansellNMansell Member Posts: 143
    so i can move the gameproject file from one machine to another without any problems?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Yes, you can. The whole package moves across. (If you click on a GS game file with control held down, and select show Package Contents, you'll see it's all there). :-)

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

  • NMansellNMansell Member Posts: 143
    thanks but how do i save and load.
    i have save game.A1 (actor1 attribute) to game.A1

    and on Startup Load Attribute game.A1 to game.A1

    But it doesn't appear to be working? What am I doing wrong - any suggestions please.
  • hotMagichotMagic Member, PRO Posts: 266
    Yeah you can do a few things with the project file. One thing of note is if you update your images, which happens a lot, you can overwrite the ones within that package without problems. But from my experience you can't add them for the first time in that direct way (gotta add them through Gamesalad).

    Save thing: You sure the load is working? Can you tell us how you're doing this, or post a little screenshot?
    If you use the simulator, you can push the reset button and it's the same as rebooting the game.
  • NMansellNMansell Member Posts: 143
    I am using the following command after the user presses the button(s) linked to "game.A1", A2, etc
    Change Attribute -
    game.A2 To (game.A2+1)%3
    (This gives me the number 0,1,2 as the selection) based on this is what image is displayed.

    Save Attribute -
    game.A2 To game.A2

    The main menu has the laod attributes section upon startup:
    Load Attribute -
    game.A2 To game.A2

    I know I am going wrong somewhere just can't see the woods from the trees :)
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    NMansell said:
    I am using the following command after the user presses the button(s) linked to "game.A1", A2, etc
    Change Attribute -
    game.A2 To (game.A2+1)%3
    (This gives me the number 0,1,2 as the selection) based on this is what image is displayed.

    Save Attribute -
    game.A2 To game.A2

    The main menu has the laod attributes section upon startup:
    Load Attribute -
    game.A2 To game.A2

    I know I am going wrong somewhere just can't see the woods from the trees :)

    that seems correct. and save and load doesn't work on the computer so maybe thetas your problem. Make a adhoc or use the viewer and reselect the game from the recent game list
  • NMansellNMansell Member Posts: 143
    tried reloading the game project file, running via viewer and it still doesn't work :(
    I have a button now that should reset all the attributes, but again this is not doing it - any sugestions please?!
  • hotMagichotMagic Member, PRO Posts: 266
    At this point you should have someone look at the actual file. The suggest I have is just keep simplifying your test until it works. That's the easiest way to debug something like that.

    For example, set a keystroke to save a static number to your key. Set a keystroke to load that key. Have a text output of the attribute the whole time. Play the game and save it with the key shortcut. Play the game again and load it with the other shortcut. See if anything happens.

    And yeah do it on the iphone viewer. good luck!
  • NMansellNMansell Member Posts: 143
    do you have to save to another key - so if i change 'A1' and save it, can i save it to itself and load A1 later or would I need to save A1 to A1New and then load A1New into A1?
  • hotMagichotMagic Member, PRO Posts: 266
    In my experience, you can't load a key in the same session (while the game is running) that you saved in the same session. Like you can't save game.A1 to key A1, and then later grab that key A1 to assign to game.A2.

    I don't know for certain but I'm vaguely remembering.

    My point is, in my games, I create a game.A1 variable. I use that while the game is running, and save to key A1 when i get a new high score. I ONLY use the key A1 to Save to it.

    The only time I load A1 is at the main menu. I Load all my saved data, key A1 to game.A1, etc.
    Then I work with the game.A1.

    I just looked at your code above and this piqued my interest:
    "Save Attribute -
    game.A2 To game.A2"

    You CAN plug stuff into the key field, like you would any other variables. that's for the purpose of doing math in this case.

    Look at 1:15 on this video. Are you typing it as a text string or plugging in a variable with mouse clicks? Let me know cause now I'm curious.
Sign In or Register to comment.