!!! Please HELP With (Tricky) Logic PROBLEM!!!

Zenith_GameworksZenith_Gameworks Member Posts: 310
edited April 2013 in Working with GS (Mac)
I want to make an achievement in my game that if you don't move for a certain "x" amount of seconds, in a row and at the start of the scene, an attribute is changed from one value to another. I have been trying several rules mixed with a timer but the attribute is changed as soon as the scene starts, and not when I want it to. So far, I tried For 3 seconds, if self.motion.linear.velocity.x (something like that attribute) = 0, change attribute to 1 (from 0). I also tried: For 3 seconds, if self.position.x = 0, change the attribute. I have run to completion checked. Any advice would be much appreciated.

Comments

  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    Bump...
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @Zenith_Gameworks it sounds like you can use the scene Time in this situation...

    So something like:

    When Attribute scene.Time = 3 and yourActor.Position.X = (starting unmoved x pos.) and yourActor.Position.Y = (starting unmoved y pos.)
    Change Attribute UnMoved to true

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

  • Zenith_GameworksZenith_Gameworks Member Posts: 310

    Hi @Zenith_Gameworks it sounds like you can use the scene Time in this situation...

    So something like:

    When Attribute scene.Time = 3 and yourActor.Position.X = (starting unmoved x pos.) and yourActor.Position.Y = (starting unmoved y pos.)
    Change Attribute UnMoved to true
    Thanks so much! It works! But I thought I might say that the Y position attribute is irrelevant and when I used it it didn't work. But, after ditching that, everything is running to my liking ;).
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Good stuff, glad it worked out for you. :-)

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @Zenith_Gameworks For future reference, embedding a rule within a "For" timer just means that the rule is only being checked for that many seconds (e.g. three). It doesn't mean that the rule is being transformed into "if this happens for a duration of three seconds, then..."

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

Sign In or Register to comment.