Combat and Factions
Integrating Ninja Combat and Ninja Factions allows you to control friendly fire based on the Faction and Alignment between the Attacker and Target.
This integration is automatically enabled when both plugins are available and active in the project, regardless of whether they are installed locally or in the engine.
Modifying Damage
Ninja Combat provides an interface that establishes the contract for damage modification: CombatDamageModifierInterface. It allows damage to be modified or fully cancelled. For more information about damage modification and cancellation, check the Damage and Mitigation page.
This interface is added to the mitigation pipeline via the Modifier Interface mitigation object. When added to the pipeline, it evaluates the Game Mode and Game State for valid implementations of the interface.
The integration with Ninja Factions uses this mechanism by introducing a dedicated component that can check the Team Attitude, as provided by Ninja Factions, between the attacker and victim. This component can cancel or modify damage applied to friendly actors.
Configuring the Damage Evaluator
Add the
CombatDamageModifierInterfaceto your Game Mode or Game State.Add
NinjaCombatFactionDamageEvaluatorto the same object.Route the interface's
ShouldCancelDamagefunction to the component's implementation.Route the interface's
ModifyDamagefunction to the component's implementation.Make sure that your Combat Mitigation Pipeline asset includes the Modifier Interface mitigation object.
The component offers two settings:
Property | Description |
|---|---|
| Determines whether friendly damage is fully cancelled. If enabled, the damage is discarded. |
| If damage is not cancelled, determines how much base damage is mitigated for friendly targets. |