deleting a character

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
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

deleting a character

Post by jedimaster745 »

how do i delete characters from a level? like, deleting classes so i could only play as, lets say for an example, only the sniper and engineer. i suppose it has something to do with the lua, but whatever i change pertaining to the characters doesnt help much. please help me :jango:
Xavious
Sith Master
Sith Master
Posts: 2783
Joined: Mon Jun 12, 2006 3:46 pm

Re: deleting a character

Post by Xavious »

Simply comment out the units you don't want to use.

Like so:

Code: Select all

   ReadDataFile("sound\\yav.lvl;yav1cw")
    ReadDataFile("SIDE\\rep.lvl",
                             --"rep_inf_ep3_rifleman", 
                             --"rep_inf_ep3_rocketeer",
                             "rep_inf_ep3_engineer",
                             "rep_inf_ep3_sniper")
                             --"rep_inf_ep3_officer",
                             --"rep_inf_ep3_jettrooper",
                             --"rep_hover_fightertank",
                             --"rep_hero_anakin",
                            --"rep_hover_barcspeeder")
    ReadDataFile("SIDE\\cis.lvl",
                             --"cis_inf_rifleman",
                             --"cis_inf_rocketeer",
                             "cis_inf_engineer",
                             "cis_inf_sniper")
                             --"cis_inf_officer",
                             --"cis_inf_droideka",
                             --"cis_hero_darthmaul",
                             --"cis_hover_aat")
                             
                             
    ReadDataFile("SIDE\\tur.lvl", 
    			"tur_bldg_laser",
    			"tur_bldg_tower")          
                             
	SetupTeams{
		rep = {
			team = REP,
			units = 20,
			reinforcements = 150,
			--soldier  = { "rep_inf_ep3_rifleman",9, 25}, 
			--assault  = { "rep_inf_ep3_rocketeer",1, 4},
			engineer = { "rep_inf_ep3_engineer",1, 4},
			sniper   = { "rep_inf_ep3_sniper",1, 4},
			--officer = {"rep_inf_ep3_officer",1, 4},
			--special = { "rep_inf_ep3_jettrooper",1, 4},
	        
		},
		cis = {
			team = CIS,
			units = 20,
			reinforcements = 150,
			--soldier  = { "cis_inf_rifleman",9, 25},
			--assault  = { "cis_inf_rocketeer",1, 4},
			engineer = { "cis_inf_engineer",1, 4},
			sniper   = { "cis_inf_sniper",1, 4},
			--officer = {"cis_inf_officer",1, 4},
			--special = { "cis_inf_droideka",1, 4},
		}
	}
^ That will let you play as only snipers and engineers on either side. A double dash (--) comments out a line, meaning the game won't read it. It's better to comment out lines opposed to deleting them, because if you want to go back to how you had it before, all you have to do is remove the "--" in front of the line of code.

EDIT, Ah, whoops. As you might be able to tell, I haven't modded in a while. I fixed the code. :P
Last edited by Xavious on Sat Oct 04, 2008 5:51 pm, edited 2 times in total.
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: deleting a character

Post by [RDH]Zerted »

But you have to be careful what you comment out. The code posted above will give you a munge error. The ReadDataFiles have their ending ) commented out, but it shouldn't be. You have to be watchful for extra or missing commas too.
User avatar
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Re: deleting a character

Post by jedimaster745 »

ok thanks guys, this is exactly what i need :D

EDIT
also, is there a way to rename a class or change how many points are needed to unlock a class(like jet trooper)?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: deleting a character

Post by AQT »

In the rep_inf_default_jettrooper.odf, look for this line:

Code: Select all

PointsToUnlock      = 12
change it to:

Code: Select all

PointsToUnlock      = x
where x is an integer greater than or equal to 0. I suppose it could be negative but who wants that? Same goes for any other unit.
User avatar
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Re: deleting a character

Post by jedimaster745 »

thank you...is there anything after or prior to this change in order for it to work, like copying the folder to my modid folder or adding something to the lua?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: deleting a character

Post by Maveritchell »

If you want to change the unlock properties for a stock class without adding a custom side, add this line in after the setupteams section:

Code: Select all

SetClassProperty("rep_inf_ep3_jettrooper", "PointsToUnlock", 0)
Obviously the name will change depending on the unit you want to remove unlock requirements for.
Post Reply