KillIndicatorFix
A client-side mod that makes kill indicators consistent when you are not host.
模組介紹 作者原文
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
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。
下面這些內容需要先安裝,否則該模組不會生效: