How do I prevent an actor from infinitely spawning check marks after an attribute is changed?

In my game, I have a set of achievements which, when the player completes them, trigger an attribute respective to them to change to a certain, permanent value. After this is complete, I further wrote the rules so that an actor within the "achievements scene" spawns a check mark near the name of the completed achievement. My problem is that once the aforementioned attribute is changed to its new, permanent value, the actor found within the "achievements scene" continues to spawn the check marks infinitely since the attribute remains at that value.

My goal is to only make the actor spawn one check mark after the achievement is completed; after that new check marks for the achievement are obviously not needed. I tried making a rule which says that if the attribute is changed, then the actor which spawns the check mark is destroyed. However this didn't work because every time I entered the "achievements scene," the actor created another check mark before disappearing.

Any help?

Thanks!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    I fully understand what you're saying and yet without seeing your rules I have no idea how to help you.

    Generally, this would be done by creating a boolean (either attribute or table cell value) and changing the value from false to true once the achievement is completed. Then the spawner actor would have a rule that says When boolean attribute is true --> spawn [check mark actor].

    Rules only trigger when their condition changes. So if you have that rule and the boolean attribute changes from false to true, it will spawn one actor. It won't spawn again unless that attribute then changes from true to false and from false to true once more.

    Are you using the same attribute for multiple rules or multiple actors? Are you resetting the attribute at some point, which would make the rule trigger again later? Are you using timers or something else that would repeat the spawn behavior?

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

  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    @tatiang I have now realized that I was misinterpreting the behavior of the actor which spawns the check marks; what you said about rules triggering after a change in condition held true in my case because only one check mark was being spawned. Like I said in a recent post I'm getting reacquainted with Gamesalad after a rather prolonged break so unfortunately things like these will happen for a bit. This thread can now be closed. Thanks for the reply!

    Zenith_Gameworks
This discussion has been closed.