How put a object, without expression after it, in variable ?

Get help using Construct 2

Post » Fri Jul 03, 2015 3:43 pm

Hello everyone,
During the last 2 weeks I search how put a object without expression after it, so just the object, in variable, dictionary or array ?

For example
variable "Firstobject" = SpritePlayer
after "Firstobject" = SpriteWall
and I can use the object after, "firstobject".X = 110

Please help me because my game is late. Thanks
B
4
Posts: 2
Reputation: 204

Post » Fri Jul 03, 2015 3:55 pm

It's not possible to store objects in the aforementioned data structures. You'll have to find some other way to do what you want.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116

Post » Fri Jul 03, 2015 3:56 pm

You add the IID (not UID) after it.

Firstobject(0).x

Edit: sorry i probably misunderstood your first post. I don't know if the above was what you wanted.
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Fri Jul 03, 2015 5:01 pm

[quote="Ethan"]You add the IID (not UID) after it.

Firstobject(0).x

Edit: sorry i probably misunderstood your first post. I don't know if the above was what you wanted.[/quote

i tried on my game, but I don't understand what is this 0 on Firstobject(0).x

Thanks and I have another solution, can I choose a object in family with his ID ? please
B
4
Posts: 2
Reputation: 204

Post » Sat Jul 04, 2015 2:33 pm

You can give each object an instance variable called 'name' with its name. Then you can add the name by 'object.name' to any variable, dictionary or array.
Image Image iTunes: Match3 | Google Play: Match3
B
100
S
35
G
30
Posts: 1,136
Reputation: 28,085


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests