A quick tip on save/load that may save you some headache

HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
edited February 2012 in Working with GS (Mac)
If you're in the habit of using a lot of instances of actors in you projects....

So for a couple hours I've been trying to figure out why I was having problems with in-game unlocks.
All my logic seemed fine but items were getting unlocked despite the conditions in their rules not being met.

I thought maybe I had a rogue rule....nope. Then I thought maybe it was a GS issue. Nope. The issue was still there with old ad hocs made in old GS builds.

So the problem was.... I was saving and loading local attributes (self.attribute) inside an instance of an actor.

Switching to global saving/loading (game.attribute) cleared up the issue.

Glad I spotted it otherwise my iap update would have been a bit ruined ;)

Comments

  • SAZ_1SAZ_1 Member Posts: 397
    nice one... also ... remember to use the text editor to save/load the key!!! press clear expression then type in the key! :)
  • ultimaultima Member, PRO Posts: 1,207
    edited February 2012
    and on top of that i use another text attribute to store the name of the key, so i don't mis-type it.. better yet now we have tables. you can create a table of keys. if you happen to be saving a lot of things. and loading them all the time.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    edited February 2012
    @SAZ_1 Yeah I find if press the 'e' for the expression editor my saves/loads don't work. So I just type the text in directly and avoid pressing the 'e'. If that's what you meant?

    @Ultima Dunno if it will help you but I stick to the pattern of lowercase for the first letter, and uppercase for the start of each new word. No spaces. As the keys are case sensitive.

    e.g level1Save, heroEnergy, oneTwoThree etc
  • calvin9403calvin9403 Member Posts: 3,186
    nice HTS. I will kept my ming in this when I am load attributes!
Sign In or Register to comment.