Need Help with CTF Objective

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
KnightsFan
Second Lance Corporal
Second Lance Corporal
Posts: 108
Joined: Fri Mar 06, 2009 9:34 pm

Need Help with CTF Objective

Post 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
User avatar
KnightsFan
Second Lance Corporal
Second Lance Corporal
Posts: 108
Joined: Fri Mar 06, 2009 9:34 pm

Re: Need Help with CTF Objective

Post by KnightsFan »

Anyone? I kinda need to know why this isn't working... or whether anything at all is right...
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Need Help with CTF Objective

Post 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.
User avatar
KnightsFan
Second Lance Corporal
Second Lance Corporal
Posts: 108
Joined: Fri Mar 06, 2009 9:34 pm

Re: Need Help with CTF Objective

Post 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.
Post Reply