Is there a way to get the location of a creature the same way you get the player’s? I would like to get the location so that when a creature is eliminated I can make a prop appear in the place where it was eliminated.
In order to get the agent from the EliminatedEvent of a Creature you need to do the following
- Include the device_ai_interaction_result in your function parameter
eg YourFunctionHere(Result:device_ai_interaction_result):void=
and then inside your script do
if(Agent:=Result.Target?):
Put whatever code you used already here and it should use the creatures agent
Hope this solves your question
I think I understand what you’re saying, but could I implement this formula with the creature_placer_device?
Since Creatute Placer just returns a ?agent you can replace if(Agent:=Result.Target?):
if(Agent:=MaybeAgent?):
and change the parameters of your function to this YourFunctionHere(MaybeAgent:?agent):void=
Hope this solves your question
Grab that spawned agent from the creature_placer_device.SpawnedEvent and then retrieve the fort_character of that agent (SomeAgent.GetFortCharacter[]
)
But that way I would have to store the transform of each agent to then take it when the player eliminates a creature?
You can just listen to the EliminatedEvent of that fort_character and then retrieve the transform yes
Do you have any idea how to do it, because that is the part that I cannot specify, an example that can guide me, and sorry for asking so much, I am in the process of learning and thank you very much in advance.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.