CTF (1 and 2 flag) tutorial -- part 1 (FAQ)

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
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 (1 and 2 flag) tutorial -- part 1

Post by Teancum »

Common to both modes:
1-Open ZeroEdit, load your map
2-Hit 'change' under layers
3-Add a new layer. Name it ctf_common
*NOTE* region sizes should be 2,5,1 (at the bottom left change 10,10,10 to this)
4-Select regions, add a new regtion called team1_capture - name the property the same way. This goes wherever your Team 1 CP will be.
5-Add another region called team2_capture - again name the property the same way. This goes wherever your Team 2 CP will be.
6-Add a third region called homeregion - name the property the same way. This goes wherever your flag for 1-Flag CTF will be.
7-Before anything else, make sure they are named exactly as said before, or CTF won't work
8-Place ctf_spawn1 and ctf_spawn2 paths on this layer. It doesn't matter what you name these, they just need to be put in your SpawnPath section of your CP properties later.
9-Place your CP's -- you only need two -- one for each team. Add your spawn paths to them.

1-Flag specific:
1-Create a new layer, name it 1flag.
2-Add a flag where the homeregion is, make sure you seat the team value to zero.

2-Flag specific:
1-Creat a new layer, name it ctf or 2flag.
2-Place a flag near your CPs, assign it to that team's number.



Still to do in the tutorial:
-Add the objects that show where your flag should be captured (they create a glow and they pulsate). These aren't hard, I just can't remember the name of the file to add.
-Teach integrating these into actual modes
-Make sure I have the order of 1-Flag right as to where you actually capture the flag.
Gunjak

RE: CTF (1 and 2 flag) tutorial -- part 1

Post by Gunjak »

i know but i didnt know that until not long ago and now there stuck there, but i want ctf in my geo lvl
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 (1 and 2 flag) tutorial -- part 1

Post by Teancum »

Not much you can do. You can merge the base layer and Conqest, then create a new conquest layer and move all of that stuff back, but other than that....
TAW_pinx

RE: CTF (1 and 2 flag) tutorial -- part 1

Post by TAW_pinx »

Tean or someone from Pandemic, would you be able to tell me exactly which files need to be modified if I DID NOT check the boxes for all modes during initial munge?

I'm having issues trying to add the new game modes, as they are there in Zeroeditor and complete, but they don't seem to munge properly ATM. I've already edited mission.req to include them, as well as add the new LUA's and REQ's for each game mode. Possibly there is another step?
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 (1 and 2 flag) tutorial -- part 1

Post by Teancum »

What exactly isn't working? No Spawn points? A crash?
TAW_pinx

RE: CTF (1 and 2 flag) tutorial -- part 1

Post by TAW_pinx »

The game modes do not come up in SWBF II as an option...that's basically all that I think is wrong ATM.
xwingguy

RE: CTF (1 and 2 flag) tutorial -- part 1

Post by xwingguy »

Does anyone know if there is a way in space ctf to allow the flag to be carried out of a vehicle without spazzing out like it usually does?
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 (1 and 2 flag) tutorial -- part 1

Post by [RDH]Zerted »

I think the message is generated in the ObjectiveCTF.lua file. Look for the following section:
--
-- message generator
--

I can't run the game at the moment, so I can't narrow it done any more. If you can't understand the code, comment out all the ShowMessageText line. To comment out a line, place '--' in front of in without the '. If the message goes away, remove the comments ( -- ) one at a time to see which code line puts it back in the game. This will disable that message.
User avatar
squipple
1st Lieutenant
1st Lieutenant
Posts: 420
Joined: Tue Jun 28, 2005 7:38 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

RE: CTF (1 and 2 flag) tutorial -- part 1

Post by squipple »

