So i would like to know if is there anyway of keep a value between round. For exemple i wanna use a spawn pad as default and player will choose team in there.Then the next rounds will auto assign team

So i would like to know if is there anyway of keep a value between round. For exemple i wanna use a spawn pad as default and player will choose team in there.Then the next rounds will auto assign team. Like only using 1 round to assign the teams and then next round automatically put the players in the team

Yes, Class Selectors will let players choose teams. you can make them different colours and walk into to activate

not that. i already use that but theres is something making the player choose that team every round and i only want in 1st round

Technically the new weak_map and Session class both have to do with that, but they have been pretty buggy and inconsistent for a lot of people. Maybe if someone has done better, they can comment here.

As far as my recommendation goes, you can use the class selectors that you’re using to allow them to choose teams to change their class as well. Classes are automatically kept through rounds per the Island Setting for “Revert To Class Default”. On subsequent rounds, they will start on whatever team- but based on which class they are you can change them back to the team the selected in the previous round. That’s one method, it isn’t the best but so far no option isn’t either buggy or hacky.

yes i have made that but every round the team is 1 even if i put class to reset to default at end game and the class 2 (when a player select a tean) to when a game start if on class 2 then will put them in team 2 (for exemple)

Yes, what I was explaining is that there isn’t a way to save that team and have them spawn directly onto the team chosen. You have to keep track of it with a class and change them back to the corresponding team based on said class.

i found a way thanks! i only need this : how do i get a absolute value in Verse??

What was the way you found? And to do absolute value you would use Abs().

so what i did is not to end the round but when a team is eliminated add a point to other team and respawn both teams (so they keep the class and team and still in round 1) after that i did that when a team reach 5 points the game end. but now i will do this : i need to get the absolute value between the 2 teams and check if its greater than 2 . if it is then if a team has 5 or more points the game end. This is called a Ping Pong in terms of competitive match. ( A team need to win by 2)

Alright, sounds good. Just so you know, Respawn() is (according to a few sources) pretty unstable so far still, but definitely give it a shot and see if it works well for you.

do u know this?

OnButtonClick(Agent:agent):void=

    GrantWeapon(Agent,0)
    AllPlayers := GetPlayspace().GetPlayers()
    for (Player : AllPlayers, FortCharacter := Player.GetFortCharacter[]):
        Print ("OLA")
        teleporter.Teleport(Player)

wasnt this supose to teleport every player if one of them press the button
for exemple i have 2 players testing the map and if one of them press button i get 2x “Ola” meaning the game detected the 2 players and then only the one that pressed the button is teleported

You can only reliably teleport one player at a time to a teleporter unless player collision is turned off in the Island Settings.

ah thanks also can u help me solving this code :

OnPlayerEliminated(Result: elimination_result) :void=
Eliminator := Result.EliminatingCharacter
Eliminated := Result.EliminatedCharacter

  if (FortCharacter := Eliminator?, FortCharacter2 := Eliminated, EliminatingAgent := FortCharacter.GetAgent[], EliminatedAgent := FortCharacter2.GetAgent[]):
      TeamCollection := GetPlayspace().GetTeamCollection()

      if:  
          TeamPlayer := TeamCollection.GetTeam[EliminatedAgent]
      then:
          if:
              PlayerTeam := TeamCollection.GetAgents[TeamPlayer]
          then:
              # Initialize CurrentCount to 0 if the team is not in EliminatedTeams
              if (EliminatedTeams.HasKey(TeamPlayer)):
                  CurrentCount := EliminatedTeams[TeamPlayer]
              else:
                  CurrentCount := 0

              # Increase the eliminated count for the team
              CurrentCount = CurrentCount + 1
              EliminatedTeams[TeamPlayer] = CurrentCount
          
              Print("Eliminated count for team is {CurrentCount}")

              # Check if all team members are eliminated
              if (CurrentCount = length(PlayerTeam)):
                  Print("All members of team eliminated.")
              
                  # Activate score manager for the team
                  score_manager.Activate(EliminatingAgent)

i want to add a score to the eliminating agent once a Team dies for exemple.

if you’re asking a new question, it’s best if you mark what was a solution to your previous question as the solution and open a new post with the new question

1 Like