Page 1 of 1

CTF Flags are not capturable

Posted: Tue Jun 10, 2008 2:36 pm
by elfie
I moved the flags and bases of the flags around in CTF and for some reason the unit cannot pick up the enemy flag. What is wrong?

Re: CTF Flags are not capturable

Posted: Wed Jun 11, 2008 12:59 am
by vampire_lord
Post your LUA and your flag's properties, I think you skipped something...

Re: CTF Flags are not capturable

Posted: Wed Jun 11, 2008 2:00 pm
by Xavious
Did you move the regions for the flag zones as well?

Re: CTF Flags are not capturable

Posted: Wed Jun 11, 2008 6:15 pm
by elfie
I moved the regions, flags and bases. Still no luck. And yes they are all corresponding to the right side. The flags for some reason can not be captured.

Re: CTF Flags are not capturable

Posted: Wed Jun 11, 2008 10:12 pm
by FragMe!
Just a shot in the dark, is this for GCW?
If you look at the LUAs for it you may find that they reference the CIS and REP instead of IMP and ALL as the teams you just have to change all the CIS and REP to IMP and ALL. You would have to change the bits in green.
Hidden/Spoiler:
ScriptCB_DoFile("ObjectiveCTF")

-- Empire Attacking (attacker is always #1)
local ALL = 2
local IMP = 1
-- These variables do not change
local ATT = 1
local DEF = 2

function ScriptPostLoad()

SoundEvent_SetupTeams( ALL, 'all', IMP, 'imp' )

SetProperty("flag1", "GeometryName", "com_icon_republic_flag")
SetProperty("flag1", "CarriedGeometryName", "com_icon_republic_flag_carried")
SetProperty("flag2", "GeometryName", "com_icon_cis_flag")
SetProperty("flag2", "CarriedGeometryName", "com_icon_cis_flag_carried")

--This makes sure the flag is colorized when it has been dropped on the ground
SetClassProperty("com_item_flag", "DroppedColorize", 1)

--This is all the actual ctf objective setup
ctf = ObjectiveCTF:New{teamATT = REP, teamDEF = CIS, captureLimit = 5, textATT = "game.modes.ctf", textDEF = "game.modes.ctf2", hideCPs = true, multiplayerRules = true}
ctf:AddFlag{name = "flag1", homeRegion = "team1_capture", captureRegion = "team2_capture",
capRegionMarker = "hud_objective_icon_circle", capRegionMarkerScale = 3.0,
icon = "", mapIcon = "flag_icon", mapIconScale = 3.0}
ctf:AddFlag{name = "flag2", homeRegion = "team2_capture", captureRegion = "team1_capture",
capRegionMarker = "hud_objective_icon_circle", capRegionMarkerScale = 3.0,
icon = "", mapIcon = "flag_icon", mapIconScale = 3.0}

ctf:Start()

EnableSPHeroRules()

end

Re: CTF Flags are not capturable

Posted: Thu Jun 12, 2008 4:20 pm
by elfie
That doesn't make sense though. They worked before but for some reason when I moved them they can't be captured. I changed the cis and rep to all and imp as you said though and I will let you know if that works now.

Nope, It still doesn't work. :cpu: Didn't crash or anything but didn't work.

Here is the lua if it is important:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveCTF")

-- Empire Attacking (attacker is always #1)
local ALL = 2
local IMP = 1
-- These variables do not change
local ATT = 1
local DEF = 2

function ScriptPostLoad()

SoundEvent_SetupTeams( ALL, 'all', IMP, 'imp' )

SetProperty("flag1", "GeometryName", "com_icon_imperial_flag")
SetProperty("flag1", "CarriedGeometryName", "com_icon_imperial_flag_carried")
SetProperty("flag2", "GeometryName", "com_icon_alliance_flag")
SetProperty("flag2", "CarriedGeometryName", "com_icon_alliance_flag_carried")

--This makes sure the flag is colorized when it has been dropped on the ground
SetClassProperty("com_item_flag", "DroppedColorize", 1)

--This is all the actual ctf objective setup
ctf = ObjectiveCTF:New{teamATT = IMP, teamDEF = ALL, captureLimit = 5, textATT = "game.modes.ctf", textDEF = "game.modes.ctf2", hideCPs = true, multiplayerRules = true}
ctf:AddFlag{name = "flag1", homeRegion = "team1_capture", captureRegion = "team2_capture",
capRegionMarker = "hud_objective_icon_circle", capRegionMarkerScale = 3.0,
icon = "", mapIcon = "flag_icon", mapIconScale = 3.0}
ctf:AddFlag{name = "flag2", homeRegion = "team2_capture", captureRegion = "team1_capture",
capRegionMarker = "hud_objective_icon_circle", capRegionMarkerScale = 3.0,
icon = "", mapIcon = "flag_icon", mapIconScale = 3.0}

ctf:Start()

EnableSPHeroRules()

end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------

function ScriptInit()

ReadDataFile("ingame.lvl")



SetMaxFlyHeight(4000)
SetMaxPlayerFlyHeight(4000)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\kam.lvl;kam1cw")
ReadDataFile("dc:SIDE\\all.lvl",
"all_inf_rifleman_jungle",
"all_inf_rifleman_desert",
"all_inf_rifleman_urban",
"all_inf_engineer",
"all_inf_robot",
"all_inf_robot_assault",
"all_inf_sergeant")


ReadDataFile("dc:SIDE\\all.lvl",
"all_inf_terrorist",
"all_inf_terrorist2",
"all_inf_terrorist3",
"all_inf_terrorist4",
"all_inf_robot",
"all_inf_robot_assault",
"all_inf_terrorist_commander")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_tat_barge",
"tur_bldg_laser")

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "all_inf_rifleman_jungle",9, 25},
assault = { "all_inf_rifleman_desert",1,4},
engineer = { "all_inf_engineer",1,4},
sniper = { "all_inf_rifleman_urban",1,4},
officer = { "all_inf_robot",1,4},
special = { "all_inf_robot_assault",1,4},

},
imp = {
team = IMP,
units = 20,
reinforcements = 150,
soldier = { "all_inf_terrorist",9, 25},
assault = { "all_inf_terrorist2",1,4},
engineer = { "all_inf_terrorist3",1,4},
sniper = { "all_inf_terrorist4",1,4},
officer = { "all_inf_robot",1,4},
special = { "all_inf_robot_assault",1,4},
},
}

