Players can join teams in Merge Chef 3D by Kyoso Interactive.
Teams are a Hiro GDK meta system which allows the player to create, join, and search for teams of other players. Teams can be used to create guilds, clans, or any other organized unit of players useful for your gameplay.
The Teams system is build on top of the Nakama groups feature, and the chat feature, to enable players to communicate with each other, fetch historical chat messages, and even request donations.
You can listen for changes in the teams system so that you can respond appropriately, such as updating the UI, by implementing the appropriate interface.
1
2
3
4
5
vardisposer=SystemObserver<TeamSystem>.Create(teamsSystem,system=>{Instance.Logger.Info($"System updated.");// Update UI elements etc as necessary here...});
You can create a team for the user. You must provide a function that returns a boolean value indicating whether or not the user can create a team.
1
2
3
4
5
6
7
8
9
10
varname="MyTeam";vardescription="My team description";varopen=true;varicon="<iconUrl>";varsetupMetadata="<metadata>";varteam=awaitteamsSystem.CreateTeamAsync(name,description,open,icon,setupMetadata,(client,session)=>{// Check if the user is eligible to create a team// e.g. Are they high enough level?returnTask.FromResult(true);});
varlocation="uk";varlimit=10;varcursor="<optionalCursor>";varteamList=awaitteamsSystem.ListTeamsAsync(location,limit,cursor);foreach(varteaminteamList.Teams){Debug.Log($"Team: {team.Name}. Total members: {team.EdgeCount}");}
You can search for teams based on their name or shortcode.
1
2
3
4
5
6
7
8
9
10
varname="<name>";varshortcode="<optionalShortcode>";varlimit=10;varteamList=awaitteamsSystem.SearchTeamsAsync(name,shortcode,limit);foreach(varteaminteamList.Teams){Debug.Log($"Team: {team.Name}. Total members: {team.EdgeCount}");}