I can make a loop in the GS?

hlonderohlondero Member Posts: 20
edited April 2012 in Working with GS (Mac)
I can make a loop in the GS?

Best Answer

  • tatiangtatiang Posts: 11,949
    edited April 2012 Accepted Answer
    Replace the log statement with your load attribute rule. I'm not sure if you can concatenate key names (e.g. "SavedKeyNumber"..game.loopcounter), so you might have to have a rule in the loop that says When self.loopcounter=1 LoadAttribute SavedKey1; when self.loopcounter=2 LoadAttribute SavedKey2; etc.


    image

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

Answers

  • hlonderohlondero Member Posts: 20
    I need to load and check 33 attributes.

    example:
    Load attribute 1
    Check ...
    Load attribute 2
    Check ...
    ...
    ...

    In code would be "For 1 to 33"
  • hlonderohlondero Member Posts: 20
    It worked perfectly
    I had tried a similar fashion but without the timer.

    Yes, i can use self.loopcounter in the Key of Load Attribute.

    Thank tatiang. ^:)^
  • Rob2Rob2 Member Posts: 2,402
    Last time I checked timers topped out at about a 30th of a second (0.033 ish) so although set at zero its worth remembering that there is a speed limit :)
  • EatingMyHatEatingMyHat Member Posts: 1,246
    I don't believe you can use the loop counter in the Load Attribute Key. You will have to have separate keys and separate Load Attribute behaviors. As far as I recall, the key can only be a string and not an expression.



    Follow Eating My Hat on Facebook, Twitter and the Blog
    Check out my templates in the GS Marketplace or at the store
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Last time I checked timers topped out at about a 30th of a second (0.033 ish) so although set at zero its worth remembering that there is a speed limit :)
    I tend to use 0.1 (or 0.05 if I can get it to work) timers in that situation, but I had seen someone recently post an example with a 0 second timer, so I thought I'd give it a shot.

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

  • OpenFlo_StudioOpenFlo_Studio PRO Posts: 32
    This is amazing Tatiang. I will try adding the timer since I am having problems with using a rule to make a loop.
Sign In or Register to comment.