[engine] alternative tag for [defense]

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderators: Forum Moderators, Developers

Forum rules
Before posting a new idea, you must read the following:
Post Reply
Zolm
Posts: 25
Joined: May 18th, 2012, 1:30 am

[engine] alternative tag for [defense]

Post by Zolm » December 25th, 2012, 12:21 am

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.

User avatar
watbesh
Posts: 55
Joined: August 29th, 2012, 2:21 am
Location: Kanagawa, Japan

Re: alternative tag for [defense]

Post by watbesh » December 25th, 2012, 4:24 am

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.
UnitsWML says,
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.
A code like this can work (I think).

Code: Select all

[defense]
    sand=80
    forest=-70
    frozen=30
[/defense]
It gives the units 30% defense at forests, even if they are also frozen/hills.
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)

Post Reply