CTF Flags are not capturable

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
elfie
Field Commander
Field Commander
Posts: 931
Joined: Fri Jan 25, 2008 8:26 pm
Games I'm Playing :: no games
xbox live or psn: no live
Location: Coruscant, Jedi Temple
Contact:

CTF Flags are not capturable

Post 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?
User avatar
vampire_lord
Rebel Sergeant
Rebel Sergeant
Posts: 216
Joined: Thu Mar 20, 2008 7:02 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Mexico City
Contact:

Re: CTF Flags are not capturable

Post by vampire_lord »

Post your LUA and your flag's properties, I think you skipped something...
Xavious
Sith Master
Sith Master
Posts: 2783
Joined: Mon Jun 12, 2006 3:46 pm

Re: CTF Flags are not capturable

Post by Xavious »

Did you move the regions for the flag zones as well?
User avatar
elfie
Field Commander
Field Commander
Posts: 931
Joined: Fri Jan 25, 2008 8:26 pm
Games I'm Playing :: no games
xbox live or psn: no live
Location: Coruscant, Jedi Temple
Contact:

Re: CTF Flags are not capturable

Post 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.
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

Re: CTF Flags are not capturable

Post 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
User avatar
elfie
Field Commander
Field Commander
Posts: 931
Joined: Fri Jan 25, 2008 8:26 pm
Games I'm Playing :: no games
xbox live or psn: no live
Location: Coruscant, Jedi Temple
Contact:

Re: CTF Flags are not capturable

Post 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")
Last edited by elfie on Thu Jun 12, 2008 4:33 pm, edited 1 time in total.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: CTF Flags are not capturable

Post 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}
User avatar
elfie
Field Commander
Field Commander
Posts: 931
Joined: Fri Jan 25, 2008 8:26 pm
Games I'm Playing :: no games
xbox live or psn: no live
Location: Coruscant, Jedi Temple
Contact:

Re: CTF Flags are not capturable

Post 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.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: CTF Flags are not capturable

Post 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.
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: CTF Flags are not capturable

Post 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?
User avatar
elfie
Field Commander
Field Commander
Posts: 931
Joined: Fri Jan 25, 2008 8:26 pm
Games I'm Playing :: no games
xbox live or psn: no live
Location: Coruscant, Jedi Temple
Contact:

Re: CTF Flags are not capturable

Post 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?
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

Re: CTF Flags are not capturable

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