Does C2 remember instances in sub-events?

Get help using Construct 2

Post » Mon Nov 28, 2011 11:22 pm

For example, in something like this:

Enemy var = 1
---- Enemy X > 500
---- >> Do this

---- Enemy X < 500
---- >> Do that


... will it remember the instances of Enemy it picked in that first event? In my project, I'm beginning to suspect it doesn't. If someone could clear that up I'll know if I'm looking in the wrong place to fix this issue or not.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Tue Nov 29, 2011 9:36 am

try
foreach Enemy
Enemy var = 1
--- etc
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Nov 29, 2011 2:34 pm

Yes, this is an important part of how sub-events work. From your example:

Enemy var = 1 - all enemies with var = 1 are picked
---- Enemy X > 500 - of these it's further filtered down
---- >> Do this

For the next subevent it returns to all enemies with var = 1 picked
---- Enemy X < 500 - of these it's further filtered down again
---- >> Do thatAshley2011-11-29 14:34:23
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Tue Nov 29, 2011 5:17 pm

I'll see how the For Each Enemy thing works out, but in my project... well, it doesn't seem to be working out. It has a lot of subevents in this one section, but it didn't seem to be remembering the instances it picked in the first event. If I added in the same condition from the first event ("Enemy var = 1") into each subevent, it started working correctly, with no other changes.

I'd rather not post the capx since this is one I might finish and actually do something with. Again, I'll try the For Each Enemy and report back later. Thanks for the responses.SullyTheStrange2011-11-29 17:18:05
B
20
S
9
G
6
Posts: 607
Reputation: 6,112


Return to How do I....?

Who is online

Users browsing this forum: agittm and 17 guests