• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Icewraith

Major
May 24, 2018
612
11
There are stats or calculated values that exist somewhere, like the Jump Distance multiplier in the PXH’s thrust kit.

These are slightly different from things found in places like combatgameconstants. (Base spotter distance vs max spotter distance, which is what rangefinders affect)

Where do I find these things? (How/where do I look at the code that calculates these things so the equipment can call them correctly)

Alternatively, what do I need to adjust for fixed mech equipment to do the following things:

Reduce the heat generated by a specific unit when it jumps (instead of messing with the global value in combatgamecontants.json)

Adjust the firing arc width of an individual unit (again instead of messing with the global value, which I found)

Increase the evasion charges stripped and debuff of sensor lock when a specific unit uses sensor lock.

Passive aura that reduces enemy hit chance and increases stability damage taken.

Equipment that removes a % of a mech’s heat at the start of its turn, isn’t affected by biome.

Reduce terrain penalties (I found the global setting)

Most of the weapon specific stuff is easy to figure out from existing equipment.
 
Most of the stuff should be in either the chassisdef or mechdef -- more likely chassisdef. There are certain items in there that you have to code up status effect to work, I think.
 
Reduce the heat generated by a specific unit when it jumps (instead of messing with the global value in combatgamecontants.json)
impossible without mod
Code:
    public int CalcJumpHeat(float distJumped)
    {
      return (int) ((double) Mathf.Max(this.Combat.Constants.Heat.JumpHeatMin, ((int) ((double) distJumped / (double) this.Combat.Constants.Heat.JumpHeatUnitSize) + 1) * this.Combat.Constants.Heat.JumpHeatPerUnit) * (double) this.Combat.Constants.Heat.GlobalHeatIncreaseMultiplier);
    }
Adjust the firing arc width of an individual unit (again instead of messing with the global value, which I found)
impossible without CustomUnits mod. In vanilla firing arc can be set only for turrets.
Code:
Mech class
    public override bool IsTargetPositionInFiringArc(ICombatant targetUnit, Vector3 attackPosition, Quaternion attackRotation, Vector3 targetPosition)
......................................................................................
      Quaternion b = Quaternion.LookRotation(forward);
      return (double) Quaternion.Angle(attackRotation, b) < (double) this.Combat.Constants.ToHit.FiringArcDegrees;
    }
Vehicle class
    public override bool IsTargetPositionInFiringArc(ICombatant targetUnit, Vector3 attackPosition, Quaternion attackRotation, Vector3 targetPosition)
    {
      return true;
    }
Turret class
    public override bool IsTargetPositionInFiringArc(ICombatant targetUnit, Vector3 attackPosition, Quaternion attackRotation, Vector3 targetPosition)
    {
      Vector3 forward = targetPosition - attackPosition;
      forward.y = 0.0f;
      Quaternion b = Quaternion.LookRotation(forward);
      return (double) Quaternion.Angle(attackRotation, b) < (double) this.TurretDef.FiringArcDegrees;
    }
Passive aura that reduces enemy hit chance and increases stability damage taken.
Impossible without CustomActivatableEquipment. In vanilla auras only for ECM and hardcoded.
Increase the evasion charges stripped and debuff of sensor lock when a specific unit uses sensor lock.
Impossible without code change.
Equipment that removes a % of a mech’s heat at the start of its turn, isn’t affected by biome.
Impossible without code change.
Reduce terrain penalties (I found the global setting)
terrain effects are in designMasks BattleTech_Data/StreamingAssets/data/designMasks/
Where do I find these things? (How/where do I look at the code that calculates these things so the equipment can call them correctly)
dnSpy and/or JetBrain dotPeek. I use both, for different things. dnSpy can runtime debugging and dynamic code patch. dotPeek easyer to use and search methods/classes using.
 
.Impossible without CustomActivatableEquipment. In vanilla auras only for ECM and hardcoded.

dnSpy and/or JetBrain dotPeek. I use both, for different things. dnSpy can runtime debugging and dynamic code patch. dotPeek easyer to use and search methods/classes using.

Incredibly helpful, but I got you on at least one count.

Custom equipment can make passive auras just fine, no active equipment definition required! (Proof of concept: tweaked the Marauder to buff allies within a range instead of auto hitting all lance mates, works in skirmish!)