Can anyone think of a way to have a virtual "sticker page"?

scitunesscitunes Member, Sous Chef Posts: 4,047
edited April 2012 in Working with GS (Mac)
Hi guys,

I'm stuck and could use some help. I am working on a kids game and I would like to have a virtual sticker page that acts as a reward system. The idea is if you do well in a game you earn stickers. A button pops up you tap it and it takes you to a page with a bunch of virtual stickers at the bottom that can be scrolled through. Problem is that when you leave the sticker scene and come back to the game the stickers are gone.

I don't think there is a good way to save the X,Y positions and sticker images in game attributes without writeable tables. I have tried to use the pause unpause behaviors so that when you leave the sticker page you are pausing the game at that point and then while the sticker page is paused you play the games. But it seems that GameSalad dumps the paused info when you are paused and then change to another scene (other than the sticker scene). When I try to unpause at that point it doesn't work.

Any ideas or do I need to scrap this entire idea?

Best Answer

  • MarkOnTheIronMarkOnTheIron Posts: 1,447
    Accepted Answer
    Oh, right I didn't thought of the saving part. I never tried to save self.attributes. The problem is that locked instances will try to save the attribute to the same key.

    Maybe if you gave each instance a unique ID number and use it during the save process? Something like: Save attribute self.X to instanceX..self.ID

    I never tried something like this. I don't even know if it's possible to use expressions for saving attributes. But if you can't wait for writable tables to arrive you could try it.

Answers

  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    Instead of using game.attributes you could use self.attributes to save the stickers positions.

    Or you could wait a little and use writable tables :)

  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Does the user get the stickers in a definite order or is it random?

    Ace
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    @mynameisace - there are a bunch to shoose from. It's up to the player.

    @MarkOnTheIron - Can you save and load self attributes for locked instances?
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    You could implement it when we have writable tables, or you Could just save the x and y positions like one would save a high score using attributes and call to them then...
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    @Mark That's interesting. I'm going to have to try that.
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    Let us know if that worked. It might be useful :)

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    @MarkOnTheIron - your method works perfectly! All I have to do is add the self.ID for each instance to the key and it works! I don't think this will work for spawned actors, but I can have a bunch of sticker instances out of view and simulate a spawning. As long as I have a unique self.ID attribute for each instance I can save the image name and X and Y coordinates using this method.

    Nice work!

    I love this community!
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    edited April 2012
    I think I will only need 4 self attributes - self.ID, self.x, self.y, self.StickerImage

    @tshirtbooth - Doesn't seem too messy, but maybe I'm missing something. Would writeable tables allow me to spawn endless amounts of stickers and save their positions and images?
Sign In or Register to comment.