How do I take variable from certain uid?

Get help using Construct 2

Post » Tue May 06, 2014 1:12 pm

I have array who store object's UID's in cells. And i want make somethink like:
int a = array [uid].variable

How I can make that?
B
10
S
1
Posts: 22
Reputation: 587

Post » Tue May 06, 2014 1:51 pm

n06rin wrote:I have array who store object's UID's in cells. And i want make somethink like:
int a = array [uid].variable

How I can make that?


I think the easiest way it to use(I use on start of layout and sprite as an exemple):

Conditions;
On start of layout; Sprite:Pick by unique ID: Array.At(x)

Actions;
Set global variable A to Sprite.variable


The pick by uid will take the variable of that particular instance
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Tue May 06, 2014 3:05 pm

Thanks. It might work. But i changed it, and now I am not need that array.
But will use it later :-)
B
10
S
1
Posts: 22
Reputation: 587


Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, SashikLV, unxcellent and 7 guests