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

    Use Loop behaviour to dynamically create objects

    Scheduled Pinned Locked Moved
    Comments & Feedback
    suggestion
    4
    13
    441
    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.
    • KamdroidK
      Kamdroid
      last edited by

      I am having issues trying to use new Broadcast behaviours to make dynamically spawned objects, and it seems they are not fast enough to be used in Loop behaviour either.

      When using the spawn object behaviour, can you make an option to not copy original object state to the new object.

      What would be even better, is a way to create a new instance of the object, apply behaviours to it (e.g. Set Text, Set Color, Position etc) and after that, spawn it, and they will have the applied behaviours done before.

      Aidan_FireA 1 Reply Last reply Reply Quote 1
      • Aidan_FireA
        Aidan_Fire @Kamdroid
        last edited by

        @Kamdroid You could try first running the loop and spawning all the object, then the very next frame apply stuff to them and broadcast your message? I’m not sure how your project works or what it does though.

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

          @Aidan-Oxley For Example, I want to make a dynamic text list of shopping items; [“Milk”,”Eggs”,”Bread”]. I tried using a loop to spawn the a text object which is listening to broadcast “text_init”, which that is broadcasted straight after the object (text) spawned. The first thing the text object does when the broadcast received is triggered is to turn off the broadcast receive behaviour to prevent from it receiving other broadcasts for different text objects, and set the text (itself) to the value which was from the broadcast received. However all of them set to the last one (Bread, in this example).

          The list can’t be a single text object, as I want control over the spacing and each of them has a background, and an “X” button to delete that particular item, which would need to be able to receive the index number of the currently looped array item.

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

            Ooh I like the idea of having different states of behaviours. Currently we have everything running On object creation. But would be cool to create behaviours for Before Creation and After Destroy @Murtaza

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

              Here is a somewhat crappy idea of what it would be as behaviours, just an example for a label object, but this applies with probably all object manipulation behaviours (as they are able to not only select an object in your scene, but also drag in a object output value, as indicated as the up arrows)

              This would be done by clicking on the behaviour which needs you to select an object. Drag the output/result box into the area of the object selection box.

              Or it could also just use the spawn object behaviour too.0_1510829584091_7B910A4F-C9D5-4F2B-B891-61F74983C23C.jpeg

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

                @Kamdroid Have you used other visual coding products?

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

                  @Deeeds Only Scratch, but that seems even more limited than HyperPad.

                  I prefer using C# instead of visual code (Unity is one of my favourites), but HyperPad has a lot of potential, and it’s nice to be able to develop games directly on your iPad.

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

                    @Kamdroid said in Use Loop behaviour to dynamically create objects:

                    it’s nice to be able to develop games directly on your iPad

                    This, a thousand times this!

                    Have you tried Codea? It's documentation is GOOD!

                    Drawing engine... not so much.

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

                      @Kamdroid I've toyed with Scratch, if you'll excuse the pun. And iStencyl and a bunch of other derivatives of the ideas Scratch descends from.

                      It's limited by the rules they put on themselves in terms of teaching over using, and theories over learning. I think. And the design is woeful. As if someone gave an engineer access to Microsoft Paint and said... this is the only design app ... in.the.world!

                      It's been a part of my research, but only because it's so heavily promoted and pushed by the powers that be. I honestly can't think of a worse paradigm for visual programming.

                      In Unity there was this thing called Antares Universe that was astonishing. The guy that made that is probably one of the all-time great thinkers on how to transform C# into visual coding. It's almost 1:1, which means it's difficult for new users, but very helpful for teams. His ideas live on, which is fantastic.

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

                        @Deeeds I’ve seen Codea before, but I still rather Unity, as Codea uses Lua and can only be exported to Xcode.

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

                          @Kamdroid I was comparing Codea to hyperPad, in the sense that it's all possible on iPad. Not comparing it to Unity.

                          Unity, though, needs everything exported to Xcode, too, in the sense you mean. So does hyperPad, so far as I know. I haven't submitted anything or figured out what it exports, yet.

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

                            @Deeeds Oh, yes, comparing to HyperPad, Codea is a better option for those who don’t mind coding.

                            I meant that Codea can only export to Xcode (iOS, but please correct me if I’m wrong), whereas Unity can export to a lot of different platforms. (Windows, Mac, Web, Android, iOS etc)

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

                              @Kamdroid Yes, you've got that right. I think Codea might be able to export to Mac and Apple TV as well as iOS, but haven't used it for a while. I used to like browsing its documentation and trying out things that caught my eye. It's an incredibly polished piece of work. Two Australians, I believe.

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