Page 1 of 1

Need Help with CTF Objective

Posted: Mon Mar 16, 2009 9:40 am
by KnightsFan
I'm just wondering how to make a CTF objective in campaign. If someone could point out my error it'd be great. When it gets to the objective the flag never appears.

The flag is called flag
I also have the ScriptCB_DoFile("ObjectiveCTF")
and objectiveSequence:AddObjectiveSet(Objective8) in the right places
The section of the LUA:
Hidden/Spoiler:
Objective8 = ObjectiveCTF:New{teamATT = ATT, teamDEF = DEF, captureLimit = 1, text = "level.GA3.objectives.campaign.8", AIGoalWeight = 0}
Objective8:AddFlag{name = "flag", homeRegion = "", captureRegion = "cp1_capture", capRegionMarker = "hud_objective_icon", capRegionMarkerScale = 3.0, mapIcon = "flag_icon", mapIconScale = 2.0}

Objective8.OnStart = function(self)
SetProperty("flag", "GeometryName", "com_icon_republic_flag")
SetProperty("flag", "CarriedGeometryName", "com_icon_republic_flag_carried")
flag_capture_on = OnFlagPickUp(
function(flag, carrier)
if IsCharacterHuman(carrier) then
MapAddEntityMarker("cp1", "hud_objective_icon", 4.0, ATT, "YELLOW", true)
end
end,
"flag"
)
flag_capture_off = OnFlagDrop(
function(flag, carrier)
if IsCharacterHuman(carrier) then
MapRemoveEntityMarker("cp1")
end
end,
"flag"
)
end

Objective8.OnComplete = function (self)
ShowMessageText("game.objectives.complete", ATT)
ReleaseFlagPickUp(flag_capture_on)
ReleaseFlagDrop(flag_capture_off)
MapRemoveEntityMarker("cp1")
end

Re: Need Help with CTF Objective

Posted: Wed Apr 15, 2009 12:22 pm
by KnightsFan
Anyone? I kinda need to know why this isn't working... or whether anything at all is right...

Re: Need Help with CTF Objective

Posted: Wed Apr 15, 2009 5:22 pm
by [RDH]Zerted
Did you place the flag in ZeroEdit? Are there any errors in your debug log? If you don't know what that is, the modding FAQ will tell you how to get it.

Re: Need Help with CTF Objective

Posted: Wed Apr 15, 2009 6:23 pm
by KnightsFan
Well I think that's where my error is. I placed my flag but it never shows up at all, not even in ZeroEdit. In the BF2 log it said it couldn't find my flag.