[engine] alternative tag for [defense]
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
[engine] alternative tag for [defense]
Not sure if this was already suggested.
Currently, with [defense] tag, you set units' defense at a certain terrain type. The issue is, the unit always get the best defensive value. First an introduction so you can understand my dilemma.
I'm having a little problem because I'm trying to make a faction with very good defense on frost land types, but this causes a problem to me. My original idea is, the faction lives at a frozen wasteland, mainly plains and some hills, so they're used at these terrains, receiving 70% defense at both.
But they are truly bad at sand and forests. The sand is easy to fix, I just need a 20% on sand terrain with defense tag - but the forest is a bit more complicated.
The original idea was giving a 30% in forests - but since the entire place is cold, ice + forests will give them the same 70% than flat frozen, and that causes a huge unbalancing.
My idea was another [defense] tag, something like [low_defense], working exactly the same as current defense tag, but making units get the worst defense value when different ones stack.
That would make my faction still get the 70% defense bonus at flat frozen terrain, but only 30% at forests, even if they're also frozen type.
Not sure if it's too hard to implement, but it would help sometimes. Even if you couldn't use both [defense] and [low_defense] at the same unit, being limited to choose one of them.
Currently, with [defense] tag, you set units' defense at a certain terrain type. The issue is, the unit always get the best defensive value. First an introduction so you can understand my dilemma.
I'm having a little problem because I'm trying to make a faction with very good defense on frost land types, but this causes a problem to me. My original idea is, the faction lives at a frozen wasteland, mainly plains and some hills, so they're used at these terrains, receiving 70% defense at both.
But they are truly bad at sand and forests. The sand is easy to fix, I just need a 20% on sand terrain with defense tag - but the forest is a bit more complicated.
The original idea was giving a 30% in forests - but since the entire place is cold, ice + forests will give them the same 70% than flat frozen, and that causes a huge unbalancing.
My idea was another [defense] tag, something like [low_defense], working exactly the same as current defense tag, but making units get the worst defense value when different ones stack.
That would make my faction still get the 70% defense bonus at flat frozen terrain, but only 30% at forests, even if they're also frozen type.
Not sure if it's too hard to implement, but it would help sometimes. Even if you couldn't use both [defense] and [low_defense] at the same unit, being limited to choose one of them.
Re: alternative tag for [defense]
UnitsWML says,Zolm wrote:That would make my faction still get the 70% defense bonus at flat frozen terrain, but only 30% at forests, even if they're also frozen type.
A code like this can work (I think).If the defense value is negative, then the unit will be hit as though the value were positive with one difference: the number is also the best defense that the unit may have if there is more than one terrain type for the terrain the unit is on.
Code: Select all
[defense]
sand=80
forest=-70
frozen=30
[/defense]
Also, bats have feral trait, which has village=-50 defense in its code.
My MP Eras and Mods with core units and unusual gameplay (version 1.3.1 for Wesnoth 1.12)