Page 1 of 1
AI issue regarding the Conquest Objective
Posted: Tue Sep 04, 2007 8:55 pm
by SBF_Dann_Boeing
I notice that if i have the Conquest Objective for my mode, that when a team's reinforcements become low, the ai stop spawning cuz the leftover reinforcements are all spawned. I want it so my Objective has a Kill Limit like in the TDMObjective, but I want them chasing cps but without "running out" of reinforcements so they keep spawning up until the end of the session. How do I achieve this?
Re: AI issue regarding the Conquest Objective
Posted: Wed Sep 05, 2007 2:40 pm
by SBF_Dann_Boeing
I've digging through the ObjectiveTDM lua, this section seems to be of importance:
function ObjectiveTDM:Start()
if ( self.isCelebrityDeathmatch == true ) then
ScriptCB_SetNumBots(ScriptCB_GetASSNumBots())
end
--===============================
-- Initialization logic
--===============================
--initialize the base objective data first
Objective.Start(self)
if self.multiplayerRules then
ShowTeamPoints(self.teamATT, true)
ShowTeamPoints(self.teamDEF, true)
SetReinforcementCount(self.teamATT, -1)
SetReinforcementCount(self.teamDEF, -1)
SetTeamPoints(self.teamATT, 0)
SetTeamPoints(self.teamDEF, 0)
if ( self.isCelebrityDeathmatch ) then
ScriptCB_ShowHuntScoreLimit(2)
elseif ( self.isUberMode ) then
ScriptCB_ShowHuntScoreLimit(3)
ScriptCB_SetUberScoreLimit(self.uberScoreLimit)
else
ScriptCB_ShowHuntScoreLimit(1)
end
end
--set AI goals
self.AIGoals = {}
if self.AIGoalWeight > 0.0 then
table.insert(self.AIGoals, AddAIGoal(self.teamATT, "Deathmatch", 100*self.AIGoalWeight))
table.insert(self.AIGoals, AddAIGoal(self.teamDEF, "Deathmatch", 100*self.AIGoalWeight))
end
This part seems to define the kill limit. However, I'm not sure what each specific line means, for example, what the number value is in ScriptCB_ShowHuntScoreLimit(3).
Since my mode happens to be set to Uber Settings, is this what I would want to put in my lua:
ScriptCB_SetUberScoreLimit(self.uberScoreLimit) ?
In the ObjectiveConquest Lua, the line that sets the number of AI spawning to the reinforcements seems to be this line:
ScriptCB_SetNumBots(ScriptCB_GetCONNumBots()). However, this seems to be a different type of ScriptCB from the line mentioned above, so I don't know what to do. Is anyone familiar with any of this?
Re: AI issue regarding the Conquest Objective
Posted: Thu Sep 06, 2007 3:46 pm
by SBF_Dann_Boeing
hmm...guess that's a no. I just changed my mode to have ObjectiveTDM since i didn't want to mess up my lua
Re: AI issue regarding the Conquest Objective
Posted: Thu Sep 06, 2007 5:52 pm
by [RDH]Zerted
ScriptCB_GetCONNumBots() gets the number of bots set for the conquest mode. This is the option you change in the server manager, the map option screens, or through command line parameters (like: BattlefrontII.exe /bots 13).
ScriptCB_SetNumBots() sets the max amount of AI units that can be spawned ingame at any given time (I forget if its per team or total on the map).
I have not tested, but think ScriptCB_ShowHuntScoreLimit() changes the way the scores are displayed on the hud. Think of how the 1-CTF, 2-CTF, and campaign huds look different (FakeConsole has these options, but you need kill yourself for commands to take affect).
There are many ways to do what you wish. You could keep track of the reinforcement count. When it goes below the NumBots, increase it by NumBots. This way, the game will still have the reforcements to spawn AI units. When the reinforcement count drops to NumBots a second time, it has really reached zero so manually end the objective or set it to zero.