Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. Execute and wait for behaviour bundle to finish

Execute and wait for behaviour bundle to finish

Scheduled Pinned Locked Moved Help and Support
5 Posts 3 Posters 971 Views 1 Watching
  • 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.
  • KamdroidK Offline
    KamdroidK Offline
    Kamdroid
    wrote on last edited by
    #1

    Is there a way to execute (behaviour on) a behaviour bundle, and wait for it to finish running before continuing the main code.

    Example:
    91EA4E2E-323B-48A9-A0C7-D3B371298053.jpeg

    1 Reply Last reply
    0
    • RobinsonXR Offline
      RobinsonXR Offline
      RobinsonX
      wrote on last edited by
      #2

      Use broadcast message and receive message. They work like "functions" where code will only continue to run after all the code in the receive message behavior has been executed.

      Broadcast message to call an event (you can put parameters in it too!) and receive message to handle the event.

      1 Reply Last reply
      0
      • Aidan_FireA Offline
        Aidan_FireA Offline
        Aidan_Fire
        wrote on last edited by Aidan_Fire
        #3

        How I’d do it: After the calculated result behaviour wherever it is, behaviour on the thing that does stuff with the calculated result. So you would disconnect Get Calculated Result and turn it off.
        FD287F69-0E80-418D-A0B8-548B5308BE85.png

        1 Reply Last reply
        1
        • KamdroidK Offline
          KamdroidK Offline
          Kamdroid
          wrote on last edited by
          #4

          Since I'll be using the "calculate result" function multiple times in different places, I think the best option is:

          • Use broadcast/receive message. When using "calculate result", supply a parameter that says the name of the "receive message" key to activate (basically a callback function)

          Which is similar to the separated behaviour bundle + "behaviour on" technique.

          If I could dynamically supply the name of what behaviour bundle I want to activate, then I would choose to do that, since having multiple "receive message" might have a tiny performance impact.

          Aidan_FireA 1 Reply Last reply
          0
          • KamdroidK Kamdroid

            Since I'll be using the "calculate result" function multiple times in different places, I think the best option is:

            • Use broadcast/receive message. When using "calculate result", supply a parameter that says the name of the "receive message" key to activate (basically a callback function)

            Which is similar to the separated behaviour bundle + "behaviour on" technique.

            If I could dynamically supply the name of what behaviour bundle I want to activate, then I would choose to do that, since having multiple "receive message" might have a tiny performance impact.

            Aidan_FireA Offline
            Aidan_FireA Offline
            Aidan_Fire
            wrote on last edited by
            #5

            @Kamdroid Just after doing some testing, for me the game seems to always actually wait for the calculation to finish before moving on to the next behaviour under behaviour on anyway, even when calculate result had loops.

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Search