Place 100+ Sprites with plugin?

Get help using Construct 2

Post » Tue May 22, 2012 5:40 pm

I would like to place 100+ sprites at certain locations with a comma delimited text string. It will be the same sprite and not different sprites.

The format would be: x1,y1,x2,y2,x3,y3,x4,y4,...

Does this already exist? If it doesn't, would it be a behavior or plugin?
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Tue May 22, 2012 5:41 pm

I'd say it would be a "Create object" loop getting coordinates out of an array.Kyatric2012-05-22 17:41:52
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Tue May 22, 2012 5:42 pm

I thought of that to, but how do i fill the array?
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Tue May 22, 2012 5:42 pm

CSV plugin plus some events
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Tue May 22, 2012 5:43 pm

You could use the while loop and spawn sprites until you run out of tokens in the string. See tokenat and tokencount system expressions.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue May 22, 2012 5:45 pm

Thank you for the VERY quick replies. I think you all pointed me in the right direction.
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Tue May 22, 2012 7:12 pm

@rexrainbow

Well after playing around for about a hour i still don't know how to use the CSV plugin. I created a CSV file with Excel and then copied the contents to "load table" forom the CSV plugin. I then tried to access the table by using CSV.At(0,0) which did not work. I then tried CSV.At(str(0),str(0)) which only returned 0 and not the value of 50 that was loaded there. I just don't understand, is there example CAPX to look at. I already looked at the text_csv capx examples which don't show what i'm looking for.rfisher2012-05-22 19:13:18
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Tue May 22, 2012 7:46 pm

I have it working now, I was not using Col and Row Headers which is how you index to a value.
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Fri May 25, 2012 3:28 am

Shouldn't this thread be in the "How do I" session?
B
50
S
16
G
7
Posts: 59
Reputation: 6,365


Return to How do I....?

Who is online

Users browsing this forum: Magistross, mallorcaredes, PavleNikolic, zatyka and 28 guests