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. How to spawn a buddy?

How to spawn a buddy?

Scheduled Pinned Locked Moved Help and Support
39 Posts 5 Posters 14.3k Views 2 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.
  • D Offline
    D Offline
    Deeeds
    wrote on last edited by
    #1

    Imagine an object wants to spawn a buddy it can instruct and it can know about, more than once.

    In other words, it can set properties on its buddy, and it can get properties from its buddy, and it can know when its buddy has collided with something else.

    Is any of this possible?

    How?

    iTap DevelopmentI Aidan_FireA 2 Replies Last reply
    0
    • D Deeeds

      Imagine an object wants to spawn a buddy it can instruct and it can know about, more than once.

      In other words, it can set properties on its buddy, and it can get properties from its buddy, and it can know when its buddy has collided with something else.

      Is any of this possible?

      How?

      iTap DevelopmentI Offline
      iTap DevelopmentI Offline
      iTap Development
      wrote on last edited by
      #2

      @Deeeds using broadcasts similar to how I was saying before. Just need to do a little simple setup.

      D 1 Reply Last reply
      0
      • iTap DevelopmentI iTap Development

        @Deeeds using broadcasts similar to how I was saying before. Just need to do a little simple setup.

        D Offline
        D Offline
        Deeeds
        wrote on last edited by
        #3

        @iTap-Development "Simple", says you.

        As I said before, I'm coming from languages and environments where there are more ways to establish lines of communication than can ever be needed -> to this one where there are no references, of any sort, and it's unknown how costly broadcasting and receiving actually is, and wherein that's been tacked on to make up for whatever it was like before that.

        iTap DevelopmentI 1 Reply Last reply
        0
        • D Deeeds

          @iTap-Development "Simple", says you.

          As I said before, I'm coming from languages and environments where there are more ways to establish lines of communication than can ever be needed -> to this one where there are no references, of any sort, and it's unknown how costly broadcasting and receiving actually is, and wherein that's been tacked on to make up for whatever it was like before that.

          iTap DevelopmentI Offline
          iTap DevelopmentI Offline
          iTap Development
          wrote on last edited by
          #4

          @Deeeds yep! I said simple.
          You said, “it's unknown how costly broadcasting and receiving actually is”, why not just build a project to test it then? When I don’t know what a feature is capable of, I test it.
          Have you even figured out how to add behaviors yet?

          D 2 Replies Last reply
          0
          • iTap DevelopmentI iTap Development

            @Deeeds yep! I said simple.
            You said, “it's unknown how costly broadcasting and receiving actually is”, why not just build a project to test it then? When I don’t know what a feature is capable of, I test it.
            Have you even figured out how to add behaviors yet?

            D Offline
            D Offline
            Deeeds
            wrote on last edited by
            #5

            @iTap-Development Have you even figured out how to think conceptually?

            1 Reply Last reply
            0
            • iTap DevelopmentI iTap Development

              @Deeeds yep! I said simple.
              You said, “it's unknown how costly broadcasting and receiving actually is”, why not just build a project to test it then? When I don’t know what a feature is capable of, I test it.
              Have you even figured out how to add behaviors yet?

              D Offline
              D Offline
              Deeeds
              wrote on last edited by
              #6

              @iTap-Development Or how to add links, or how to discuss sensibly, or how to explain yourself, or how to not act like a smug little runt?

              iTap DevelopmentI 1 Reply Last reply
              0
              • D Deeeds

                @iTap-Development Or how to add links, or how to discuss sensibly, or how to explain yourself, or how to not act like a smug little runt?

                iTap DevelopmentI Offline
                iTap DevelopmentI Offline
                iTap Development
                wrote on last edited by
                #7

                @Deeeds 🤣🤣🤣
                If you mean like open url........um, if I can use a location and weather api to make a weather app. Let’s just say....what the heck?

                1 Reply Last reply
                0
                • D Deeeds

                  Imagine an object wants to spawn a buddy it can instruct and it can know about, more than once.

                  In other words, it can set properties on its buddy, and it can get properties from its buddy, and it can know when its buddy has collided with something else.

                  Is any of this possible?

                  How?

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

                  @Deeeds What sort of properties? Objects can always Get and Set properties of each other, and for detecting its collision, just have the buddy selected as the first collision target. I’m guessing you know how to select targets with behaviours that target objects?

                  D 1 Reply Last reply
                  0
                  • Aidan_FireA Aidan_Fire

                    @Deeeds What sort of properties? Objects can always Get and Set properties of each other, and for detecting its collision, just have the buddy selected as the first collision target. I’m guessing you know how to select targets with behaviours that target objects?

                    D Offline
                    D Offline
                    Deeeds
                    wrote on last edited by
                    #9

                    @Aidan-Oxley I think you're missing the part that's problematic, for me.

                    I'm spawning the buddy.

                    Therefore I don't have a reference to him. So I can't get anything from him, or set anything on him, nor can he know who I am.

                    Aidan_FireA 2 Replies Last reply
                    0
                    • D Deeeds

                      @Aidan-Oxley I think you're missing the part that's problematic, for me.

                      I'm spawning the buddy.

                      Therefore I don't have a reference to him. So I can't get anything from him, or set anything on him, nor can he know who I am.

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

                      @Deeeds Ohhh I see. Ok there is a way to do this, but it’s pretty ridiculous and shouldn’t have to happen. This is where dynamic object targeting would be awesome. The only way to do this at the moment is to either broadcast messages n stuff or put the buddy in a tag and have the spawned object collide with that tag and underneath the collision behaviour have all the stuff you want to do to the object. Either way it’s not gonna be easy I think.

                      1 Reply Last reply
                      0
                      • D Deeeds

                        @Aidan-Oxley I think you're missing the part that's problematic, for me.

                        I'm spawning the buddy.

                        Therefore I don't have a reference to him. So I can't get anything from him, or set anything on him, nor can he know who I am.

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

                        @Deeeds I used collisions in my 3D project, where points would collide with triangle faces once, and then run a timer on a get position behaviour that ran under the collided behaviour. It was pretty annoying and messy to get this to work, also I didn’t have dynamic broadcasts when I made that. But I think for your case it might be better to use broadcasts messages. Here’s how I’d do it:

                        I don’t know how many buddies you’re gonna have, but for simplicity I’m gonna say just 1.
                        Instead of the buddies spawner changing the properties, the buddy will change its own properties. Each property will be given its own broadcast/receive key.
                        When the main object wants to change a buddy’s property, it simply broadcasts a certain message and includes in it the data of the new property you want (e.g, I want to change its mass to 5, broadcast key is say MASS, value is 5). The buddy then receives the message with key MASS, and changes it’s own mass to the value given, 5.

                        This can work too if there are more than 1 buddy. How easy it is to make depends on how many buddies there are.

                        D iTap DevelopmentI 2 Replies Last reply
                        0
                        • Aidan_FireA Aidan_Fire

                          @Deeeds I used collisions in my 3D project, where points would collide with triangle faces once, and then run a timer on a get position behaviour that ran under the collided behaviour. It was pretty annoying and messy to get this to work, also I didn’t have dynamic broadcasts when I made that. But I think for your case it might be better to use broadcasts messages. Here’s how I’d do it:

                          I don’t know how many buddies you’re gonna have, but for simplicity I’m gonna say just 1.
                          Instead of the buddies spawner changing the properties, the buddy will change its own properties. Each property will be given its own broadcast/receive key.
                          When the main object wants to change a buddy’s property, it simply broadcasts a certain message and includes in it the data of the new property you want (e.g, I want to change its mass to 5, broadcast key is say MASS, value is 5). The buddy then receives the message with key MASS, and changes it’s own mass to the value given, 5.

                          This can work too if there are more than 1 buddy. How easy it is to make depends on how many buddies there are.

                          D Offline
                          D Offline
                          Deeeds
                          wrote on last edited by
                          #12

                          @Aidan-Oxley Here's my "fix", that's not working.

                          Each buddy has a Channel_ID that he listens on. These are the numbers, 1 through 9.

                          Each "mate" of a buddy stores a variable with the Channel_ID of his buddy.

                          When "mate" wants to send a message to his buddy, he's using that variable... which holds his number for his buddy.

                          But, for some reason, this isn't working.

                          Is there a rule against broadcasting with an Event key that's the contents of a variable and as simple as the number 1, 2, 3, etc..

                          iTap DevelopmentI 1 Reply Last reply
                          0
                          • Aidan_FireA Aidan_Fire

                            @Deeeds I used collisions in my 3D project, where points would collide with triangle faces once, and then run a timer on a get position behaviour that ran under the collided behaviour. It was pretty annoying and messy to get this to work, also I didn’t have dynamic broadcasts when I made that. But I think for your case it might be better to use broadcasts messages. Here’s how I’d do it:

                            I don’t know how many buddies you’re gonna have, but for simplicity I’m gonna say just 1.
                            Instead of the buddies spawner changing the properties, the buddy will change its own properties. Each property will be given its own broadcast/receive key.
                            When the main object wants to change a buddy’s property, it simply broadcasts a certain message and includes in it the data of the new property you want (e.g, I want to change its mass to 5, broadcast key is say MASS, value is 5). The buddy then receives the message with key MASS, and changes it’s own mass to the value given, 5.

                            This can work too if there are more than 1 buddy. How easy it is to make depends on how many buddies there are.

                            iTap DevelopmentI Offline
                            iTap DevelopmentI Offline
                            iTap Development
                            wrote on last edited by
                            #13

                            @Aidan-Oxley for buddy one just have it be ‘mass1” for buddy two “mass2” etc. just increase a number by 1 each time you spawn a new buddy and combine it to the “mass” key. then You can have unlimited buddies. Then @Deeeds won’t be so lonely!

                            1 Reply Last reply
                            0
                            • D Deeeds

                              @Aidan-Oxley Here's my "fix", that's not working.

                              Each buddy has a Channel_ID that he listens on. These are the numbers, 1 through 9.

                              Each "mate" of a buddy stores a variable with the Channel_ID of his buddy.

                              When "mate" wants to send a message to his buddy, he's using that variable... which holds his number for his buddy.

                              But, for some reason, this isn't working.

                              Is there a rule against broadcasting with an Event key that's the contents of a variable and as simple as the number 1, 2, 3, etc..

                              iTap DevelopmentI Offline
                              iTap DevelopmentI Offline
                              iTap Development
                              wrote on last edited by
                              #14
                              This post is deleted!
                              D 1 Reply Last reply
                              0
                              • iTap DevelopmentI iTap Development

                                This post is deleted!

                                D Offline
                                D Offline
                                Deeeds
                                wrote on last edited by
                                #15

                                @iTap-Development Each buddy has a receive message, and looks to his variable (which should be unique) to see what "channel" he should be listening on.

                                This variable is set when he's spawned.

                                That part works

                                Him listening on the variable channel doesn't work.

                                iTap DevelopmentI 1 Reply Last reply
                                0
                                • D Deeeds

                                  @iTap-Development Each buddy has a receive message, and looks to his variable (which should be unique) to see what "channel" he should be listening on.

                                  This variable is set when he's spawned.

                                  That part works

                                  Him listening on the variable channel doesn't work.

                                  iTap DevelopmentI Offline
                                  iTap DevelopmentI Offline
                                  iTap Development
                                  wrote on last edited by
                                  #16

                                  @Deeeds are you willing to give a project to look at?

                                  D 1 Reply Last reply
                                  0
                                  • iTap DevelopmentI iTap Development

                                    @Deeeds are you willing to give a project to look at?

                                    D Offline
                                    D Offline
                                    Deeeds
                                    wrote on last edited by
                                    #17

                                    @iTap-Development No, I'm deep into something, and simply need to know... can a receiver use a variable as the Event Key?

                                    That is the part that's not working.

                                    iTap DevelopmentI 1 Reply Last reply
                                    0
                                    • D Deeeds

                                      @iTap-Development No, I'm deep into something, and simply need to know... can a receiver use a variable as the Event Key?

                                      That is the part that's not working.

                                      iTap DevelopmentI Offline
                                      iTap DevelopmentI Offline
                                      iTap Development
                                      wrote on last edited by
                                      #18

                                      @Deeeds as far as I know, yes. That’s why I suggested a project.

                                      D 1 Reply Last reply
                                      0
                                      • iTap DevelopmentI iTap Development

                                        @Deeeds as far as I know, yes. That’s why I suggested a project.

                                        D Offline
                                        D Offline
                                        Deeeds
                                        wrote on last edited by
                                        #19

                                        @iTap-Development Are you SURE it works? Have you ever done this?

                                        Spawn and object. Let's call him Mate

                                        Spawn an object to be Mate's Buddy

                                        Mate sends a channelID to Buddy

                                        Buddy sets that variable in his local storage.

                                        Buddy's got a Receiver with an Event Key that's set to that locally stored variable.

                                        Everything works except Buddy's receiver.

                                        D 1 Reply Last reply
                                        0
                                        • D Deeeds

                                          @iTap-Development Are you SURE it works? Have you ever done this?

                                          Spawn and object. Let's call him Mate

                                          Spawn an object to be Mate's Buddy

                                          Mate sends a channelID to Buddy

                                          Buddy sets that variable in his local storage.

                                          Buddy's got a Receiver with an Event Key that's set to that locally stored variable.

                                          Everything works except Buddy's receiver.

                                          D Offline
                                          D Offline
                                          Deeeds
                                          wrote on last edited by Deeeds
                                          #20

                                          @iTap-Development @Aidan-Oxley I found the problem.

                                          Buddy's Receiver is set by creating a copy of what's in the variable for itself, it's not a reference to the variable's contents (nor is looking contents via a pointer etc). So once it gets a value from the variable, it's got its own copy and isn't actually looking at the variable's contents to know what it's listening to.

                                          In the initial Spawning, he's getting a null as the receiving channel because the variable hasn't yet been initialised.

                                          And that never changes, even when the variable's value changes.

                                          A very slight delay before activating the receiver forces it to set itself with that variable after the variable has been initialised with the value of the previously received ChannelID from his Mate.

                                          This goes back to my other point, somewhere else, that I think broadcasting might be quite efficient, and that @hamed is setting up fast lookup tables for messaging and been a clever fella about how he's done messaging, even if nobody has bothered to describe how/why it works the way it does.

                                          iTap DevelopmentI 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