What is the relationship between teams & devices?

TheDadXI
Sat, 16 Sep 2023 16:14:01 +0000
Verse

I have a custom class with 2 [team_settings_and_inventory_device] editables & then in the main device code I call GetPlayspace().GetTeamCollection() … How do I determine which item in the collection relates to my device?

Sample Code ( assign 1 player to first team & then ALL other players to second team)

    AssignTeams():void={
        #randomly select 1 player at the beginning
        AllPlayers := GetPlayspace().GetPlayers()
        PlayerIndex := GetRandomInt(0,AllPlayers.Length-1)
        if(SelectedPlayer := AllPlayers[PlayerIndex]){
            #(move player to first team & apply the class)

        }

        var curIndex : int = 0
        Teams := GetPlayspace().GetTeamCollection()
        for(CustomPlayer : AllPlayers){
            if(curIndex <> PlayerIndex){
                #Move ALL other player to other Team

            }
            set curIndex += 1
        }
    }

14 posts - 4 participants