Where do I look to change the victory conditions of the game. For example if I wanted the game to end once a team has reached x amount of tres, how would I go about doing that. I have been looking in NS2Gamerules.lua but struggling so far.
Any advice appreciated.
0
Comments
Warning: This class governs a LOT of the game, so tread carefully.
(I would do this with max 80 lines using the Shine Core/Lib.)
Two things:
Look at my roundlimiterplugin and how it ends a round: https://github.com/BrightPaul/NS2Stats.com/blob/develop/lua/shine/extensions/roundlimiter.lua
Now instead of OnScore and Timebased you would need
Shine.Hook.SetupClassHook("ResourceTower","CollectResources","OnTeamGetResources","PassivePost")andfunction Plugin:OnTeamGetResources(ResourceTower) local team = ResourceTower:GetTeam():GetTeamNumber() local amount = kTeamResourcePerTick teamres[team] = teamres[team] + amount if teamres[team] > self.Config.MaxTRes then self:EndRound() end endNS2 checks GetHasTeamWon() already in the code, even though currently it is empty, so you just need to fill it up and it should work fine