Gunjak, this is a little late, but if you add things to layers they're not supped to be in, you can just select them, open up your layers box, and click move data into layer, and then select the layer you want to move it to.
Jaspo
Command Sergeant Major
Command Sergeant Major
Posts: 282
Joined: Sun Mar 01, 2009 4:34 am
Projects :: AotC DoW+++Boonta Eve Classic
Games I'm Playing :: WoT MBWBVC Robocraft
xbox live or psn: No gamertag set
Contact:

Re: CTF (1 and 2 flag) tutorial -- part 1 (FAQ)

Post by Jaspo »

I know I saw on here somewhere that someone was wondering how to change how many units stand around guarding the flag (in 2 flag ctf)...and I found out how just recently but I can't find the post back, so I'll just put it here:

go into data_***/common/scripts and open gametype_capture and ObjectiveCTF.

Each of these LUA files will have a section containing the numbers 70 and 30. In gametype_capture it's
-- set AI goal
ClearAIGoals(self.team)
AddAIGoal(self.team, "CTFOffense", 70, GetRegionName(self.capture))
AddAIGoal(self.team, "CTFDefense", 30)
and in ObjectiveCTF its
--Add AI Goals
if self.AIGoalWeight > 0.0 then
table.insert(self.AIGoals, AddAIGoal(GetOpposingTeam( flagTeam ), "CTFOffense", 70*self.AIGoalWeight, flag.captureRegion, flagPtr))
if flag.homeRegion then
table.insert(self.AIGoals, AddAIGoal(flagTeam, "CTFDefense", 30*self.AIGoalWeight, flagPtr))
else
--if a flag has no home region, we can't put it in traditional CTFDefense mode, but we can put
--it in generic "Defend this object" mode, so they'll put up a parameter around the flag
--and shoot anyone who gets near
table.insert(self.AIGoals, AddAIGoal(flagTeam, "Defend", 30*self.AIGoalWeight, flag.name))
end
These numbers apparently serve as percentage values, for how many stay and how many go. So if you want fewer AI guarding the flags, just increase the offense number (e.g., to 90) and decrease the defense number accordingly (e.g., to 10).
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: CTF (1 and 2 flag) tutorial -- part 1 (FAQ)

Post by Maveritchell »

Jaspo wrote:
Hidden/Spoiler:
I know I saw on here somewhere that someone was wondering how to change how many units stand around guarding the flag (in 2 flag ctf)...and I found out how just recently but I can't find the post back, so I'll just put it here:

go into data_***/common/scripts and open gametype_capture and ObjectiveCTF.

Each of these LUA files will have a section containing the numbers 70 and 30. In gametype_capture it's

[quote] -- set AI goal
ClearAIGoals(self.team)
AddAIGoal(self.team, "CTFOffense", 70, GetRegionName(self.capture))
AddAIGoal(self.team, "CTFDefense", 30)
and in ObjectiveCTF its
--Add AI Goals
if self.AIGoalWeight > 0.0 then
table.insert(self.AIGoals, AddAIGoal(GetOpposingTeam( flagTeam ), "CTFOffense", 70*self.AIGoalWeight, flag.captureRegion, flagPtr))
if flag.homeRegion then
table.insert(self.AIGoals, AddAIGoal(flagTeam, "CTFDefense", 30*self.AIGoalWeight, flagPtr))
else
--if a flag has no home region, we can't put it in traditional CTFDefense mode, but we can put
--it in generic "Defend this object" mode, so they'll put up a parameter around the flag
--and shoot anyone who gets near
table.insert(self.AIGoals, AddAIGoal(flagTeam, "Defend", 30*self.AIGoalWeight, flag.name))
end
These numbers apparently serve as percentage values, for how many stay and how many go. So if you want fewer AI guarding the flags, just increase the offense number (e.g., to 90) and decrease the defense number accordingly (e.g., to 10).[/hide][/quote]
It's worth mentioning that this is covered in greater detail (and not just as it pertains to CTF) in psych0fred's AI Goals document:
http://www.secretsociety.com/forum/down ... IGoals.txt
Post Reply