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

    Track number of spawned objects?

    Scheduled Pinned Locked Moved
    Help and Support
    4
    12
    659
    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.
    • ThisT
      This
      last edited by

      I have a few different characters that are spawned during the game. I want to add a behavior that tracks the number of spawned characters and triggers an event once the number of spawned pass a certain number. Any idea how to do this?

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

        @This you could use any of the multiple storage behaviors, such as box containers, attributes, etc. and when you spawn, just add 1. Then you connect an "if" and check to see if the added number is equal to the number you want to trigger behaviors at. The you could use the "execute behavior" behavior to trigger the behaviors.

        ThisT 1 Reply Last reply Reply Quote 0
        • ThisT
          This @iTap Development
          last edited by

          @iTap-Development Thanks for this. I'm having trouble finding any documentation on how to us these behaviors. Any tutorial recommendations you know of?

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

            @This here are two pictures of how this could look! It would probably be easiest to follow the second picture with box containers.1_1488742824875_IMG_1366.PNG 0_1488742824872_IMG_1365.PNG

            ThisT 1 Reply Last reply Reply Quote 0
            • ThisT
              This @iTap Development
              last edited by

              @iTap-Development Thanks for this! Very helpful. One follow up question. Is it possible to have values deposited into the box from various objects? I have three different creatures that are spawned. I want to have the behavior executed when the aggregate of them passes a certain count.

              MurtazaM iTap DevelopmentI 2 Replies Last reply Reply Quote 0
              • MurtazaM
                Murtaza Admin @This
                last edited by

                @This
                Box containers are pretty much contained within that object.

                If you want to have a more "public" value that can be change by other objects use attributes instead.
                You can create an attribute on an object, then use set attribute from any other object to set the attribute (in this case increase) for the object.

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

                  @This if you do attributes, you'll have to remember to select the object that you created the attribute on if you want to change the attribute from another object.

                  1 Reply Last reply Reply Quote 0
                  • ThisT
                    This
                    last edited by

                    Thanks all! I'm messing around with attributes, but don't seem to be able to crack it. Any chance you could post a screen grab of how this would be done with attributes?

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

                      @This my first pic is for doing it with attributes.

                      Aidan_FireA 1 Reply Last reply Reply Quote 0
                      • Aidan_FireA
                        Aidan_Fire @iTap Development
                        last edited by

                        @iTap-Development I don't know if this goes for anyone else, but I see no picture. Here's mine:
                        0_1488832564897_IMG_3414.PNG
                        If more than one object is spawning what you want to count or the counted objects can delete themselves, use attributes and make sure they all select the same attribute from the same object, otherwise you could use either attributes or box container.

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

                          @Aidan-Oxley that's weird, I posted two(the same as yours) right before @This 's second to last comment.
                          @This can you see them? Here they are again if you need them!1_1488835519800_IMG_1366.PNG 0_1488835519797_IMG_1365.PNG

                          1 Reply Last reply Reply Quote 0
                          • ThisT
                            This
                            last edited by

                            Thank you all!

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