Flag_capture_on = OnFlagPickUp(
function(Flag, carrier)
if IsCharacterHuman(carrier) then
--ShowMessageText("level.dea1.objectives.campaign.4_pickup", ATT)
MapAddEntityMarker("cp6", "hud_objective_icon_circle", 4.0, ATT, "YELLOW", true)
ScriptCB_PlayInGameMusic("rep_cor_amb_holocron_return_01")
end
end,
"holocron"
)
Flag_capture_off = OnFlagDrop(
function(Flag, carrier)
if IsCharacterHuman(carrier) then
MapRemoveEntityMarker("cp6")
--ShowMessageText("level.dea1.objectives.campaign.4_drop", ATT)
end
end,
"holocron"
)
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\FlagItem.cpp(945)
Could not build FlagItem
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cor1_item_holocron" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cor1_item_holocron" not found
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: ERROR: flag cor1_item_holocron 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):56>
Although there IS of course a item on my map called "cor1_item_holocron"
I also set up a region and a spawn path as they're named in the objective
In-game the objective shows up but doesn't start
Re: CTF objective in campaign
Posted: Sun Jul 18, 2010 1:54 pm
by Maveritchell
Looks like you didn't add "FlagItem" to your memory pools. See stock campaigns for further detail.
Now the objective works fine, but somehow I have no enemys now
Only error left regarding my objective:
Hidden/Spoiler:
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "flagcapture" not found
updating markers for flag: cor1_item_holocron
no carrier
updating markers for flag: cor1_item_holocron
no carrier
Now the objective works fine, but somehow I have no enemys now
Only error left regarding my objective:
Hidden/Spoiler:
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "flagcapture" not found
updating markers for flag: cor1_item_holocron
no carrier
updating markers for flag: cor1_item_holocron
no carrier
Make sure your region is correctly named in both fields (ID and properties should both be "flagcapture"). You're probably not having any AI spawn because the objective is either failing to set up its goals as the result of not having a region to point to, or because you simply don't have any AI goals to start with. I'd guess the former, but you'll know once you fix that region.
Re: CTF objective in campaign
Posted: Mon Jul 19, 2010 2:48 pm
by TK432
EDIT: found it out, I've set the AI goal up to defend the holocron
thanks for your fast help mav
EDIT
I have one more question regarding this objective
How can I avoid that the flag from spawning from beginning until the objective starts
I've tried with KillObject and RespawnObject but then the flag just spawned at some random position under the surface.
Re: CTF objective in campaign
Posted: Mon Jul 19, 2010 3:03 pm
by Maveritchell
Take a look at how the stock campaigns do it. (Coruscant is a good example.)
Do I have to delete the object in ZE now, since it's being spawned on a spawnpath?
As it is now, it doesn't work
Re: CTF objective in campaign
Posted: Mon Jul 19, 2010 3:30 pm
by Maveritchell
I can't tell what your problem is without seeing it in context. What you want to do is place a flag - of the same class as the one you want to spawn - in ZE. In your script, you can kill that original flag object, then use CreateEntity to create a flag of the same type on a path node.
Remember that CreateEntity uses this format:
CreateEntity(objectclass, GetPathPoint(pathname, pathnode), newobjectname)
Flag_capture_on = OnFlagPickUp(
function(Flag, carrier)
if IsCharacterHuman(carrier) then
--ShowMessageText("level.dea1.objectives.campaign.4_pickup", ATT)
MapAddEntityMarker("turret", "hud_objective_icon_circle", 4.0, ATT, "YELLOW", true)
ScriptCB_PlayInGameMusic("rep_cor_amb_holocron_return_01")
end
end,
"yav_flag_bomb"
)
Flag_capture_off = OnFlagDrop(
function(Flag, carrier)
if IsCharacterHuman(carrier) then
MapRemoveEntityMarker("turret")
--ShowMessageText("level.dea1.objectives.campaign.4_drop", ATT)
end
end,
"yav_flag_bomb"
)
And what doesn't work? Do you have an object placed in your world that uses the .odf "yav_flag_bomb.odf?"
Re: CTF objective in campaign
Posted: Mon Jul 19, 2010 4:12 pm
by TK432
The object is placed in ZE, the problem I have is that the flag is on the map from beginning of the mission (although it should spawn at objective 5)
And if i remove the object the flag doesn't spawn
Re: CTF objective in campaign
Posted: Mon Jul 19, 2010 4:20 pm
by Maveritchell
TK432 wrote:The object is placed in ZE, the problem I have is that the flag is on the map from beginning of the mission (although it should spawn at objective 5)
Are you killing the flag you placed in ZE? The objective behind using CreateEntity is to make a new copy of a flag.