SetHeroClass(ALL, "all_inf_sergeant")
SetHeroClass(IMP, "all_inf_terrorist_commander")

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("FlagItem", 2)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:WAR\\WAR.lvl", "WAR_ctf")
SetDenseEnvironment("false")

Re: CTF Flags are not capturable

Posted: Thu Jun 12, 2008 4:30 pm
by Teancum
Did you rename anything, they have to be named the same as the LUA calls:
ctf:AddFlag{name = "flag1", homeRegion = "team1_capture", captureRegion = "team2_capture",
capRegionMarker = "hud_objective_icon_circle", capRegionMarkerScale = 3.0,
icon = "", mapIcon = "flag_icon", mapIconScale = 3.0}
ctf:AddFlag{name = "flag2", homeRegion = "team2_capture", captureRegion = "team1_capture",
capRegionMarker = "hud_objective_icon_circle", capRegionMarkerScale = 3.0,
icon = "", mapIcon = "flag_icon", mapIconScale = 3.0}

Re: CTF Flags are not capturable

Posted: Thu Jun 12, 2008 4:36 pm
by elfie
I have it the same as what you posted tean. Maybe I should try a clean or something? Or I could try running the debug and search for flag or something. Thanks for all this help you are giving me though guys! Even though I haven't solved the problem yet I have learned a lot more about Capture the flag mode.

Re: CTF Flags are not capturable

Posted: Thu Jun 12, 2008 5:38 pm
by Teancum
A manual clean is always a good idea when you're stuck. Don't feel bad though, I still have issues sometimes with CTF.

Re: CTF Flags are not capturable

Posted: Thu Jun 12, 2008 6:55 pm
by [RDH]Zerted
Your custom units are allowed to pick up/carry flags right?

Again, all units (AI and human) can't pickup the flags correct? They run to them and stand on top of it, but can't pick it up? Have you tried trying to pickup your team's flag instead of the enemy's?

There is nothing in the error log?

Re: CTF Flags are not capturable

Posted: Sat Jun 14, 2008 9:54 am
by elfie
[RDH]Zerted wrote:Your custom units are allowed to pick up/carry flags right?

Again, all units (AI and human) can't pickup the flags correct? They run to them and stand on top of it, but can't pick it up? Have you tried trying to pickup your team's flag instead of the enemy's?

There is nothing in the error log?
Yes they are allowed to pick up flags. No they cannot pick up flags. Yes they stand near the flag and run ontop of it but cannot pick it up. I have tried picking up my own flag but it still doesn't work.

I will check my error log.

EDIT

Code: Select all

Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "team1_capture" not found
updating markers for flag:    flag2
no carrier

Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "team2_capture" not found
updating markers for flag:    flag1
no carrier
Here are the errors I got. I don't really understand why the engine cannot find them though. And what does no carrier mean?

Re: CTF Flags are not capturable

Posted: Sat Jun 14, 2008 4:22 pm
by FragMe!
The Entity "team1_capture" not found means it can't find the capture regions for the flags. To confirm they are there go into ZE switch to the CTF layer click on regions you should see the two regions listed there. If not you will have to make them.
If they are there confirm there are named the same as the lua and since you moved the flag home you should also move the capture region to the base as well if you haven't already.