logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Broadcast message in a loop

    Scheduled Pinned Locked Moved
    Non-Issue
    5
    6
    300
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Jack8680J
      Jack8680
      last edited by

      Broadcast message in a loop doesn't work. It does work in a timer but that's slow for looping through multiple dynamic messages. I'm assuming it's the same as how behaviours with a duration other than 0 don't work in loops and timer(0s). I hope this can be changed.

      Also, I already previously posted this a while ago, but conditional loops still say "loop until {condition}" but actually do "loop while {condition}". E.g. "Loop until < 10" loops WHILE less than 10.

      KamdroidK 1 Reply Last reply Reply Quote 0
      • KamdroidK
        Kamdroid @Jack8680
        last edited by Kamdroid

        @Jack8680 Yea, Loop behaviour really should be allowed to have delays. Still finding myself using timer instead if Loop due to this.

        1 Reply Last reply Reply Quote 0
        • HamedH
          Hamed Admin
          last edited by

          Sorry this got buried.

          This isn't actually a bug. Broadcast message does work in a loop, the thing is that if you put a both a loop and a receive message behaviour onto the canvas, they can be executed in any order. The problem occurs when the loop behaviour is executed before the receive message behaviour is.

          Solution: Put the loop and receive message behaviours into the same behaviour bundle, with the receive message executed before the loop behaviour.

          Aidan_FireA Jack8680J 2 Replies Last reply Reply Quote 0
          • Aidan_FireA
            Aidan_Fire @Hamed
            last edited by Aidan_Fire

            @hamed What if I am broadcasting in a loop from one object, and I want to receive the message in a different object? Loop and receive can't be in the same bundle then. EDIT: Nevermind idk what this is talking about because I just tested exactly what I just said and it works fine. Broadcast a message 50 times in a loop, the other object received 50 messages.

            1 Reply Last reply Reply Quote 0
            • Jack8680J
              Jack8680 @Hamed
              last edited by

              @hamed yeah this is old, I think I made a post later saying I was wrong and made a mistake somewhere else that made it seem like it didn't work in a loop, was probably that the broadcast ran before receive was intitialised.

              D 1 Reply Last reply Reply Quote 0
              • D
                Deeeds @Jack8680
                last edited by

                @jack8680 I hadn't realised this before... but this seems to mean it's possible to send unique messages to unique objects, like iterating over them.

                Which is kind of cool.

                Very messy to setup and test, but potentially powerful.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post