Rule only activating once, when triggered by multiple attributes...

0belisk0belisk PRO Posts: 189
edited May 2012 in Working with GS (Mac)
Image and video hosting by TinyPic

i want this to trigger, whenever one of the attribute values become true, so far there are 9. however after the rule has been triggered once, it no longer activates.

e.g. say "high roller" becomes true, it activates as normal. then 5 minutes later during gameplay "truly unfortunate" becomes true, nothing happens.

can't think of a way to make the rule constantly look to see if any new attributes have also become true and activate, couldn't see how to do it with the constrain attribute, and didn't want to make a rule for every single attribute either, hoping its feasible within 1 rule.

thanks

Answers

  • MotherHooseMotherHoose Member Posts: 2,456
    once any of the conditions in the rule triggers the spawn … the rule is done

    so separate conditions into separate rules for each condition

    ==IMO it my be best to just:
    add gameAttribute … boolean type … named something like Celebrate

    Rule: when
    Attribute: game.Celebrate is true
    -Spawn Actor
    -spawn Actor
    -changeAttribute: game.Celebrate To: false

    and on the actor in the Rule that changes their gameBoolean to true
    add a changeAttribute: game.Celebration To: true

    image MH
  • 0belisk0belisk PRO Posts: 189
    edited May 2012
    tested it out but still the rule only activates once, so you reckon the only possibility is to make a rule for every single attribute? at the moment i have 10 award attributes... would could potentially double, was really hoping for a method to avoid this, seems excessive..
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    What about wrapping the rule you posted (with 9 conditions) inside of a rule that checks to see if game.CheckRules is true? Set game.CheckRules to true initially. After the spawn behaviors, set game.CheckRules to false and then add a change attribute inside of a 0.1 timer set to "run to completion." Honestly not sure if that would work and it seems a bit silly, but it might fix it.

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

  • 0belisk0belisk PRO Posts: 189
    thanks for the idea but i tried it and still no luck, everything is pointing towards the direction that i require a separate rule for EVERY award attribute, unless somebody can show otherwise! :D
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2012
    My timer idea does work for checking multiple attributes but it needed tweaking because it would register repeatedly as true after a single attribute had changed value (rather than requiring a unique/new attribute to change).

    Instead of using booleans, I went with an index value that starts at 0 (false/locked), increases to 1 (true/unlocked), and then immediately increases to 2 (used/unlocked) so that once an attribute reaches 2, it won't trigger the spawn again.

    Here's a working version... hope it's helpful: http://dl.dropbox.com/u/19602014/Check all conditions.zip

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

Sign In or Register to comment.