How do I Avoid Counting Destroyed Instances?

Get help using Construct 2

Post » Sun Jul 27, 2014 8:37 am

If possible, I would like to confirm that something I am observing is intentional, unintentional, or an error in my events.

Ok, so my layout has 4 instances of an object.

I have a function named "deleteobject".

- in a subevent's condition I pick one of these four instances (arbitrarily) by UID.

- then use the normal "destroy" action in that same event for that object.

- immediately following that action, in the same event, I set a global variable to object.count

I call the function and destroy the object, then set the global variable to object.count, so object.count should return a value of 3 not 4 correct?
B
17
S
2
Posts: 66
Reputation: 1,382

Post » Sun Jul 27, 2014 9:58 am

How are you checking the value of object.count? If you are using a visual notification, are you updating it?
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Sun Jul 27, 2014 10:52 am

There probably hasn't been time for the object to get destroyed. For a test, try a short System:Wait or put the variable update in a Function or different event.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Jul 27, 2014 10:57 am

The destroy action hasn't been completed if the event hasn't..
Not untill the next top-event will there be less objects to count..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 27, 2014 5:46 pm

Ah, it does work as you say. Thanks for confirming the intended behavior. Knowing this, I can rework my event structure appropriately.
B
17
S
2
Posts: 66
Reputation: 1,382


Return to How do I....?

Who is online

Users browsing this forum: wizdigitech, Zamargo and 14 guests