How do I get an "agent" from "?game_action_instigator"?

In the Game module, it appears we can get an Instigator from damage_result like so:

Instigator<native><public>:?game_action_instigator = external {}

However, I’m trying to subscribe this operation to an agent and the Digest is not clear on how this works.

 # Get the agent from the instigator interface. Fails if the instigator is not a agent.
    (InInstigator:game_action_instigator).GetInstigatorAgent<native><public>()<transacts><decides>:agent

As it will return this error:

Help appreciated!

1 Like

You’ll want to do something like

    SubscribedFunction (DamageResult : damage_result) : void = {
        if(Instigator := DamageResult.Instigator?, InstigatorAgent := Instigator.GetInstigatorAgent[]):
            # Use InstigatorAgent however you want from here
    }
1 Like

lol oops, I was missing the ?. Thanks!