Wrong Usage of Defensive Trait (1.0.0+)

Moderators: The Artistocrats, Order of Battle Moderators

Post Reply
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Wrong Usage of Defensive Trait (1.0.0+)

Post 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.
Last edited by Horst on Mon Dec 12, 2022 4:22 pm, edited 1 time in total.
StuccoFresco
Sergeant Major - SdKfz 234/2 8Rad
Sergeant Major - SdKfz 234/2 8Rad
Posts: 645
Joined: Sun Feb 10, 2019 11:10 am

Re: Wrong Usage of Defensive Trait (8.6.0)

Post by StuccoFresco »

This trait only works in classes.txt
Well, that's good to know just now.
GabeKnight
Lieutenant-General - Karl-Gerat 040
Lieutenant-General - Karl-Gerat 040
Posts: 3710
Joined: Mon Nov 27, 2017 10:24 pm

Re: Wrong Usage of Defensive Trait (8.6.0)

Post 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.
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: Wrong Usage of Defensive Trait (8.6.0)

Post 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.
GabeKnight
Lieutenant-General - Karl-Gerat 040
Lieutenant-General - Karl-Gerat 040
Posts: 3710
Joined: Mon Nov 27, 2017 10:24 pm

Re: Wrong Usage of Defensive Trait (8.6.0)

Post by GabeKnight »

Thanks.
StuccoFresco
Sergeant Major - SdKfz 234/2 8Rad
Sergeant Major - SdKfz 234/2 8Rad
Posts: 645
Joined: Sun Feb 10, 2019 11:10 am

Re: Wrong Usage of Defensive Trait (8.6.0)

Post 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?
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: Wrong Usage of Defensive Trait (8.6.0)

Post 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.
StuccoFresco
Sergeant Major - SdKfz 234/2 8Rad
Sergeant Major - SdKfz 234/2 8Rad
Posts: 645
Joined: Sun Feb 10, 2019 11:10 am

Re: Wrong Usage of Defensive Trait (8.6.0)

Post 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.
StuccoFresco
Sergeant Major - SdKfz 234/2 8Rad
Sergeant Major - SdKfz 234/2 8Rad
Posts: 645
Joined: Sun Feb 10, 2019 11:10 am

Re: Wrong Usage of Defensive Trait (8.6.0)

Post 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.
Horst
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1927
Joined: Mon Feb 18, 2013 1:22 pm

Re: Wrong Usage of Defensive Trait (1.0.0+)

Post by Horst »

Still not fixed, so I guess working as intended: full firepower for all units!
Post Reply

Return to “Order of Battle Bug Submissions”