Jump to content


Brabox

Member Since 21 May 2008
Offline Last Active May 16 2018 07:06 PM

Topics I've Started

Health-based buffs

10 February 2017 - 09:50 PM

Hello everyone!

I want to replace certain armor-based AttributeModifiers with health-based ones (specifically, HEALTH_MULT). Note: health_mult increases both active health and max health. It's very similar to armor bonuses in how it works.

 

For stances and formations, it works perfectly.

So, I change:

ModifierList FighterHordeStanceHoldGround
   Modifier = ARMOR 25%
   Modifier = DAMAGE_MULT 85%
   Modifier = VISION -90%
End

To:

ModifierList FighterHordeStanceHoldGround
   Modifier = HEALTH_MULT 133%
   Modifier = DAMAGE_MULT 85%
   Modifier = VISION -90%
End

OK, so far so good. I can toggle between difference stances/formations and the unit's health increases and decreases correctly.

 

However, if I do the same to buffs/leaderships such as Rallying Call, despite the health value being correctly adjusted upward, it doesn't reset after the buff wears off.

E.g. if my units move in and out the range of a Hero (or other leadership source) their health keeps increasing and increasing. Similarly, if I cast rallying call, wait till it wears off and cast it again, the target units' health will increase twice.

 

Because of that, I know the AttributeModifier wears off correctly. You can't have the same modifier active twice on one unit (example: you have to make unique AttrModifiers for each level-up, otherwise they won't stack). So somehow the modifier wears off, but the health isn't updated. That means I need to force units to periodically recalculate their health based on their base health and all active modifiers.

 

Perhaps anybody has encountered something similar.

 

Also noteworthy: re-spawned units will have correct health values. So, a horde with abnormally high health values due to multiple rallying call usages will respawn new units with normal health. So I have a horde mixed with units with different max health vals.

 

 

For anyone curious as to why I'm doing this:

Applying multiple armor bonuses on top of each other (stacking) results in insane bonuses.

E.g. if you have 3 modifiers active on 1 unit: 33%, 33% and 50%, the game somehow ends up adding them all together, resulting in 83%. This is capped at 75%. Consequently, this is subtracted from 100, resulting in 25% damage taken. That's equivalent to 400% armor....

 

I made a video to illustrate this:


Damaging certain objects

22 January 2017 - 01:21 PM

Hi BFME2 & RotWK modders!

 

I'm from 2.02 and we're having certain problems. To keep it simple, let me detach my question from the actual purpose.

 

Does anyone know if it's possible to:

- Link two objects health-wise. That is, all damage taken by one object, is inflicted on the other?

- Let an object's health decay somehow. In other words, its health slowly decreases until it dies.

- Link two objects selection-wise. So: if I select one, I also select the other.

 

We'd already be grateful with a solution for 1 point, so don't hesitate to comment!

 

 

Regards,

Brabox and the rest of the 2.02 team.