How do I add sprites to arrays?

Get help using Construct 2

Post » Sat Jul 12, 2014 9:11 pm

Okay, so I'm a little bit confused on this. I'm trying to set up a function where I search for each instance from an object and add that object to an array.... but how do I add the object itself? Each time I try to do so, it seems like I can only add variables from that object to the array array.
B
5
Posts: 7
Reputation: 237

Post » Sat Jul 12, 2014 9:21 pm

You can't add objects. You could add the UID, and "pick by UID" later when needed.
ImageImageImage
B
71
S
21
G
229
Posts: 3,686
Reputation: 128,336

Post » Sat Jul 12, 2014 9:26 pm

You cannot store objects in array. Arrays in C2 can only store numbers or strings.

If i understand correctly, you will want to store object UIDs and use that as a reference to an object.

Also, i suspect (but am probably totally wrong) that you can avoid storing UIDs in arrays and with events (more exactly conditions) pick a group of objects, and then apply some actions to them.

I recommend reading how events work if you haven't read it, and of course look into Families and Containers for more advanced object picking.

Hopefully i didn't miss your question.

Also, i recommend getting used to manual, i do it almost daily. :)
Be nice until it's time to not be nice
B
36
S
10
G
9
Posts: 293
Reputation: 6,712


Return to How do I....?

Who is online

Users browsing this forum: NaSTy, rayolf and 15 guests