Expression of nth picked instance

Get help using Construct 2

Post » Sun Dec 28, 2014 7:19 pm

There is a condition called pick nth instance but it only can pick one instance at a time. I want to retrieve the expression of multiple particular instances to compare with in 1 condition like the compare 2 values condition. For example, sprite(0).X and sprite(1).X will do the job if im selecting all instances. But now since some of the my instances has been filtered out by events and not all of them are selected, entering sprite(0).X is not desirable because it is picking the instance with IID 0 instead of the instance after filtering. How do I retrieve it?( I want to know the format when typing expression,not a workaround)
B
17
S
4
G
1
Posts: 203
Reputation: 1,583

Post » Sun Dec 28, 2014 7:32 pm

From just expressions you can't do that. You have to use conditions to pick particular instances.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Sun Dec 28, 2014 8:25 pm

You can use Function param to set UID or IID on function execution to pick specificed instance.
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,371

Post » Sun Dec 28, 2014 11:12 pm

To obtain the value for the Function parameter, I have to use the Pick Nth Instance condition, create variable to remember them and set the variable to the Function parameter. If I have a large number of instances to pick, i will need an equal number of variables to store them,which will be troublesome.

However, it is very nice that if there is a new expression which is associated with the nth picked instance in addition to IID.
B
17
S
4
G
1
Posts: 203
Reputation: 1,583


Return to How do I....?

Who is online

Users browsing this forum: mindragon73, nahima and 25 guests

cron