GameSalad

[Solved] Rule problem: DO and ELSE both run?

creyecreye Posts: 16Member, BASIC
edited August 17 in Working with GS (PC)

Hi guys,

I have a pretty annoying problem and I have no clue what's wrong.

When I try to interpolate an actor, or make it appear from alpha 0 to 1 through change attribute, it also affects another actor. Which it shouldn't since the ruleset at hand don't apply to the 2nd actor in any sense. There are however other groups of rules in the same actor (from which I control the other 2 actors) which affects it, though.

I've tried numerous solutions, with different rules, utilizing "else" in the same rule, etc. Logically to me this can be nothing but a bug, but I only used GS for a few weeks yet, so...

In the screenshot you can see the issue: the conditions for the "DO" are met, and I see the DO-specific rules go into action. But still the rules under ELSE also runs. The interpolate of scene.Background.Wrong answer is the rule which pops the actor when it shouldn't (verified through deactiving it).

Any suggestions?

BR
Tomas

Comments

  • creyecreye Posts: 16Member, BASIC

    @tatiang help me figure this out and I will thank you in the credits of my awesome app once (if, my humble sense tells me) it's released. :wink:

  • tatiangtatiang Posts: 11,039Member, Sous Chef, PRO, Senior Sous-Chef

    No need to thank me in your credits. I prefer more of a "pay it forward" approach whereby -- when possible -- you help others.

    If you want to send me the project file or post a download link here, I can probably spot the problem in your rules pretty quickly. It could be a bunch of things including unlocked "instances" of an actor in a scene but it's hard to know just by looking at one rule. As I said in another thread recently, you can start turning behaviors or rules off one by one to see what is causing the seemingly duplicate actions.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • creyecreye Posts: 16Member, BASIC

    @tatiang said:
    No need to thank me in your credits. I prefer more of a "pay it forward" approach whereby -- when possible -- you help others.

    If you want to send me the project file or post a download link here, I can probably spot the problem in your rules pretty quickly. It could be a bunch of things including unlocked "instances" of an actor in a scene but it's hard to know just by looking at one rule. As I said in another thread recently, you can start turning behaviors or rules off one by one to see what is causing the seemingly duplicate actions.

    Appreciate it. Files in priv msg. Will share solution here in case someone else run into the same issue.

    BR
    Tomas

  • creyecreye Posts: 16Member, BASIC
    edited August 17

    Edit: I'd prefer to mark the thread as [SOLVED] in the topic but I guess the forum won't let me. Anyhow. SOLVED. :)

    So Tatiang gave me a few pointers and helped me solve the issue.

    Basically I didn't make a waterproof logic for my answer attribute, which made the game keep running through the rules and thereby executing the wrong interpolate behaviour as well.

    The complete ruleset looks like this:

    • The blue marked rule is what solved it, excluding the posibility of running the rules unless that was the exact condition
    • I also could get rid of an excess boolean attribute that I had made to indicate that there was an answer given.

    Again, thx Tatiang!

    BR
    Tomas

  • tatiangtatiang Posts: 11,039Member, Sous Chef, PRO, Senior Sous-Chef

    You're welcome! Just to explain a bit further, since I offered this as a private message, the problem was that your rules were evaluating the value of a keyboard input attribute right after the keyboard input behavior and since there is no built in "wait" behavior, the next rule was immediately checking to see the value of the keyboard input attribute which is initially blank (""). So the fix was to add a rule condition to make sure that that attribute was not blank (e.g. text was entered) before evaluating its value for whatever answer you need.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.