CSV

Get help using Construct 2

Post » Mon Feb 10, 2014 9:26 pm

Hi nice people of C2! Need a little help, please.

I'm using a CSV table like this:
        JPG,             TXT            ,KIND,     
cat,       cat.jpg,      cat.txt,          cute,
puppy, puppy.jpg,      puppy.txt,     cute,
shark,   shark.jpg,      shark.txt,       nasty

With this I can nicely generate a list with a text box and picture for each animal, using for each row. But what condition and how should I use it to generate a list with only the cute animals. Thank you!
B
6
Posts: 10
Reputation: 295

Post » Mon Feb 10, 2014 9:34 pm

Had a similar question a while back. Give this post a read and see if it helps.

http://www.scirra.com/forum/arrays-problems-getting-value-with-randomization_topic84647.html?KW=ArcadEd2014-02-10 21:34:59
B
101
S
32
G
12
Posts: 1,549
Reputation: 21,993

Post » Mon Feb 10, 2014 10:33 pm

@ArcadEd.
Thanks. Yes, it seems to do the right thing but, still, don't really get it. What does "populate" actually do in your example. And where does it pick up the "1" value parse the array with ? Sorry I'm fuzzy with arrays. This is why I prefer CSV tables which I can also edit easily.
I guess i don't know where can edit the "function". Can you elaborate please?
B
6
Posts: 10
Reputation: 295

Post » Mon Feb 10, 2014 10:59 pm

Yeah, sorry.

What you basically want to do is create an array with your CSV file. There is an expression called TokenAt that will parse the CSV and put each item in an array block.

I think the first step would be to really understand arrays as that is going to be your best bet for storing and sorting the information.
B
101
S
32
G
12
Posts: 1,549
Reputation: 21,993


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests