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

    Feature Request: Import plists, and associate with...

    Scheduled Pinned Locked Moved
    Comments & Feedback
    4
    14
    337
    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.
    • D
      Deeeds @Jack8680
      last edited by

      @Jack8680 plists are a feature of Xcode that's actually quite good. I say that with amazement in my voice. Much of Xcode is competing with Eclipse for worst IDE on earth.

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

        @Jack8680 what is JSON capable of being and doing within hyperPad?

        Jack8680J 1 Reply Last reply Reply Quote 0
        • Jack8680J
          Jack8680 @Deeeds
          last edited by

          @Deeeds well according to what I looked up plist is like this:

          <dict>
              <key>Author</key>
              <string>William Shakespeare</string>
              <key>Lines</key>
              <array>
                  <string>It is a tale told by an idiot,</string>
                  <string>Full of sound and fury, signifying nothing.</string>
              </array>
              <key>Birthdate</key>
              <integer>1564</integer>
          </dict>
          

          While json is like this:

          {
             "Author":"William Shakespeare",
             "Lines":[
                "It is a tale told by an idiot,",
                "Full of sound and fury, signifying nothing."
             ],
             "Birthdate":1564
          }
          

          Which can still be read when compressed to one line:
          {"Author":"William Shakespeare","Lines":["It is a tale told by an idiot,","Full of sound and fury, signifying nothing."],"Birthdate":1564}

          In json {"key":"value"} is a dictionary and ["value"] is an array. In xml
          <dict><key>key</key><string>value</string></dict>
          is a dictionary.

          Json looks much nicer to me.

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

            @Jack8680 My apologies, I should NEVER have mentioned XML.

            plists are not XML, they're similar... in that they can be made and read in the same manner an XML file can be...

            EDIT: ADDTION...

            BUT XML IS NEVER HOW YOU WOULD USE A plist.

            I can't say that bit strongly enough!!!

            But, not the point I'm making, nor what I'm asking.

            What is a JSON file capable of being and doing within hyperPad?

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

              @Jack8680 Let me try asking this question a little better... with some context.

              I had (perhaps wrongly) presumed that JSON was only part of hyperPad for the networking of some kind of game idea that someone once had... and that's about its usage within hyperPad... some kind of networking for something that's never been explained. Nor has it seemingly been expressed as to why it exists within hyperPad.

              I MIGHT HAVE OVERLOOKED SOMETHING HERE. I am making this presumption from the complete mess that is the Custom Behaviours section of hyperPad. It looks like a "oh... we should add this... " pile.

              So maybe JSON does more and is more within hyperPad. Is it?

              Jack8680J 1 Reply Last reply Reply Quote 0
              • Jack8680J
                Jack8680 @Deeeds
                last edited by

                @Deeeds a lot of languages use json arrays (Python, JavaScript, C#, PHP, etc.).

                The advantage of using them is that you can convert arrays and dictionaries to and from plain text, so you can save them, send them through http requests, etc.

                Your example of importing the entire text of a massive textual game is another thing you can do with json. I've made spreadsheets in excel, exported as csv, then converted to json and used them.

                Also, json is a pretty universal format so you can send an array from hyperPad to a server, etc.

                For example, I have a high score list stored in a database that is retrieved by php and converted to json arrays, then sent to hyperPad and read and displayed.

                I still don't see what's special about a plist file, it just looks like a more verbose form of json.

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

                  @Jack8680 Sorry. Still not being clear enough. All that stuff about JSON... yes, yesI know that... that's the point of JSON, to provide JavaScript what it otherwise lacked, etc...

                  My questions are these:

                  Can JSON files be imported into hyperPad?

                  Can they be associated with (and provide information to) SpriteSheets?

                  Can JSON files be used to populate hyperPad Arrays and Dictionaries?

                  // plists won't seem special until you use them in their intended environment, which is Xcode. At which point they become an amazingly useful organiser mechanism for all sorts of things.

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

                    You can enter json manually into a value behaviour and use the Get Array Value or Get Dictionary Value to parse the json. Or use Modify Array / Dictionary behaviours to manipulate that json.

                    The only way to import json into hyperpad is to download json with the networking behaviours. So in your example, you'd have to download your levels.

                    Plists aren't supported unfortunately.

                    edit They might be actually! I haven't tried it, but if you download a Plist / XML file, i think it might convert to JSON but I'm not too sure. I would stick to JSON to be safe.

                    edit 2
                    I didn't see the spritesheet question. No, we only support sprite sheets that were provided by cocos2d.

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

                      @Hamed On the cocos2D sprite sheet issue... that's what I'm trying to find a "work around" for.

                      cocos2D sprite sheets are the sprite sheet, and the plist describing them. Since the current problem is importing from dropbox not working (for sprite sheets) i'm trying to find a way to import the plist and associate it with the sprite sheet graphics... so you don't have to fully rewrite the importer/dropbox integration.

                      iOS 11's file handling easier, maybe... etc.

                      1 Reply Last reply Reply Quote 0
                      • T
                        Thecheater887 @Hamed
                        last edited by

                        @Hamed that sounds awfully unsafe. Do you at least have safeguards in place for this kind of thing?

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

                          Its just transforming a text file, can't really do harm with it. It displays an error if it can't read it.

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

                            @Hamed SPRITESHEETS!

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