Applying Damage

I have this set of code. The important thing is that I’m trying to modify how much damage a model can take. For example if they have the weakness condition, then they should deal half the damage on that attack.

What happens is it deals the Damage Dealt but doesn’t take into account the rest. Right now “20” is a placeholder amount just so I know exactly where the numbers are. But when a character is “weak”, then dungeon_guard1.Strength == 0.5. I’ve confirmed in the debugger that the variable is 0.5 but the output isn’t 20 * 0.5 but just 20.

What am I missing? Thanks in advance!

The conditions in your screen shot. There’s no knowing which dungeon_guard1 being referenced.

There is only one dungeon_guard1 in the game. The object does receive damage. The debugger tells me that the objects strength is 0,5 and that it has the condition (using a Boolean ). Everything seems to work except for the fact that it doesn’t seem to actually half the damage

What are the conditions for this event? Can you include them in a screen shot?

Screenshot 2026-05-27 at 8.28.24 AM

So this is the triggering boolean. And when I check the debugger, dungeon_guard1.Strength is listed as 0.5 before they make the attack.

I’ve also noticed that the Armor feature in the Health behavior doesn’t seem to reduce the damage as well if that is related. I have a similar condition that sets the armor percent damage reduction to 0.5 to, I assume, reduce the incoming damage in half but that ALSO doesn’t seem to factor into it. Not sure if that is another hint.

In the last screenshot, you’re setting the armor effectiveness to 0.5, which is part of the “Apply damage” extension. I’ve never actually used this extension but I would assume that the percent reduction is only applied if the player has more than 0 armor points?

But anyway, that doesn’t matter because in the action where you apply damage, you’ve set the “can be reduced by Armor” option to NO.

None of this has anything to do with the object.Strength variable which is something you created. You haven’t shown us any events that change this variable… you’ve said that it shows 0.5 in the debugger, but there must be something wrong if the value is still ending up as 20.

Screenshot 2026-05-27 at 9.18.49 AM

My brain got ahead of myself. I meant to attach this screen shot for the Weakness. This turns the Strength to 0.5.

It’s very likely that the reduction only applies to armor. That was going to be my next step of troubleshooting that. I just wasn’t sure if it was connected.

hello! is this topic solved?

because there is no real reason to use an extension. Damage reduction (armor) can simply be an object variable.

if you are using this extension to make it faster to write (aka. not needing to put two or three conditions everytime). Then the better way to do it is to treat all damages in your game inside a group event. or… if you really need to put the damage logic in a lot of places in your code, then you can simply use external events. External Events - GDevelop documentation

It actually is solved! After numerous relooks at the code, what was causing it was that a line of code that resets the strength was one level higher than I thought it was and when I subevented it properly, it no longer caused the issue. Essentially the variable would change and in the same frame, reset back to normal.