DamageHistoryCallback
Modding resource. Provide some useful callbacks.
模組介紹 作者原文
This mod provides some useful functions in client.
You should not install this until you are told.
Functions
I don't know how to obtain the damageSourceId from damage did by local player. So the DamageHistoryStruct which local player is the attacker, has eDamageSourceId.damagedef_unknown as damageSourceId.
sh_damage_history.gnut
global struct DamageHistoryStruct
{
string attackerName
string attackerPetName
vector origin
float damage
int damageType // describe the damage
int damageSourceId // what did the damage
entity attacker
int attackerEHandle
float attackerHealthPercent
float time
array weaponMods
bool victimIsTitan
bool rodeoDamage
/// modded
string victimName
string victimPetName
float victimHealthPercent
entity victim
bool victimIsNPC = false
bool isHeadShot
bool isKillShot
bool isCritical
bool isRodeo
bool isMelee
bool isElectric
bool isExplosion
bool isBullet
bool isShotgun
bool isTitanStep
bool isRagdoll
bool isGib
///
}
DamageHistoryStruct function GetLastDamageHistoryByAttackerAndDamageSourceId( entity victim, entity attacker, int damageSourceId)
DamageHistoryStruct function GetLastDamageHistoryByDamageSourceId( entity victim, int damageSourceId )
DamageHistoryStruct function GetLastDamageHistoryByAttacker( entity victim, entity attacker )
array function GetDamageHistoryByAttacker( entity player, entity attacker, float time = 0 )
//string function DamageSourceIDToString( damageHistory.damageSourceId )
array function GetDamageHistoryByDamageSourceId( entity player, int damageSourceId, float time = 0 )
array function GetDamageHistoryByAttackerAndDamageSourceId( entity player, entity attacker, int damageSourceId, float time = 0 )
// DamageHistoryIncludeLocalClientPlayer clear after killReplayHudDeactive or localplayer killed.
array function GetDamageHistoryIncludeLocalClientPlayer( bool onlyAlive = false, bool merge = false)
bool function WasRecentlyHitByEntityAndDamageSourceId( entity player, entity attacker, int damageSourceId, float hitTime )
array function DefaultMergeDamageHistoryIncludeLocalClientPlayer(array inputHistories,
float mergeInterval = MERGE_INTERVAL
void function ClearDamageHistoryIncludeLocalClientPlayer()
void function StoreDamageHistoryToLocal(DamageHistoryStruct damageHistory, bool shouldMerge = true)
Example
- KillReplayDamageHUD
Changelog
1.2.0
- New feature. The script will try to obtain the damageSourceID from the dmg did by localPlayer.
1.2.1
- Bugfix. Obtain the weapon after localPlayer's death. Valid check added.
1.2.2
- Bugfix.
1.2.3
- Bugfix.
安裝與使用 安裝:Northstar 用戶端模組
- 先安裝 Northstar 用戶端(Titanfall 2 的開源社群用戶端,官方發布頁提供安裝器),模組由它載入。
- 把本站下載的壓縮包解壓,內容放入 Titanfall2 目錄下的 Northstar/mods/ 資料夾。
- 透過 NorthstarLauncher.exe 啟動遊戲,控制台會列出已載入的模組。
Northstar 用於私人伺服器與自訂內容,請勿用它連線官方伺服器。
下面這些內容需要先安裝,否則該模組不會生效: