KillIndicatorFix
A client-side mod that makes kill indicators consistent when you are not host.
About this mod Author’s original text
Level up your GTFO experience - know your fight, and own the night with the KillIndicatorFix mod ʕ ᵔᴥᵔ ʔ
A client-side mod that makes kill indicators consistent when you are not host.
Recommended! Keep vanilla progress!
Requires Bepinex, but is not dependent on GTFO-API plugin, so you can remove GTFO-API.dll from plugins folder to keep vanilla rundown and progression.
Known Limitations:
- ~~Sentry's will not show kill indicators as it would for host (client simply won't see their own sentry's kills).~~
- Host-only support added since v0.1.0!
- Delay on kill indicator due to ping when client prediction fails.
============ Config File ============
The way this fix works is by keeping track of enemies you are shooting at:
- If your shot is predicted to kill on client side, the kill marker is shown.
- If a onkill event from host is received for an enemy you are shooting at then a kill marker is shown.
To prevent two kill markers from showing, the plugin keeps note of what enemies you are shooting at and what enemies it has already shown the kill marker for:
- If the kill marker for an enemy has already been shown, it will not show it again when receiving the onkill event from host.
- It will keep track of kill markers that have been shown in the last 3 seconds (dictated by markerLifeTime in config)
To prevent a kill marker showing on an enemy you shot 30 minutes ago, the plugin keeps track of enemies you have shot at recently within a 1 second period (dictated by tagBufferPeriod in config)
============ API Events ============
using KillIndicatorFix;
[BepInPlugin(Module.GUID, Module.Name, Module.Version)]
[BepInDependency(KillIndicatorFix.BepInEx.Module.GUID, BepInDependency.DependencyFlags.HardDependency)]
public class Plugin: BasePlugin {
public override void Load() {
Kill.RegisterAll();
Kill.OnKillIndicator += (Action)OnKillIndicator;
}
[OnKillIndicator]
///
/// Is called whenever a kill indicator is shown for a given enemy.
///
/// Enemy that kill indicator was shown for.
/// Item used.
/// On client, if the local player made the kill, provides the delay in milliseconds from player shot to recieving death packet from host.
private static void OnKillIndicator(EnemyAgent enemy, ItemEquippable item, long delay) {
}
}
If you have a mod that applies damage and you want KillIndicatorFix to work with it, you can alter the enemies HP value directly for clients and tag the enemy using:
///
/// Tag an enemy for Kill Indicator Fix to handle kills.
///
/// Enemy to tag.
/// Item that applied the damage for this tag. If not provided, uses currently equipped weapon.
/// Where the indicator should appear. Typically this is set to the hit position for bullet hit. If not provided, uses last tag's hit position when available, otherwise uses eye position. NOTE: The position is local to the enemy, not world-space.
Kill.TagEnemy(EnemyAgent enemy, ItemEquippable? item = null, Vector3? localHitPosition = null);
Example use:
Dam_EnemyDamageLimb limb =...;
Dam_EnemyDamageBase enemy =...
enemy.Health -= damage;
Kill.TagEnemy(enemy); // Tag the enemy, so when it dies KIF will show kill indicator as approapriate.
if (enemy.Health hpTracker = new Dictionary();
[HarmonyPatch(typeof(Dam_EnemyDamageLimb), nameof(Dam_EnemyDamageLimb.BulletDamage))]
[HarmonyPrefix]
public static void BulletDamage(Dam_EnemyDamageLimb __instance, float dam,...)
{...
Dam_EnemyDamageBase m_base = __instance.m_base;
EnemyAgent owner = m_base.Owner;
int instanceID = owner.GetInstanceID();
// Apply damage modifiers (head, occiput etc...)
float num = __instance.ApplyWeakspotAndArmorModifiers(dam, precisionMulti);
num = __instance.ApplyDamageFromBehindBonus(num, position, direction);
// Manage your own health tracker - maybe remove trackers when their hp falls below 0
if (hpTracker.ContainsKey(instanceID))
{
hpTracker[instanceID] = hpTracker[instanceID] - num;
}
else hpTracker.Add(instanceID, m_base.HealthMax - num);...
}
It should b
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.
Install these first, or the mod will not work: