Details

Last Updated
last year
First Uploaded
last year
Downloads
807
Likes
0
Size
16KB
Dependency string
Team036-DamageHistoryCallback-1.2.3
Dependants

Categories

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<string> 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<DamageHistoryStruct> function GetDamageHistoryByAttacker( entity player, entity attacker, float time = 0 )
//string function DamageSourceIDToString( damageHistory.damageSourceId )
array<DamageHistoryStruct> function GetDamageHistoryByDamageSourceId( entity player, int damageSourceId, float time = 0 )
array<DamageHistoryStruct> function GetDamageHistoryByAttackerAndDamageSourceId( entity player, entity attacker, int damageSourceId, float time = 0 )

// DamageHistoryIncludeLocalClientPlayer clear after killReplayHudDeactive or localplayer killed.
array<DamageHistoryStruct> function GetDamageHistoryIncludeLocalClientPlayer( bool onlyAlive = false , bool merge = false)

bool function WasRecentlyHitByEntityAndDamageSourceId( entity player, entity attacker, int damageSourceId, float hitTime )
array<DamageHistoryStruct> function DefaultMergeDamageHistoryIncludeLocalClientPlayer(array < DamageHistoryStruct > inputHistories,
	 float mergeInterval = MERGE_INTERVAL
void function ClearDamageHistoryIncludeLocalClientPlayer()
void function StoreDamageHistoryToLocal(DamageHistoryStruct damageHistory, bool shouldMerge = true)

Example

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.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.