I’m wondering if anybody knows how to detect which player downed another player in a game with down but not out enabled. I looked around but I don’t see a result object from when a player goes down that includes the player that downed them.
Hey, I think there’s a specific device for this called down_but_not_out_device
, never used it but it seems pretty straight forward
Thanks Fenzy, unfortunately it doesn’t do much at all and doesn’t send any event on who knocked a player down.
Oh yeah sorry you’re right, maybe you can store the last player who damaged your player and then in down_but_not_out_device.AgentDownedEvent
you retrieve this last damager?
I thought about that, but there’s no way to get the Agent that damaged a player because it’s broken for the OnDamaged event and the instigator doesn’t come through (as far as I’ve seen in my testing, it comes up empty)… maybe I’m wrong and there’s code out there that gets the character that damaged another character
Very nice solution and explanation, especially since Verse is so new.
Thanks. Although… hmmm… last time I checked (and it wasn’t that long ago and the tutorial is 4 months old) instigator didn’t return anything, that was my question. I’ll give this method a go one more time though just in case.
Instigator returns game_action_instigator which can be cast to agent and used as a comparable (this info is in fortnite.digest.verse)
# Returns the `agent` for `InInstigator`. Fails if `InInstigator` is not an `agent`.
(InInstigator:game_action_instigator).GetInstigatorAgent<native><public>()<transacts><decides>:agent
Also important to be aware that instigator is an optional so you’ll want to write your damage handler like this:
OnPlayerDamaged(DmgResult:damage_result):void=
if(Instigator := DmgResult.Instigator?):
if(InAgent:=Instigator.GetInstigatorAgent[]):
YourLogicGoesHere
thanks! I’m aware of all that, I’ve been trying to say that there is possibly a bug not giving reliable results, but I’ll see once I’m back in.