Page 1 of 1

Campaign Conquest Woes [Solved]

Posted: Mon Aug 02, 2010 5:42 pm
by Sky_216
Hmm, hit a bit of a problem. I'm trying to make a simple objective in a campaign mission that consists of holding a CP for a few minutes. However, whenevr that objective starts it completes instantly, even though the timelimit section is clearly there. Anyone know what's going wrong/got an example of one of these objectives not from the stock campaign?

Lua section (relevant obj is no 4):
Hidden/Spoiler:
Objective3 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "level.mls.obj.3_popup", popupText = "level.mls.obj.3",
regionName = "gotocrash", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}


Objective3.OnStart = function(self)
MapAddEntityMarker("cp6", "hud_objective_icon", 5.0, ATT, "BLUE", true)
SetProperty("cp6", "Team", 5)


SetProperty("cp1", "Allycount", 0)
SetProperty("cp5", "Allycount", 0)
SetProperty("cp8", "Allycount", 0)
AllowAISpawn(5, true)
AllowAISpawn(3, false)
def_obj3_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
t5_obj3_aigoal = AddAIGoal(5, "Defend", 250, "cp6")

end
Objective3.OnComplete = function(self)
DeleteAIGoal(def_obj3_aigoal)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("cp6")
AICanCaptureCP("cp6", DEF, true)
AICanCaptureCP("cp6", 3, true)
AICanCaptureCP("cp6", 5, true)

end


--defend the cave

Objective4CP = CommandPost:New{name = "cp6"}
Objective4 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "level.mls.obj.4", popupText = "level.mls.obj.4_popup", AIGoalWeight = 0, timeLimit = 120, timeLimitWinningTeam = ATT}--set back to 120
Objective4:AddCommandPost(Objective4CP)

Objective4.OnStart = function(self)
SetProperty("cp6", "Team", 1)
SetProperty("cp6", "Allypath", "cp6_spawn")
SetProperty("camcpb1", "Team", 4)
cp_obj4_aigoal = AddAIGoal(4, "Defend", 200, "cp6")
cp_obj4_aigoal2 = AddAIGoal(DEF, "Defend", 250, "cp6")
end
Objective4.OnComplete = function(self)
SetProperty("cp1", "Allycount", 65536)
SetProperty("cp5", "Allycount", 65536)
SetProperty("cp8", "Allycount", 65536)
AllowAISpawn(3, true)
DeleteAIGoal(cp_obj4_aigoal)
DeleteAIGoal(cp_obj4_aigoal2)
ShowMessageText("game.objectives.complete", ATT)
SetProperty("camcpb1", "Team", DEF)
SetProperty("cp6", "Team", 1)
AICanCaptureCP("cp6", DEF, false)
AICanCaptureCP("cp6", 3, false)
AICanCaptureCP("cp6", 4, false)
AICanCaptureCP("cp6", 5, false)
end

Re: Campaign Conquest Woes

Posted: Mon Aug 02, 2010 5:46 pm
by TK432

Code: Select all

teamATT = ATT, teamDEF = DEF
should be

Code: Select all

teamATT = DEF, teamDEF = ATT
since you're defending the cp and want team DEF to attack it

Re: Campaign Conquest Woes

Posted: Mon Aug 02, 2010 7:51 pm
by Sky_216
TK432 wrote:

Code: Select all

teamATT = ATT, teamDEF = DEF
should be

Code: Select all

teamATT = DEF, teamDEF = ATT
since you're defending the cp and want team DEF to attack it
Ah thanks, didn't undertstand that before.

*topic can be locked*