damage_result<native><public> := struct<epic_internal>:
# Object that was damaged.
Target<native><public>:damageable
# Amount of damage applied to `Target`.
Amount<native><public>:float
# Player, agent, etc. that instigated the damage to `Target`. Can be false when damage is instigated by code, the environment, etc.
Instigator<native><public>:?game_action_instigator = external {}
# Player, weapon, vehicle, etc. that damaged `Target`. Can be false when damage is caused by code, the environment, etc.
Source<native><public>:?game_action_causer = external {}
But there doesn’t seem to be any way to extract anything from the Instigator or Source even when trying to typecast it to agent or player, it just fails. How can we tell what did the damage?
At least the amount works… but the rest needs to work too!
Did this to get an instigator of damage against a creature and it worked for a player. Not sure how I would go about doing it for the storm (especially because it will award elims to players that last damaged someone died in the storm etc).
OnDamaged(Result:damage_result): void =
MaybeInstigator := Result.Instigator
if (Instigator := MaybeInstigator?):
if (InstagatingAgent := Instigator.GetInstigatorAgent[]):
ItemGranter.GrantItem(InstagatingAgent)
MaybeInstigator := d.Instigator
if (Instigator := MaybeInstigator?):
if (InstagatingAgent := Instigator.GetInstigatorAgent[]):
Print("this is an actual player shooting us?")
if(IFC:fort_character = InstagatingAgent.GetFortCharacter[]):
Print("found the character")
IFC.SetHealth(50.0)
This sets the health of the player getting hit, to 50 if in the storm
In Visual Studio, you can ctrl + click on any Verse device/property/method and it will open up the Verse digests API. This is where you can see a list of all Verse device API calls with comments. Also in the VS explorer panel you can see the other Unreal/Fortnite digest APIs.