Expressions in Save/Load Attribute

SinequanonSinequanon Member Posts: 35
edited November -1 in Working with GS (Mac)
I have an actor I need to drop into all of my scenes to save the stats for the game. My question is this: If I have a text attribute on the actor, say, called key, could I type in the key (say the key is "level1") into the actor's attributes and use the load attribute behavior as such:

Load Attribute Key: self.key into game.level

?

I've heard several times that it must be typed in, but this means that this actor will have to be unlocked on every scene, which can create problems if I need to edit. This game will also have 40-50 levels, and doing this 40 or 50 times will make me want to shoot myself. ;)

So once and for all, can expressions be used in Save/Load attribute?

Comments

  • SinequanonSinequanon Member Posts: 35
    Hmm, so right after I posted this, I realized I could make a quick demo.

    I created a single actor on a blank template and gave him a text attribute called Key, and put in a load attribute behavior (loading self.key into game.test, also a text attribute).

    I created a rule on the actor that said when touch is released, change attribute game.test to "smith", and then save attribute game.test to self.key

    Finally, I had a display text attribute to display "game.test".

    On first run (in the viewer), the actor displayed nothing (since game.test is blank). I closed the viewer out completely. On second run, I tapped the actor and it displayed "smith", as expected. I closed out the viewer again, completely.

    On third run, the actor displayed "smith" still. So it looks like this is working.

    So it looks like you CAN use the expression editor with save/load attribute. I thought I'd read repeatedly that you can't.
Sign In or Register to comment.