Trying to get shop unlocks to work correctly HELP!!!

matthewsuttlesmatthewsuttles Member Posts: 42
edited April 2012 in Working with GS (Mac)
Hey everyone
I'm trying to get this code to work to unlock on specific event. I am having trouble getting it to work correctly. My code below shows what I have. The problem is when I click it, it unlocks, but when I click a second time it doesn't add one to the specific item. I have tried both boolean and integer operations. And both act the same. Can someone help? :((

Photobucket


Photobucket

Answers

  • CluvCluv Member Posts: 229
    You don't seem to have an otherwise statement for when a person has filled your first set of requirements. The problem with a boolean is that when you change it, it doesn't fulfill your original requirements to run your code; in other words, you can't go back into the same piece of code you had before. I believe you need an otherwise statement which includes your boolean and purchase attributes to fulfill it that THEN allows a person to "purchase" your weapon.

    I.E.

    IF
    BOOLEAN false and all unlock stuff is fulfilled
    THEN
    BOOLEAN TRUE

    OTHERWISE

    IF BOOLEAN TRUE and have enough money
    THEN
    purchase.

    Hope that helps.
    C



  • matthewsuttlesmatthewsuttles Member Posts: 42
    I need to have it selected too. I need it to unlock then select it. I keep getting weird results.
  • matthewsuttlesmatthewsuttles Member Posts: 42
    I would like to whenever someone selects I item and they have enough money to change the image to something else. As well. I would like the boolean for it unlocked set to true as well as the equipped boolean for that weapon to be true. Also if someone equips the another weapon for that image to change to the unlocked image and for the boolean equip to go back to false.
  • CluvCluv Member Posts: 229
    If you need to have it selected to, then you need a separate case for when your position is selected. In other words, you need two press rules. Like I said before, if you have a boolean as part of what keeps you from entering a rule, then once you switch it you will be locked out. Underneath is an example of two rules For Example:

    Rule: Unlock Position
    --
    If Press
    If Boolean Off

    Boolean On
    Highlight position/Unlock
    --

    Rule: Buy
    --
    If Boolean On
    If Press
    Check Item and $
    Respond Accordingly
    --

    I create a separate test booleans that I then display on test objects that I leave on my screen to make sure the switches are actually being turned on.

    As for your equipping issue, I am not sure exactly what you mean... Sorry.
  • matthewsuttlesmatthewsuttles Member Posts: 42
    I want the boolean to set the item equipped so I can call it later to change the way my ship fires
  • CluvCluv Member Posts: 229
    I would create a second boolean, test it out, and see if it works. To be honest, booleans are throwaways. You might come up with a more elegant solution later.
  • matthewsuttlesmatthewsuttles Member Posts: 42
    ok i will try.... my brain hurts
  • CluvCluv Member Posts: 229
    Yeah, sorry dude. Maybe some rest and a second look wouldn't hurt either.

    Or turn off a few rules and start from square one. Try to catch the problem at the source, not at the end.
  • matthewsuttlesmatthewsuttles Member Posts: 42
    I have tried but I don't understand the results, they don't make sense.
  • CluvCluv Member Posts: 229
    set your money to 0. see if without parameters it works. Take some of the variables out of the equation to see who is causing it.
  • matthewsuttlesmatthewsuttles Member Posts: 42
    I figured it out. I was trying to do too much on one actor. I made a separate purchase scene and select scene. And when parameters were set correctly some actors move in and take the place of other actors while the others move off scene.
  • CluvCluv Member Posts: 229
    cool
Sign In or Register to comment.