Page 1 of 1

Wrong Usage of Defensive Trait (1.0.0+)

Posted: Tue Oct 27, 2020 3:59 pm
by Horst
Towed guns in AT-mode all got the defensive trait which doesn’t work there. This trait only works in classes.txt as class-trait which modifies attack-damage by x0.7 if I’m not mistaken by reading the code.

Test:
No trait vs. same unit on river: 4:2+
No trait vs. same unit on ground: 3+:3+
Unit with defensive unit-trait vs. same unit on river: 4:2+
Unit with defensive unit-trait vs. same unit on ground: 3+:3+
Unit with defensive class-trait vs. same unit on river: 3+:2+
Unit with defensive class-trait vs. same unit on ground: 3:3+

And most importantly as prove if trait is added in classes.txt under [ANTI_TANK]:
There is a new trait listed for all AT-units called "Defensive Weapon: Unit is less effective at attacking"

No idea if this is intended, but adding this trait in wrong places doesn’t look right to me. The question is: do you want this attack-penalty on all anti-tank units as it also counts for the vehicles which didn’t have this before?
IMHO, it should be there as anti-tank vehicles also enjoy the powerful supportAT class-trait which tanks don’t have.
Another way would be to recode the trait to make it work in units.csv again or to keep ignoring this like five years before. Yeah, sorry that it took so long for me to discover this.

Re: Wrong Usage of Defensive Trait (8.6.0)

Posted: Tue Oct 27, 2020 8:47 pm
by StuccoFresco
This trait only works in classes.txt
Well, that's good to know just now.

Re: Wrong Usage of Defensive Trait (8.6.0)

Posted: Tue Nov 03, 2020 12:31 pm
by GabeKnight
StuccoFresco wrote: Tue Oct 27, 2020 8:47 pm
This trait only works in classes.txt
Well, that's good to know just now.
Yep.
There're more of such traits that I personally have no idea how (or if) they work, like "armoured" and "armourPiercing" etc.

Re: Wrong Usage of Defensive Trait (8.6.0)

Posted: Tue Nov 03, 2020 3:15 pm
by Horst

Code: Select all

if (shooterType.armourPiercing && targetType.armoured)
        {
        }
Maybe there was something implemented in the early phase of development but got eventually removed from the code.

Re: Wrong Usage of Defensive Trait (8.6.0)

Posted: Tue Nov 03, 2020 8:58 pm
by GabeKnight
Thanks.

Re: Wrong Usage of Defensive Trait (8.6.0)

Posted: Wed Nov 04, 2020 8:11 am
by StuccoFresco
Horst wrote: Tue Nov 03, 2020 3:15 pm

Code: Select all

if (shooterType.armourPiercing && targetType.armoured)
        {
        }
Maybe there was something implemented in the early phase of development but got eventually removed from the code.
Where is this line? Which file?

Re: Wrong Usage of Defensive Trait (8.6.0)

Posted: Wed Nov 04, 2020 3:26 pm
by Horst
StuccoFresco wrote: Wed Nov 04, 2020 8:11 am Where is this line? Which file?
Assembly-CSharp.dll
You need a decompiler, like JustDecompile, to read such files.

Re: Wrong Usage of Defensive Trait (8.6.0)

Posted: Mon May 24, 2021 10:45 am
by StuccoFresco
Horst wrote: Wed Nov 04, 2020 3:26 pm Assembly-CSharp.dll
You need a decompiler, like JustDecompile, to read such files.
I'm gonna take a look at this file, since I'd like fortification level to help more with defensive values.

Re: Wrong Usage of Defensive Trait (8.6.0)

Posted: Mon May 24, 2021 5:05 pm
by StuccoFresco
I found it, it's in default namespace/GameEntrenchment, but I can't edit it with JustDecompile.


public class GameEntrenchment
{
public const int entrenchmentMax = 10;

private const int entrenchmentBaseSpeed = 3;

public const int entrenchmentQuickSpeedBonus = 2;

public const int entrenchmentSupportSpeedBonus = 2;

public const int entrenchmentCombatBonus = 5;

public const int entrenchmentBombardBonus = 4;

public const int attackEntrenchmentLoss = 3;

private static bool permanentEntrenchment;


I wanted to change "entrenchmentCombatBonus" to 8 but I can't.

Re: Wrong Usage of Defensive Trait (1.0.0+)

Posted: Mon Dec 12, 2022 4:21 pm
by Horst
Still not fixed, so I guess working as intended: full firepower for all units!