GameSalad randomly changes my attributes! What???

Ok, so I have recently added a store to my newest game (it's a secret, so I can't tell you what it is!). I have Boolean attributes for each character available in the store that are changed to true if the character has been purchased, so you can then use that character.

As soon as I launch the game, everything works fine. All of the attributes are false until I buy a character, then that one is true. So I go play a level with my new character, and go back to the store to buy another one -- but all the attributes have been made true. I can freely use any characters without paying for them.

This is a serious GameSalad bug. Is anyone else having this issue, and if so, have you found anything you can do to fix it?

Thanks,
Adam

Comments

  • RPRP Member Posts: 1,990
    "This is a serious GameSalad bug."

    How? Sounds more like an issue with your code. You will need to give some more details to how you "secret" store is set up in order for peeps here to help. A screen shot of your set attributes, rules and associated behaviors would help in aiding you.
  • adambowker98adambowker98 Member Posts: 57
    edited February 2013
    Here are the rules I have in place regarding the attributes:

    https://www.dropbox.com/s/jfw4h3tjkkuxxdv/Screen Shot 2013-02-01 at 1.46.53 PM.png
    https://www.dropbox.com/s/nwj720klatmollv/Screen Shot 2013-02-01 at 1.45.49 PM.png
    https://www.dropbox.com/s/3pk1ps4dmymn3h0/Screen Shot 2013-02-01 at 1.45.57 PM.png
    https://www.dropbox.com/s/ckt90bcpr6wgftk/Screen Shot 2013-02-01 at 1.46.38 PM.png

    The "game.Kangaroo Bought" attribute is the one used to tell wether or not the character is bought.
    The "game.What Character?" tells the game which character is being used, and to change the image of the main player to the new character's image.
    The "Can't Afford" rule is what happens when you can't afford the new character.
    The "Change Character if Purchased" rule is what happens if you have already bought the character, but are currently using a different one and want to switch back.
    The "Buy Character in New Scene" is if you want to buy the character, it changes to the scene where you can buy.
    The "Buying Character" is if you hit "BUY" and buy the character.
  • RPRP Member Posts: 1,990
    That was fast!
  • adambowker98adambowker98 Member Posts: 57
    I actually was typing up that comment as you commented. Haha. It was pretty good timing, though.
  • adambowker98adambowker98 Member Posts: 57
    And I have checked my code many times, remade the attributes, and made sure I didn't mistype anything anywhere.
  • RPRP Member Posts: 1,990
    edited February 2013
    Have you deleted any major chunks of the code, or the actor they resided in during the construction of the store logic? (or any large copy paste action).
  • BluSpyderBluSpyder Member Posts: 129
    @adambowker98

    In these cases, your "secret" really can't stay so much a secret. You need to provide more info to solve the problem. If you send the project to me, I'd be willing to help, but can you coop with the fact I've seen your secret? >.<
  • adambowker98adambowker98 Member Posts: 57
    Yes, I have used copy and paste for all 6 characters but have changed the attributes within the rules I copied.

    And @DevilDog I don't mind if anyone knows, I just didn't want anyone stealing my idea and then launching the game before I finished mine.
  • BluSpyderBluSpyder Member Posts: 129
    @adambowker98

    Yeah I understand that, I'm just saying sometimes to get things resolved you have to include more people. If you're that worried, try making a mock up of the app, with the issue, without your "secret" images and text.
  • RPRP Member Posts: 1,990
    Agreed, make a new project file with just your store functions. The other option would be to move away from using a simple Boolean and go with a integer or real.
  • BluSpyderBluSpyder Member Posts: 129
    I don't know if it's relevant to the issue, but looking at your rules sometimes only using the touch pressed rule can be picky. Try adding some touch-inside's and/or self attributes and make sure the touches aren't accidentally being touched when you're going back to the store (like touch is still pressed on one scene going onto another scene exactly where the button is). This is also to make each button more individualized, as it could be, for some reason, tied together with just one touch. That's just from my experience, don't know if that is what's going on here.
  • adambowker98adambowker98 Member Posts: 57
    @RP I was using integers (0 for false, 1 for true), but it would randomly change the attributes to 3.

    @DevilDog I'll try that. Thanks
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Try just redoing the change attributes for the boo leans and don't copy and paste sometimes links can be broken and just need to be reestablished.
  • RUPASRUPAS Member Posts: 823
    @adambowker98 I've had a similar problem in my game, whenever an order to a different activated me, made ​​no sense, and the code or had gone over a thousand times, I realized that this only happens in the viewer me, when I build a Adhoc works perfectly, you tried to build an AdHoc?
  • adambowker98adambowker98 Member Posts: 57
    @RUPAS No, I wasn't going to make an AdHoc until I made further process in the game. I will try that, though. I'm glad it might not be an issue with my code.
  • adambowker98adambowker98 Member Posts: 57
    @RUPAS

    I have made an Ad Hoc but the issue still occurs.
  • adambowker98adambowker98 Member Posts: 57
    @FryingBaconStudios I remade all the attributes as booleans but the issue still occurs! I will try re-making the code in each character rather than copying and pasting.
  • adambowker98adambowker98 Member Posts: 57
    In my game, I have a store where you can buy new character. I have a "What Character?" attribute and 6 attributes for the 6 different characters to say wether they have been bought or not. For example, a Superman character has an attribute called "SuperMan Bought" that is either true or false -- true if it has been bought, and false if not.

    My problem is this: When you buy your first character, everything is fine. You can only use that character and the default character. So, you go play with the new character and decide to buy another one. When you get back in the store, all of the character attributes have been changed to TRUE, letting you use the characters without buying them!

    My code looks like this in the store image:
    RULE:
    If "Character" is touched AND Attribute "Character Bought" is FALSE:
    Go to scene "Buy Character"

    RULE:
    If "Character" is touched AND Attribute "Character Bought" is TRUE:
    Change image to "Character-Selected"
    Otherwise:
    Change image to "Character-NotSelected"


    And my code looks like this in the "Buy Character" Button:
    RULE:
    If "Buy Button" is touched AND game.Money >= 40 (the price of the character):
    Change Attribute game.Character_Bought to TRUE
    Change Attribute game.What_Character? to 5 (the number of the character in the list)
    Change Attribute game.Money to game.Money-40

    RULE:
    If "Buy Button" is touched AND game.Money < 40 (the price of the character):
    Change Image to "Cant_Afford"

    I don't understand why all of the Character_Bought attributes are being changed to TRUE when I have only changed one of them to TRUE. This issue occurs in the GS Viewer (on the computer) as well as the Ad Hoc build.
    I appreciate any help I can get.

    Thank you!
  • adambowker98adambowker98 Member Posts: 57
    @TheMoonwalls can you help me?
  • adambowker98adambowker98 Member Posts: 57
    Alright, I think I solved my own problem... I had all of the character attributes saving/loading with the same key. I went back and changed all of the keys so they were unique and now it works!
  • MantoManto Member Posts: 796
    I would recommend to use tables for that kind of stores. Here's a demo I just made: http://forums.gamesalad.com/discussion/53790/free-store-template#latest
Sign In or Register to comment.