Wrong Usage of Defensive Trait (1.0.0+)
Moderators: The Artistocrats, Order of Battle Moderators
Wrong Usage of Defensive Trait (1.0.0+)
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.
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.
-
- 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)
Well, that's good to know just now.This trait only works in classes.txt
-
- Lieutenant-General - Karl-Gerat 040
- Posts: 3710
- Joined: Mon Nov 27, 2017 10:24 pm
Re: Wrong Usage of Defensive Trait (8.6.0)
Yep.StuccoFresco wrote: ↑Tue Oct 27, 2020 8:47 pmWell, that's good to know just now.This trait only works in classes.txt
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)
Code: Select all
if (shooterType.armourPiercing && targetType.armoured)
{
}
-
- Lieutenant-General - Karl-Gerat 040
- Posts: 3710
- Joined: Mon Nov 27, 2017 10:24 pm
-
- 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)
Where is this line? Which file?Horst wrote: ↑Tue Nov 03, 2020 3:15 pmMaybe there was something implemented in the early phase of development but got eventually removed from the code.Code: Select all
if (shooterType.armourPiercing && targetType.armoured) { }
Re: Wrong Usage of Defensive Trait (8.6.0)
Assembly-CSharp.dll
You need a decompiler, like JustDecompile, to read such files.
-
- Sergeant Major - SdKfz 234/2 8Rad
- Posts: 645
- Joined: Sun Feb 10, 2019 11:10 am
-
- 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)
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.
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+)
Still not fixed, so I guess working as intended: full firepower for all units!