DamageHistoryCallback

v1.2.3·Updated 2024-07-10

Modding resource. Provide some useful callbacks.

About this mod Author’s original text

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.

Install & use Install: Northstar client mod

  1. Install the Northstar client first (the open-source community client for Titanfall 2; its release page provides an installer). It loads the mods.
  2. Unzip the archive from playbuff and put its contents into the Northstar/mods/ folder inside your Titanfall2 directory.
  3. Start the game through NorthstarLauncher.exe — the console lists the mods it loaded.

Northstar is for private servers and custom content; do not use it to connect to official servers.

Dependencies

Install these first, or the mod will not work:

Team036-ClPlayerCallback

File & checksum

Filename
DamageHistoryCallback-1.2.3.zip
File size
15.8 KiB