Hi folks,
I explain what I want to achieve at first. I have a volume in the level. When the player enters into it, it will start a timer. When the timer is completed, I would like to let the player win the game.
Firstly, I define a class to hold the volume and timer
gameflow_management_device := class(creative_device):
@editable
EvacuationTimer : timer_device = timer_device{}
@editable
EvacuationZone : mutator_zone_device = mutator_zone_device{}
And this class subscribes volume’s AgentEntersEvent. When the event is triggered, I tried to hold the agent for the future use. But It seems that I can not hold it in gameflow_management_device class because there is no pointer or reference of C++ in verse, and agent is epic internal class, so I can not declare an agent variable in class either.
Then I tried alternative way. I use agent to start the timer. When timer’s complete event is triggered, so I can get the agent from handler’s argument:
HandleEvacuationTimerComplete(Agent:?agent):void=
But I do not know how to convert ?agent to an agent with failable context.
I am not sure if I implement the idea in the right way. Any idea?
Cheers