You can’t convert it, but you can assing it to a ?agent var. For example:
var MaybeAgent : ?agent = false #We declare the ?agent var without passing anything
if (Player := player[Agent]){
# Do something with Player here now that we know this is in fact a Player type
set MaybeAgent = option{Agent}}
Read the error. It should be telling you you have ambiguous definition of Agent. Name your local Agent variable something different to the Agent input parameter. You also need to check your Agent of type ?agent actually exists before trying to use it.
Because GetFortCharacter is available on agent, so there is no need to cast to player. The variable name makes it clear it’s a reference to a fort_character and not a player.
Hey i am super lost right now and saw that you understand Agents and verse so i thought i would ask you. I am triing to get the tracker Value only for the the Player playing right now but it switches betwen all players (i only tried it with two) showing my tracked value and the my enemies would be super happy over some help
this is my code:
OnBegin():void =
loop:
for. Player : (GetPlayspace().GetPlayers())
do:
TargetValue := Tracker.GetValue(Player)
Print("Tracker is at {TargetValue}")