Pick ID und destroy after spawn

Get help using Construct 2

Post » Mon Feb 16, 2015 12:08 pm

Hi

Simply cant figure out what I am doing wrong here

After af spawns of a family with 4 diff sprites ( Slice1,Slice2,Slice3,Slice4)
I pick the ID for Slice1

This works fine since I can set its opacity and spawn the Blocker
BUT when I want to destroy it goes wrong

Any Idears :-)

C2_pick-instance2.jpg
You do not have the required permissions to view the files attached to this post.
B
31
S
17
G
11
Posts: 348
Reputation: 8,636

Post » Mon Feb 16, 2015 12:13 pm

From the manual..

Index IDs (IIDs)

All objects at runtime have an index ID assigned, which is the number of the instance within its own object type. It is returned by the object's IID expression. For example, the first instance in two object types both have the IID 0, the second 1, and so on. Therefore the IID neither identifies a unique instance like the UID, nor does it persistently refer to the same instance (if IID 0 is destroyed, the next instance becomes IID 0). However, it can be useful for advanced users taking advantage of object expression indexing and the Pick Nth instance system condition.

Maybe try using instance variables instead..
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Mon Feb 16, 2015 12:51 pm

Thanks
... well getting a bit advanced for me

How else could I pick 2 > Slice1 > spawn the blocker and destroy the 2 Slice1
B
31
S
17
G
11
Posts: 348
Reputation: 8,636

Post » Mon Feb 16, 2015 2:04 pm

The problem is that you're doing that every tick. On tick 1 it destroys two sprites. On tick 2 it destroys two more... etc. You need to add a condition to make that event only run one time.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,620

Post » Mon Feb 16, 2015 2:14 pm

Understanding picking with respect to Families
Tutorial written by cacotigon
Originally published on 10th, May 2013
https://www.scirra.com/tutorials/556/un ... o-families
B
243
S
37
G
15
Posts: 1,933
Reputation: 39,969


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests