[solved] How do I search within Json / Array?

Get help using Construct 2

Post » Sun Jan 11, 2015 2:07 pm

I have a problem to search within a .json file.

I load a json file into in an Array and insert one data in a global variable. That was the easy part.
When I search for the Position in the Array, the result with the global variable is wrong, without the variable it is correct.

Where is the error? I add a samle to see my problem. :(
You do not have the required permissions to view the files attached to this post.
Last edited by edwardr on Thu Jan 22, 2015 10:09 pm, edited 1 time in total.
B
15
S
4
Posts: 77
Reputation: 1,030

Post » Sun Jan 11, 2015 11:20 pm

Perhaps it can be easier to manipulate json with this plugin
plugin-json-import-export-generate-edit-inspect_t100042
http://armaldio.xyz - Image - Join now our Discord Server ;) - https://discord.gg/0eLPLj96B4tUr1D3
B
56
S
16
G
1
Posts: 249
Reputation: 5,721

Post » Mon Jan 12, 2015 11:29 am

Thx, I'll check it.

But I'm not manipulating the json file. I'm just searching for in the file for e.g. a number. Maybe it's easier to rethink and use you plugin
B
15
S
4
Posts: 77
Reputation: 1,030

Post » Mon Jan 12, 2015 9:14 pm

Tell me if you need some help :)
http://armaldio.xyz - Image - Join now our Discord Server ;) - https://discord.gg/0eLPLj96B4tUr1D3
B
56
S
16
G
1
Posts: 249
Reputation: 5,721

Post » Mon Jan 19, 2015 10:10 pm

ok, I have headache with comparing jsons data (or Construct2 has headache with me) and I need a little bit help.
(PS; the plugin works fine)

I have two json.
1.) has information about a building (e.g. production time, price, Image, description, ... and an ID)
2.) has information about the user (only the ID)

The idea is: a small user json get all data from several json with all information and then show the right text from the "detailed" json.

All my tries didn't worked. Has anybody tried this before or has any idea?
THX
B
15
S
4
Posts: 77
Reputation: 1,030

Post » Thu Jan 22, 2015 10:08 pm

ok, I solved it. Nothing what a glass whisky can solve :)
Actually it is easy, but it needs a little bit "organization" on database structure.

Two databases need the same column (e.g. "ID")
1. Database with all the details (let's say: "Detail")
2. Database with the user-information (let's say: "Overview")
You do not have the required permissions to view the files attached to this post.
B
15
S
4
Posts: 77
Reputation: 1,030


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests