This package will allow for a certain team to be able to pickup and place a gem into a specified team chest. It also allows you to create a “season” based leaderboard that works for each team. To create a unique season, you only need to add a new name for it on the script prior to making the game live. The team leaderboard works off a global counter, so can be tracked between sessions. There are some example “banners” that use UI widgets, these can be triggered to show the winning teams colours, as they are triggered on an event, then this could be expanded to other objects.
- Go to the community tab and search “Team Based Chest and leaderboard”.
- Install the package
- Drag the GlobalScores, ScoringGemTeam1, ScoringGemTeam2 into the world.
- Drag in two rewardChest templates and set the owningTeam for each of the team numbers and set the rewardingItem to the template of the pickup item that is the one you want to use as the reward for that team.
- In the Game settings, you can add the leaderboard id: teamScore
- You need to call the event RoundEnd to update the scores on the script teamHighscore for the leaderboard etc.
- You can add the example banners, but this isn’t a requirement.
I recommend either using the team deathmatch template, installing the standard game script, or basing the game mode you create off this. You can then call the RoundEnd by using the events on the gameController. You may want to do some additional coding to handle things like match ending when you have reached the end of a season. To track individual scores, then you can use a standard leaderboard and set that up as usual in the Game tab.
There are the following properties for the RewardScript:
rewardingItem = The template of the rewarding item that can be place in this “chest”.
owningTeam = The numeric id for the team that should be able to access this “chest”.
score = score in points per pickup.
openSound = The sound that is played when interacting with this “chest”.
openEffect = The effect that is played when interacting with this “chest”.
onDesposit = Events that can be triggered on depositing the reward.
invalidItem = Text to display if you try to deposit and invalid item.
invalidChest = Text to display if you try to deposit in a “chest” that belongs to a competing team.
leaderboardName = The reference id of the team leaderboard.
There has been an addition to the pickupSpawnerScript:
teamAassignment = The numeric id of the team that can pickup this item, leave on zero to ignore teams.
There are the following properties for the teamHighscore script:
maxTeams = The number of the max teams that you wish to track.
onTeamScore = Event that can be triggered when your team scores.
onSeasonEnd = Event that can be triggered when the season ends.
seasonName = A unique name for the season that is currently running.
pollTime = How often to check the team scores are updated.
There are the following properties for the updateBanner script:
bannerEffect = A visual effect when the banner appears for the winning team.