Page 1 of 1

deleting a character

Posted: Sat Oct 04, 2008 9:54 am
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:

Re: deleting a character

Posted: Sat Oct 04, 2008 11:12 am
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

Re: deleting a character

Posted: Sat Oct 04, 2008 11:20 am
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.

Re: deleting a character

Posted: Sat Oct 04, 2008 11:32 am
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)?

Re: deleting a character

Posted: Sat Oct 04, 2008 12:28 pm
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.

Re: deleting a character

Posted: Sat Oct 04, 2008 4:29 pm
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?

Re: deleting a character

Posted: Sat Oct 04, 2008 5:48 pm
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.