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. Dictionary load and save tutorials

Dictionary load and save tutorials

Scheduled Pinned Locked Moved Help and Support
39 Posts 4 Posters 479 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.
  • MrAeon1111M MrAeon1111

    How to delete a spawned object from the array?
    I pick up an object and that object appears in the inventory. I want to remove the object from the inventory and from the array at the same time. Destroying the inventory object itself is easy, but I don’t know how to remove the source object (the one that was used to spawn the inventory object) from the array.
    The problem is that the object I pick up and the object in the inventory do not share the same object ID. Every time I pick something up, the inventory gets a new object instance with a new ID.
    How can I delete the original source object (the one that was used to spawn the inventory object) from the array when I destroy the inventory object?

    RobinsonXR Offline
    RobinsonXR Offline
    RobinsonX
    wrote last edited by
    #29

    @MrAeon1111 said:

    How to delete a spawned object from the array?
    I pick up an object and that object appears in the inventory. I want to remove the object from the inventory and from the array at the same time. Destroying the inventory object itself is easy, but I don’t know how to remove the source object (the one that was used to spawn the inventory object) from the array.
    The problem is that the object I pick up and the object in the inventory do not share the same object ID. Every time I pick something up, the inventory gets a new object instance with a new ID.
    How can I delete the original source object (the one that was used to spawn the inventory object) from the array when I destroy the inventory object?

    For this one you want to store the source object ID in the spawned object using attributes. You can use Set Attribute to set a key with the object ID as the value. Then when destroying the object, you can use Get Attribute to retrieve it from the object.

    Here's an example:

    Original Object

    The original object spawns another object (the red one). In the spawned object, we can set an attribute source object id with the original object id.

    IMG_8532.jpeg

    Spawned Object

    The spawned object can retrieve the original object that spawned it and destroy it.

    IMG_8533.jpeg IMG_8534.jpeg

    1 Reply Last reply
    0
    • MrAeon1111M Offline
      MrAeon1111M Offline
      MrAeon1111
      wrote last edited by
      #30

      Thanks 😃

      1 Reply Last reply
      0
      • MrAeon1111M Offline
        MrAeon1111M Offline
        MrAeon1111
        wrote last edited by
        #31

        Yes but it is coming from a loop and a spawn the entire array. So what would you do?

        RobinsonXR 1 Reply Last reply
        0
        • MrAeon1111M Offline
          MrAeon1111M Offline
          MrAeon1111
          wrote last edited by
          #32

          A little option to destroy the source would be nice 😊

          1 Reply Last reply
          0
          • MrAeon1111M Offline
            MrAeon1111M Offline
            MrAeon1111
            wrote last edited by
            #33

            It’s weird because sometimes it delete the source even if the ID is not the same… For that I do a modify array by doing a get array value at index when the spawn object is touched. But it doesn’t work every time. I don’t understand why.

            RobinsonXR 1 Reply Last reply
            0
            • MrAeon1111M MrAeon1111

              Yes but it is coming from a loop and a spawn the entire array. So what would you do?

              RobinsonXR Offline
              RobinsonXR Offline
              RobinsonX
              wrote last edited by
              #34

              @MrAeon1111 said:

              Yes but it is coming from a loop and a spawn the entire array. So what would you do?

              I'm not sure what you mean by this. Can you send a screenshot/picture?

              1 Reply Last reply
              0
              • MrAeon1111M MrAeon1111

                It’s weird because sometimes it delete the source even if the ID is not the same… For that I do a modify array by doing a get array value at index when the spawn object is touched. But it doesn’t work every time. I don’t understand why.

                RobinsonXR Offline
                RobinsonXR Offline
                RobinsonX
                wrote last edited by
                #35

                @MrAeon1111 said:

                It’s weird because sometimes it delete the source even if the ID is not the same… For that I do a modify array by doing a get array value at index when the spawn object is touched. But it doesn’t work every time. I don’t understand why.

                It is worth noting that Get Array Value takes a number for the index. If you put text for the input, it treats it as 0 (getting the first element instead).

                1 Reply Last reply
                0
                • MrAeon1111M Offline
                  MrAeon1111M Offline
                  MrAeon1111
                  wrote last edited by
                  #36

                  IMG_2845.jpeg

                  1 Reply Last reply
                  0
                  • MrAeon1111M Offline
                    MrAeon1111M Offline
                    MrAeon1111
                    wrote last edited by
                    #37

                    How to manage the attribute keys with multiple objects.
                    Unlike in your example I have many object spawn at the same time. What do I put instead of “source object id”? Does it have to be dynamic?

                    RobinsonXR 1 Reply Last reply
                    0
                    • MrAeon1111M MrAeon1111

                      How to manage the attribute keys with multiple objects.
                      Unlike in your example I have many object spawn at the same time. What do I put instead of “source object id”? Does it have to be dynamic?

                      RobinsonXR Offline
                      RobinsonXR Offline
                      RobinsonX
                      wrote last edited by
                      #38

                      @MrAeon1111 said:

                      How to manage the attribute keys with multiple objects.
                      Unlike in your example I have many object spawn at the same time. What do I put instead of “source object id”? Does it have to be dynamic?

                      It looks like you're spawning multiple objects per iteration - maybe you meant to spawn one object per iteration?

                      To answer your question, "source object id" is just an arbitrary key I used. You can name your key anything that makes sense to you. It can either be dynamic or predefined - there's no difference functionality-wise.

                      1 Reply Last reply
                      0
                      • MrAeon1111M Offline
                        MrAeon1111M Offline
                        MrAeon1111
                        wrote last edited by
                        #39

                        No, I meant to spawn the entire array.
                        But I made a new system.

                        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