PlayerAnyDamage

From The KillerJim Mod Wiki

PlayerProxy::AnyDamage

PlayerAnyDamage.png

Server Only Event - This is an event that only fires on the server

Description

This event is called when damage is applied to any player, through any method (gun, fall, world damage, kill zone, etc.) and requires you to return the actual damage (i.e. loss of health) that should be applied to the player.

Note: It is highly recommended you call the parent event, failure to do this will result in things such as the kill zones not working correctly (see example below).

In certain game-mode aspects you may wish to alter how damage is applied to the player; for example if the player has 'God' mode on, or is an 'Admin', or is entering a zone where damage is doubled, etc.

Arguments
1 Float Damage
How much damage KJMod thinks should be applied to the player (based on weapon, impact point, etc.)
2 Enum ImpactPoint
This enum provides where on the player the hit (that generated the damage) applied.
3 Object DamageTypeObject
The direct UE4 damage type object
4 Controller Object InstigatedBy
The player (as a controller) who created the damage
5 Controller Object DamageCauser
The actor (gun, world item, etc.) that caused the damage
Arguments
1 Float ActualDamage
The actual damage (in terms of health loss) applied to the player
Example

Shown below is the PlayerAnyDamage event from the TTT game-mode.

Every player proxy has access to the game-mode (as in TTT, the GameModeBP Variable is 'exposed on spawn' and set by the server when spawning the KJModTTTPlayerProxy). Therefore it's trivial for each proxy to look at the game's current "state" and see if the players are in the 'Game_Main' state.

If the player proxy see's the players outside this state, then it will zero the damage. This means players cannot inflict damage on other players during the pre and post round phases of the game.

PlayerAnyDamageExample.png

Playing

Developers

Developer Reference