[Plugin] Hash table

Post your completed addons to share with the community

Post » Fri Sep 27, 2013 10:41 am

Forget my post before changed it for my own so the plugins supports for me now:

-> for each Object in object
-> getCurValue also can give you an Object back
-> with hash.loopindex you get the current loop
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Wed Oct 16, 2013 2:58 pm

Hi,

I sent you a private message regarding this.. but this would be better to answer this here since it could help someone else with the same kind of problem.

How much flexible is your plugin (in term of accessing multi-level JSON and arrays)? I am exchanging data between a WebSocket server in this format..

OpCode-Token { ... }

The end is obviously JSON data. So would it be better to fully handle nested-levels JSON with your plugin (if its flexible enough).. or use your plugin to only parse the first level and prepare the c2array or c2dictionnary JSON directly on the server-side so i end up with..

1-1234 {"valueA":123, "data":{"c2array":true, "size":[3,1,1], "data":[[[0]],[[1]],[[2]]]}}

so all i could do in this case is getting data with your plugin and load it to the array. But at the expanse of bandwidth!

Thanks!
B
11
S
4
G
1
Posts: 189
Reputation: 2,262

Post » Sat Nov 16, 2013 12:06 pm

EDIT:IGNORE THIS

Hi Rex,

I prefer Hashtable format because its doesn't prepend "c2Dictionary" to the JSONs unlike dictionary. I can map hashtable directly onto JS object representation for Firebase JSON store. Its very nice.

However, it doesn't seem to support containers, which is necessary to support lists of players (each with their own hashtable).

Any motivation to support this C2 feature? Or shall I get hacking?

Tom

EDIT: weird, it seems to be working now without me changing anything... I am confused.com
tlarkworthy2013-11-16 12:47:40
B
14
S
5
G
1
Posts: 60
Reputation: 1,052

Post » Mon Mar 17, 2014 11:00 pm

rexrainbow wrote:Update:

Add "action:pick keys", to pick keys into an array object. See sample capx.
This action will set array size to (0,1,1), then push keys into array. Using "array condition: for each element X" to pick them.



Hey rex,

I cannot seem to get your example capx for pickkeys to work properly. Do you know if something changed in Construct that would undo your plugin's pickkeys method?

Thanks,
gumshoe
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
18
S
5
G
1
Posts: 1,137
Reputation: 4,052

Post » Mon Mar 17, 2014 11:30 pm

@gumshoe2029

Uh, it's a bug, I had fix it. Try to download plugin again.

capx
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Tue Mar 18, 2014 4:08 am

rexrainbow wrote:@gumshoe2029

Uh, it's a bug, I had fix it. Try to download plugin again.

capx


Beautiful, it works flawlessly now, thanks!
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
18
S
5
G
1
Posts: 1,137
Reputation: 4,052

Post » Wed Apr 09, 2014 5:24 am

Hey Rex,

just a simple question:

I have very complex JSON structures and wanted to loop my results in a foreach. But then I saw, that you restricted "For Each"-Condition to strings and numbers. (In my case it was just a multidimensional json structure, so ForEach had to handle an object). I removed the line where you checked the type and everythings working very smoothly (for almost a year now).

Just wanted to know your opionion why you restricted for each loops :) Thanks.

P.S.: I love this plugin!! I couldn't imagine working without it!
B
13
S
3
G
1
Posts: 255
Reputation: 1,997

Post » Thu Apr 10, 2014 10:48 am

@Vuuv

It's because that I will pick the value for expression.

There is another plugin for json structure made by Yann. You could try it.
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Sun Jun 08, 2014 2:18 am

Message: ConroFontano is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
So, I am having an issue with a click event in a project I am working on. When a user clicks an object, with a unique set of properties, they are supposed to be sent to another layout and the client makes a call to the server. Then, depending on what object was clicked, a hash table is loaded from the JSON string and that object's respective properties are placed into variables and put inside the Hash, where they are then placed into an array object using "pick keys "" into (nondescript array goes here)". But I'm having a problem getting it to work correctly. While the layout that is supposed to open does so, and error is thrown. This is the error message:

Javascript error!
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data, line 234 (col undefined)

I'm not exactly sure what is wrong and would appreciate some input.
Thanks!
B
1
Posts: 2
Reputation: 129

Post » Sun Jun 08, 2014 2:20 am

And I just realized that I'm not permitted to post URLS because I don't have enough rep, so you can't see the URL that was in the error message. Great. Haha.
B
1
Posts: 2
Reputation: 129

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests