Feature Request: Import plists, and associate with...
-
@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.
-
@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?
-
@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?
-
@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.
-
@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.
-
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. -
@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.
-
@Hamed that sounds awfully unsafe. Do you at least have safeguards in place for this kind of thing?
-
Its just transforming a text file, can't really do harm with it. It displays an error if it can't read it.
-
@Hamed SPRITESHEETS!