How do I check the value of a enum? (In my case of team_attitude)

I need to access to the Teammates of a player.
So I used the Team module, I got the agent of the instigator and with a for I check if every other agent is friendly with him, using an if statement, but I don’t understand how I can check the result of team_attitude.

This is the code I’ve tried to write:

CheckDownedPerk(Agent : agent):void= 
    if(DownedMap[Agent] = 1):
        Teams := GetPlayspace().GetTeamCollection()
        for(Player : GetPlayspace().GetPlayers(), Agent2 := agent[Player]):
            if(Attitude := Teams.GetTeamAttitude[Agent, Agent2]):
                if(Attitude = team_attitude{Friendly}):
                    #Do something

The error I get is: team_attitude is not a macro.

I’ve also tried using enum{team_attitude}, but it still doesn’t work.

Well, right after writing this I’ve found the solution, but I’m gonna keep the post since this may be helpful to others.

The correct statement is team_attitude.Friendly, so this is the right code:

  CheckDownedPerk(Agent : agent):void= 
      if(DownedMap[Agent] = 1):
          Teams := GetPlayspace().GetTeamCollection()
          for(Player : GetPlayspace().GetPlayers(), Agent2 := agent[Player]):
              if(Attitude := Teams.GetTeamAttitude[Agent, Agent2]):
                  if(Attitude = team_attitude.Friendly):
                      #Do something
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.