Bot skill tweaker
This mutator allows to change skill levels of bots in each teams.
behaviour("botskilltweaker")
function botskilltweaker:Awake()
GameEvents.onActorSpawn.AddListener(self, "OnActorSpawn")
self.allylevel=self.script.mutator.GetConfigurationDropdown("allylevel")
self.enemylevel=self.script.mutator.GetConfigurationDropdown("enemylevel")
end
function botskilltweaker:OnActorSpawn(actor)
if actor.isBot then
local lev=self.allylevel
if actor.team==Team.Red then
lev=self.enemylevel
end
local sk=math.random(0,3)
if lev>0 then
sk=lev-1
end
if sk==0 then
actor.aiController.skillLevel=SkillLevel.Beginner
end
if sk==1 then
actor.aiController.skillLevel=SkillLevel.Normal
end
if sk==2 then
actor.aiController.skillLevel=SkillLevel.Veteran
end
if sk==3 then
actor.aiController.skillLevel=SkillLevel.Elite
end
end
end