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

    How to spawn a buddy?

    Scheduled Pinned Locked Moved
    Help and Support
    5
    39
    1.9k
    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.
    • iTap DevelopmentI
      iTap Development @Deeeds
      last edited by

      @Deeeds is having the mate and buddy see each other’s position and move based on the position(or something like that) good enough?

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

        @iTap-Development For an example of communication, think of something that can only be seen internally by mate and buddy. Say, for example, the result of some calculation in Mate that he wants to share with his buddy.

        iTap DevelopmentI 1 Reply Last reply Reply Quote 0
        • D
          Deeeds @iTap Development
          last edited by

          @iTap-Development and CHEERS ! For the time and consideration. THANK YOU!

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

            @Deeeds Yes, it is possible, but not as easy as you’d like.

            This is for my new “KrystalOS” (touch-screen OS simulator)
            I’ve successfully made a Loop spawn my “App_Base” object, each of their X coord is unique (in the spawn Loop, SpawnObjectX = LoopIndex).

            After this loop finishes, another loop runs which broadcasts to each individual app by using their unique broadcast key (from the x position) in the broadcast, I send them their App Name and App Index.

            D 2 Replies Last reply Reply Quote 0
            • iTap DevelopmentI
              iTap Development @Deeeds
              last edited by

              @Deeeds great! I’ll see what I can do.

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

                @Kamdroid This is very similar to my testbed.

                The initial loop is exactly like yours, the index is used as an ID for the spawned objects.

                Then the spawned objects are each spawning One buddy for themselves, and giving him that ID as channel to receive messages on.

                Then the "master" will sometimes send details about events in its world to its buddy. And this is where things aren't working as expected, or reliably.

                That I need to go to this degree of bother is also INFURIATING me. It's not often I beg for encapsulation and polymorphism. But I do today.

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

                  @Kamdroid This has taught me a very dirty trick. I spawn the objects to a position of x based on their index, and then, inside them, use a "get position" to create their ID, then use an array of their desired positions to move them where they should, also based on that index value, as their desired position is in that array.

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

                    @Deeeds I honestly don’t find it too dirty, it’s quite easy to implement

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

                      @Kamdroid It has an upside, no need for that 0.017 delay before getting doing things internally.

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

                        How I usually handle initialization is by creating a receive message behavior and call it initialize. And every time you spawn an object, broadcast initialize.

                        Then on the initialize, get a value from a global count somewhere on your scene like an object on global ui that has an attribute like count. Then set the spawned objects “id” attribute to that count. Then increment that count.

                        Now, the spawned object has an id that you can use before the next time step!

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