How do I make the enemies take damage?

Get help using Construct 2

Post » Wed Dec 21, 2016 4:25 pm

http://imgur.com/a/6eTwZ

So basically my game has been working fine in this aspect, when all of a sudden I noticed something stupid start happening. As you can see from the image that's
how damage works. Enemies get hit by the player's bullet, they take damage and display it etc.

But FOR SOME REASON when I start a instance of the game I can kill enemies, but then randomly after let's say "20 kills" (it's random when it kicks out) I don't deal damage anymore. It displays stuff like "-10" or "-13" over their heads but enemies I know only have 30HP are taking like 20 shots and still not dying... I haven't tampered with these events/actions since I made it because it worked fine. I have not referenced anything to do with these variables out side here other than creation of the bullet and that was made before this event. Now i'm starting to think my version of Construct 2 is bugged because this isn't the only unexplained problem i'm having without tampering with what was previously working fine.

Thanks, Conra
B
6
Posts: 26
Reputation: 306

Post » Wed Dec 21, 2016 5:00 pm

Well the important event is missing from the screenshot, what's the enemy death logic? My guess is you could have enemy health = 0 then destroy instead of less than 0 or some other reason in that area. Looks like it skips the death and carries on taking damage into the negative health.
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Wed Dec 21, 2016 5:06 pm

Like Plinkie said, something is up with what happens at death. My guess would be that you have something like If Damage = 0 Then Die. What you really want If Damage is = or less than 0 Than Die.

Edit: Never mind, Plinkie said the exact same thing. I need to get better glasses.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Wed Dec 21, 2016 8:08 pm

I have <0 as my death event, I checked the de-bugger mode and enemies were stacking up to -2000 damage, but after playing around with stuff it's not happening anymore. I don't know what caused it to stop but it's sorted now
B
6
Posts: 26
Reputation: 306


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests