Unable To Pick Up CTF Flag [Solved]

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
GAB
1st Lieutenant
1st Lieutenant
Posts: 431
Joined: Sun Jul 03, 2011 8:56 pm
Location: Somewhere around the world
Contact:

Unable To Pick Up CTF Flag [Solved]

Post by GAB »

I recently replaced 1-flag CTF with 2-flag CTF in my map, but I cannot pick up one of the flags. The other one works just fine, it is possible to pick it up and to score points with it, but the other one simply does not work. It only stays bouncing on its location.

I've already looked on every thread I could find about the issue here on GT, but none of them helped.

Here's the section that covers the CTF logic in my lua:
Hidden/Spoiler:
SoundEvent_SetupTeams( REP, 'rep', CIS, 'cis' )

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")

SetClassProperty("com_item_flag", "DroppedColorize", 1)

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()
I also get the following error on my DebugLog:
Hidden/Spoiler:
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "team1_capture" not found

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "team2_capture" not found
This one is also very contradictory since it is possible to score points with one of the flags.
Last edited by GAB on Sun Aug 24, 2014 8:51 pm, edited 2 times in total.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Unable To Pick up CTF Flag

Post by Marth8880 »

Did you set each region's class properties to its name?
User avatar
GAB
1st Lieutenant
1st Lieutenant
Posts: 431
Joined: Sun Jul 03, 2011 8:56 pm
Location: Somewhere around the world
Contact:

Re: Unable To Pick up CTF Flag

Post by GAB »

Yes. And I just found out the problem.

For some very stupid reason, when the flag is on an object, it keeps bouncing and cannot be picked, however, when it is on terrain it is possible to pick it up and score points as usual.
So, the issue now becomes how to fix this bug?
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Unable To Pick up CTF Flag

Post by Marth8880 »

LOL, that's pretty strange. The flag ODFs haven't been altered, correct? :o

Couple things you could try:
- Place the flag prop slightly lower in ZE.
- Set the ODFs' Rebound value to 0.0 and Friction to something high like 10.0.
User avatar
GAB
1st Lieutenant
1st Lieutenant
Posts: 431
Joined: Sun Jul 03, 2011 8:56 pm
Location: Somewhere around the world
Contact:

Re: Unable To Pick up CTF Flag

Post by GAB »

The object I'm using is probably the same object used for every flag in the game (com_item_flag), and yes, I didn't modify a byte of it.

What I find weird is that maps like Coruscant and Mygeeto also have flags sitting on objects instead of terrain and they work fine. I opened their luas and didn't find any special function that could be related to this.

Another weird thing is that, when it was 1-flag instead of 2-flag CTF, the only flag that was on the map was over an object and worked just fine.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Unable To Pick up CTF Flag

Post by Marth8880 »

Yeah, definitely know what you mean. Freakin' Pandemic...

Did you try what I suggested? :o
User avatar
GAB
1st Lieutenant
1st Lieutenant
Posts: 431
Joined: Sun Jul 03, 2011 8:56 pm
Location: Somewhere around the world
Contact:

Re: Unable To Pick up CTF Flag

Post by GAB »

I did and it worked! :runaway: Well, I did lower the flag object in ZE slightly and did remove the following lines from my .wld file:

Code: Select all

TerrainName("KTH.TER")
LightName("KTH.LGT");
SkyName("KTH.SKY");
Just for clarification, the deal with these lines has to do with the random skies stuff. I actually keep adding and removing them all the time. It is so that the random weather/time of day lighting, terrain and sky can load properly.

When I was trying to fix this flag bug I wasn't removing them for the sake of agility (otherwise I'd have to remove them before munging and have to re-add the terrain one if I wanted to open the map in ZE [Zero Editor can't load a world properly without a terrain], and when I save hte world, ZE automatically re-adds the sky and light lines and then I'd have to remove them all again and so on). On my last test, I did actually remove them along with lowering the flag object in ZE. I actually don't know which action made the flag work (probably the lowering one to be honest).

Anyway, long story short, 2-Flag CTF works properly now.

EDIT

Fun fact: the Entity "team1_capture"/"team2_capture" not found error are still there, even though the mode works normally.
Post Reply