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. JSON vs Behaviour Array "types"

JSON vs Behaviour Array "types"

Scheduled Pinned Locked Moved Help and Support
12 Posts 2 Posters 1.2k 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.
  • Jack de WildeJ Jack de Wilde

    @Deeeds by "the function" they do mean the modify array behaviour.

    Array behaviours let you make the array manually, whereas the json format is ["value1","value2","value3",etc.]. Allowing us to use json means it can be used on arrays saved with save values, or sent through broadcast message. The output of an array behaviour is in json.

    I never actually read the documentation and did not know it works on a dictionary, that's actually really useful for looping through if you wanted to reverse a dictionary, which is exactly what I wanted to do a while ago.

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

    @Jack8680 Sorry, this hasn't made it any clearer.

    Let's start with the basics.

    I can choose an Array of type "Behaviour". This is VERY strange use of language, to me.

    What does Behaviour mean in this context?

    And what is an "Array Behaviour"?

    Sorry, I come from other worlds where this lexicon doesn't parse so well.

    Jack de WildeJ 1 Reply Last reply
    0
    • D Deeeds

      @Jack8680 Sorry, this hasn't made it any clearer.

      Let's start with the basics.

      I can choose an Array of type "Behaviour". This is VERY strange use of language, to me.

      What does Behaviour mean in this context?

      And what is an "Array Behaviour"?

      Sorry, I come from other worlds where this lexicon doesn't parse so well.

      Jack de WildeJ Offline
      Jack de WildeJ Offline
      Jack de Wilde
      wrote on last edited by
      #4

      @Deeeds all the nodes are called behaviours. E.g. Add values behaviour, move to point behaviour, etc. The array behaviour is the behaviour under custom called Array.

      D 1 Reply Last reply
      0
      • Jack de WildeJ Jack de Wilde

        @Deeeds all the nodes are called behaviours. E.g. Add values behaviour, move to point behaviour, etc. The array behaviour is the behaviour under custom called Array.

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

        @Jack8680 Ok, so the word you're misusing might be "make", then... in this sentence:

        Array behaviours let you make the array manually,

        I think you might have meant "modify", "edit", "alter", "change" or something like that, right?

        Because I've looked for a way to make things with code in hyperPad, and only found Spawn. Or am I missing something amazing?

        Jack de WildeJ 1 Reply Last reply
        0
        • D Deeeds

          @Jack8680 Ok, so the word you're misusing might be "make", then... in this sentence:

          Array behaviours let you make the array manually,

          I think you might have meant "modify", "edit", "alter", "change" or something like that, right?

          Because I've looked for a way to make things with code in hyperPad, and only found Spawn. Or am I missing something amazing?

          Jack de WildeJ Offline
          Jack de WildeJ Offline
          Jack de Wilde
          wrote on last edited by
          #6

          @Deeeds yeah I meant you can use the 'array' behaviour to make a predefined array, rather than typing it out into something like a box container.

          D 1 Reply Last reply
          0
          • Jack de WildeJ Jack de Wilde

            @Deeeds yeah I meant you can use the 'array' behaviour to make a predefined array, rather than typing it out into something like a box container.

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

            @Jack8680 Argh, ok. So I'm seeing what's going on. It's not a type change, it's a mode of operation for the "Modify Array" Behaviour that's changed by selecting whether to use the behaviour in JSON editing mode or hyperPad Array editing mode. Frankly, given that ANYTHING can be dragged into the slot for the chosen array, I'd have thought the mode should change based on the content its given.

            But I'm talking in ideals. So ignore my opinions.

            Jack de WildeJ 1 Reply Last reply
            0
            • D Deeeds

              @Jack8680 Argh, ok. So I'm seeing what's going on. It's not a type change, it's a mode of operation for the "Modify Array" Behaviour that's changed by selecting whether to use the behaviour in JSON editing mode or hyperPad Array editing mode. Frankly, given that ANYTHING can be dragged into the slot for the chosen array, I'd have thought the mode should change based on the content its given.

              But I'm talking in ideals. So ignore my opinions.

              Jack de WildeJ Offline
              Jack de WildeJ Offline
              Jack de Wilde
              wrote on last edited by
              #8

              @Deeeds if you use modify array on an 'array' behaviour, it will update the array. For other values you have to set them to the output of 'modify array' to update them; for example, using 'modify array' on a box container doesn't change the box container, it just returns the modified array.

              What do you mean by change based on the content it's given? You either select a behaviour or use a json value. You can use the array behaviour as a json value, but it won't update it.

              There's a pointer switch, but I don't remember what it does since it doesn't seem to work on box containers and arrays update anyway.

              D 1 Reply Last reply
              0
              • Jack de WildeJ Jack de Wilde

                @Deeeds if you use modify array on an 'array' behaviour, it will update the array. For other values you have to set them to the output of 'modify array' to update them; for example, using 'modify array' on a box container doesn't change the box container, it just returns the modified array.

                What do you mean by change based on the content it's given? You either select a behaviour or use a json value. You can use the array behaviour as a json value, but it won't update it.

                There's a pointer switch, but I don't remember what it does since it doesn't seem to work on box containers and arrays update anyway.

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

                @Jack8680 What do you mean by operate a Modify Array Behaviour on a Box Container?

                I'm lost there.

                Jack de WildeJ 1 Reply Last reply
                0
                • D Deeeds

                  @Jack8680 What do you mean by operate a Modify Array Behaviour on a Box Container?

                  I'm lost there.

                  Jack de WildeJ Offline
                  Jack de WildeJ Offline
                  Jack de Wilde
                  wrote on last edited by
                  #10

                  @Deeeds you could for example put the following in a box container or an attribute:
                  ["value1","value2"]
                  And then 'modify array' can use this json string as its input array.

                  D 2 Replies Last reply
                  0
                  • Jack de WildeJ Jack de Wilde

                    @Deeeds you could for example put the following in a box container or an attribute:
                    ["value1","value2"]
                    And then 'modify array' can use this json string as its input array.

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

                    @Jack8680 argh, I see what's going on. There's been an attempt to create a visual means of doing network communication. Intriguing. I'll get to that, in time, no doubt. And then have much to say about it ;)

                    1 Reply Last reply
                    0
                    • Jack de WildeJ Jack de Wilde

                      @Deeeds you could for example put the following in a box container or an attribute:
                      ["value1","value2"]
                      And then 'modify array' can use this json string as its input array.

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

                      @Jack8680 I've just tested this, and it doesn't behave the way I'd expect.

                      Array Type = Value
                      Selected myArray (named LapTimes)
                      Modification is Append
                      Value to Append is a laptime

                      Do this, and there is never anything added to the array, despite everything else working correctly.

                      I would expect this adds a value to the array, and extends the length of the array in doing so.

                      Array Type is one that stores values, I've picked the right one, I've chosen to modify it by appending a value and selected a valid value

                      Now, here's the weird part... what does work as I'd expect the above to work is this:

                      Array Type = Behaviour
                      Selected myLapTimes Array
                      Modification is Append Value
                      Value is a lap time

                      Why?

                      WTF?

                      Am I completely misunderstanding what an array of type Values is?

                      Am I misunderstanding what "type" means in this context?


                      EDIT:

                      And what exactly is array of type JSON?

                      Why is this responding like a normal array of values if it's of type JSON?

                      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