How do I fix a stacking error?

Get help using Construct 2

Post » Sun Dec 07, 2014 5:55 am

Hey everyone!

I keep getting a stacking error message when one of my monsters dies.

What should happen is when my bullets (Medium or Large Shot) collide with the BeadSnake mob, it plays its death animation, and gets destroyed when that animation finishes.

For some reason whenever it destroys, I get an error message that I'm not knowledgeable enough to fix. I tried rearranging my events and actions three times, and I'm having trouble figuring out what's going wrong.

Here's a screenshot of my events, and the error message I get when the BeadSnake gets destroyed:

Image

Can someone explain to me what I'm doing wrong here and how to prevent this in the future?

Thank you!!

-Scott
B
9
S
2
Posts: 37
Reputation: 739

Post » Sun Dec 07, 2014 7:13 am

It says in the error message - you have triggers(collisions, on animation finished) as subevents to a loop(for each BeadSnake), which isn't allowed. The green arrow to the left of a condition indicates that the condition is a trigger -- something that's true for one frame when a state is attained and is then false until the state is reversed and once again attained, more or less. Construct 2 treats triggers differently from regular conditions.

Your use of explicit for each loops here is unnecessary, as all of these conditions will implicitly run against all instances of BeadSnake/bead. Getting rid of them -- although the first one would be the only one causing the error -- should get rid of your problem and still result in everything working the way you'd expect.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,106

Post » Sun Dec 07, 2014 5:17 pm

Ah! Thank you!

I never realized that the arrows indicated triggers. I'm learning how to use construct through experimentation and google-fu, so I really appreciate you spelling it out for me like that. Makes it easy to understand.

Thanks!!
B
9
S
2
Posts: 37
Reputation: 739


Return to How do I....?

Who is online

Users browsing this forum: jaytrott86 and 8 guests