CTF objective help

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
Oceans14
Command Sergeant Major
Command Sergeant Major
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2
Location: Planet 4546b

CTF objective help

Post by Oceans14 »

Hi guys, I set up a simple ctf objective just like the ones in the campaign missions (I used parts of the geo script in fact) but when I run the level there's no flag, and I get the error

Code: Select all

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: ERROR: flag radio_flag does not exist in the map
stack traceback:
	[C]: in function `assert'
	(none): in function `Start'
	(none): in function `ActivateObjectiveSet'
	(none): in function `Start'
	(none): in function `StartObjectives'
	(none): in function <(none):46>
It's worth noting that the objective does at least partially work, because I get the pop-up text for it. Here's the relevant code:
Hidden/Spoiler:
[code]-----Objective 1: Bring radio to the cliff top-----

Objective1 = ObjectiveCTF:New{teamATT = ATT, teamDEF = DEF, captureLimit = 1, text = "level.ani.objectives.1_short", popupText = "level.ani.objectives.1_long", AIGoalWeight = 0}

Objective1:AddFlag{name = "radio_flag", homeRegion = "", captureRegion = "radio_flag_drop",
capRegionMarker = "hud_objective_icon", capRegionMarkerScale = 3.0,
mapIcon = "flag_icon", mapIconScale = 2.0}

Objective1.OnStart = function(self)

plans_capture_on = OnFlagPickUp(
function(flag, carrier)
if IsCharacterHuman(carrier) then
MapAddEntityMarker("radio_flag_drop_point", "hud_objective_icon", 4.0, ATT, "YELLOW", true)
end
end,
"radio_flag"
)

plans_capture_off = OnFlagDrop(
function(flag, carrier)
if IsCharacterHuman(carrier) then
MapRemoveEntityMarker("radio_flag_drop_point")
end
end,
"radio_flag"
)

end

Objective1.OnComplete = function (self)
ShowMessageText("game.objectives.complete", ATT)
--RespawnObject("c_cp7")

ReleaseFlagPickUp(plans_capture_on)
ReleaseFlagDrop(plans_capture_off)
MapRemoveEntityMarker("radio_flag_drop_point")

end
[/code]
The flag object is in my campaign layer which is otherwise being read correctly... so I'm a little lost here.
Post Reply