I know how to convert an “?agent” to an “agent”:
if (MaybeAgent := Agent?):
Do stuff with MaybeAgent (agent)
But what about converting an “agent” to “?agent” for some methods that request an “?agent” as parameters instead of “agent”?
I know how to convert an “?agent” to an “agent”:
if (MaybeAgent := Agent?):
Do stuff with MaybeAgent (agent)
But what about converting an “agent” to “?agent” for some methods that request an “?agent” as parameters instead of “agent”?
You’d simply use option{agent}
.
Hey i am super lost right now and saw that you understand Agents 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 souper 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}")
For future reference, you should just open a new topic, as this just makes the thread a lot more messy, and people with the same issue won’t be able to find this as easily.
I’m not sure that I understand you correctly, but it seems like you’re trying to do what you describe as your issue. You’re looping through every player and printing their tracked value… but you only want one player?
Verse doesn’t really know which player you want to reference (someone who opened a door, the person with the most kills, the first person to join?), so we can’t really tell it to just pick one player (at least not with the given context).
Please either take this advice and try to figure out what you’re actually trying to do or elaborate in a new topic
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.