If either one of the 2 conditions are valid, otherwise doesn't work?

justinodunnjustinodunn Member, PRO Posts: 226

i have a rule in which if any of the two conditions valid, if highscore is x or if total coins is x, it will cause the actor to change opacity to 1, but otherwise, remain 0. But how come it doesn't work? If either one of those conditions were valid it didn't work.

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Does the actor start with opacity set to zero?

  • justinodunnjustinodunn Member, PRO Posts: 226

    @The_Gamesalad_Guru said:
    Does the actor start with opacity set to zero?

    No it doesn't

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Start the actor with the opacity of zero. Otherwise only works after the rule fires the first time.

  • justinodunnjustinodunn Member, PRO Posts: 226

    Okay let me give it a try after dinner :)

  • justinodunnjustinodunn Member, PRO Posts: 226

    What if it was a change attribute behavior?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    We're you using a constrain? If so that won't work, you need to be using a change attribute.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2014

    @justinodunn Also to add:

    So to summarise what the other guys said, your Rules should look like this (assuming "x" is just a substitute to show an actual number, not an attribute holding a number):

    Rule set to Any: When highscore = x or total coins = x
    Change Attribute YourActor.Alpha to 1
    Otherwise
    Change Attribute YourActor.Alpha to 0
    

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934

    I would suspect you don't have your rule set to any condition instead of all conditions.

  • justinodunnjustinodunn Member, PRO Posts: 226

    Okay here is my full rule, at first when it was just one condition (high score) it worked perfect. But it stopped working when I added a second condition (total score).

    When "highscore x < 250" or when "total score < 12000", change attribute self blue/red/ green to 0. change attribute "scene lock" to false.

    Otherwise

    change attribute self blue/red/green to 1 and change attribute "scene lock" to true

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2014

    Hi @justinodunn Reading your fist post in your thread, you said you wanted the opacity toggled yet in your example above, your choice involves either black or white...

    But if you still want to toggle the opacity, try this:

    Rule set to Any: When highscore x <250 or total score < 12000
    Change Attribute YourActor.Alpha to 1
    Change Attribute scene lock to false
    Otherwise
    Change Attribute YourActor.Alpha to 0
    Change Attribute scene lock to true
    

    but if you still want black or white, as this:

    Rule set to Any: When highscore x <250 or total score < 12000
    Change Attribute YourActor.Red to 0
    Change Attribute YourActor.Green to 0
    Change Attribute YourActor.Blue to 0
    Change Attribute scene lock to false
    Otherwise
     Change Attribute YourActor.Red to 1
    Change Attribute YourActor.Green to 1
    Change Attribute YourActor.Blue to 1
    Change Attribute scene lock to true
    

    But if you've already got either of those, best to make a screen grab of the Rules for us to take a look see what else is going on...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • justinodunnjustinodunn Member, PRO Posts: 226

    Yes I put those and it still didn't work. THe scene lock attribute is meant to trigger this other scene lock attribute. That other scene lock attribute will then change the opacity of the "locked" actor to 1 when it is true. The deal is that this is a character selection screen, and that the user must reach that score or total score in order to unlock the character.

    Here's the part that triggers that other scene lock.

    Basically I want it so if user doesn't get enough either high score/ total score, the character will appear black and the scene lock (2) will trigger scene lock to become true, therefore when it is true, it will cause another actor "locked" opacity to become 1. OTherwise, if the user reaches either one of those scores, it will cause the actor to their normal colors, and will cause the scene lock (2) to become false. Therefore, the other scene lock would be false, therefore the "locked" actor opacity would be 0, making that the user unlocked that character.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2014

    @justinodunn‌ I'd like to make a suggestion - Decide on which part of your programming you want to report a problem on and stick to it in the one thread... I know your different explanations of problems all revolve around a similar theme but it get slightly tiring and difficult to grasp with what you actually want help with, when these things change all the time... (gotta be said...)

    @justinodunn said:
    ...if highscore is x or if total coins is x, it will cause the actor to change opacity to 1...etc

    @justinodunn said:
    Okay here is my full rule, at first when it was just one condition (high score) it worked perfect. But it stopped working when I added a second condition (total score).

    When "highscore x < 250" or when "total score < 12000", change attribute self blue/red/ green to 0. change attribute "scene lock" to ...etc

    From your post above:

    When scenelock is false
    When scene.counter less than = to... etc

    So jumping from highscore & total coins... to highscore & total score.... from = "x" to highscore x =... to RGB changing to 1 or 0, earlier on it was an Alpha change.... then suddenly we're talking about lock and counter....

    All I'll say now is the screenshot rules you posted above look OK to me.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • justinodunnjustinodunn Member, PRO Posts: 226

    Apologies for that, I wanted to keep things simple at the beginning. well it's not working fully :neutral_face: , like the character's color changes yes, but it doesn't seem to trigger scenelock.

    Are there any other ways to do this?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited July 2014

    We need to see all the code trees related to what you're trying to do. You are all over the place with your explanations. I images this mirrors your thinking on this and your code is wrong. Logic is a string of events and need orderly thought across it all. Write out your code on paper in a logic tree in the order of events and you will find the offending code. You're not thinking in a linear fashion.

  • justinodunnjustinodunn Member, PRO Posts: 226

    Sorry for the trouble guys, I decided to just redo that part again, now it works. Thanks for the help though!

Sign In or Register to comment.