How do I do this with a CSV table

Get help using Construct 2

Post » Mon Jun 27, 2016 4:54 pm

shameless bump
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Tue Jun 28, 2016 9:25 pm

bump
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Thu Jun 30, 2016 5:58 pm

What kind of data are you modeling? Is it 1 or 2-dimensional?
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
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Thu Jun 30, 2016 6:30 pm

@gumshoe2029, 2 dimensional
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Fri Jul 01, 2016 3:07 pm

I've never used the plugin from rex that you are using. What exactly are you trying to do with it? Just access the data?
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
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Fri Jul 01, 2016 10:15 pm

I access the data and read it, now I would like to understand how can I connect it with expressions. Its still quite confusing to me even if I took the time to check exemples and read tutorials
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Mon Jul 04, 2016 4:18 pm

Well, I'll give you an example of how it works using rex's Hash plugin, since that is what we use to parse JSON.

Suppose we have the JSON object:

{"group1":{"object1":122,"object2":42,"object3":[98,47,12,9]},"group2":{"object4":[238,987,823,487],"object5":"this is a string","object6":true}}

Then you import it into the hash object (which would be similar to loading it for a CSV object), and this parses the JSON into a JavaScript object. From there you call specific methods to access the data via a schema, like:

Hash.At("group1.object3.3")

This call would return: 9 (the indexes for arrays start at 0)

also, you can call:

Hash.At("group2.object5")

which will return: this is a string

You can also call bulk objects like:

Hash.At("group1")

which will return: {"object1":122,"object2":42,"object3":[98,47,12,9]}

If I had to guess at how the API for the CSV plugin is configured, you would have a row number and a column number for identifying specific data points, like:

2,45,34,66,32
98,45,32,75,23
4,5,23,556,323

So you would have like:

CSV.At(2,4) which would return 323 (assuming all indices start at 0)
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
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Mon Jul 04, 2016 10:25 pm

Now I understand. Thanks for making it very clear. I didn't know the indexes start at zero so I had a great confusion about how it works.
Thanks again!
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Tue Jul 05, 2016 7:44 pm

FraktalZero wrote:Now I understand. Thanks for making it very clear. I didn't know the indexes start at zero so I had a great confusion about how it works.
Thanks again!


Yea, that is a computer science thing. We (almost) always start at 0. Don't ask me why...
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
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Tue Jul 05, 2016 11:00 pm

Well, thanks again, I learned something new and now is definitely clearer to me how it works.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Previous

Return to How do I....?

Who is online

Users browsing this forum: RetrocadeMedia, sebrosen, Yahoo [Bot] and 31 guests