Changing the default hero (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
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:

Changing the default hero (Solved)

Post by elfie »

Hey guys. I am fairly new to modding and gametoast and I know this must sound like a stupid question, but is there a trick to changing the hero? Everytime i try to change the hero on my map it crashes. I didn't get the exact message from BF2Log but it said something like there was an error with the lua. So if anyone has any experience with changing the hero i would appreciate it tons. Thank you! :D
Grev
Hoth Battle Chief
Hoth Battle Chief
Posts: 3132
Joined: Sun Dec 09, 2007 11:45 pm
Projects :: No Mod project currently.
Games I'm Playing :: Minecraft
Location: A Certain Box Canyon

Re: Changing the default hero

Post by Grev »

In the .lua, you must go to the hero set part, and in team layout with what people you can play as, put the hero there too..
The hero odf name must be put in i think.
User avatar
authraw
1st Lieutenant
1st Lieutenant
Posts: 445
Joined: Mon Jun 26, 2006 3:45 pm

Re: Changing the default hero

Post by authraw »

If you post your lua, we might be able to see where you went wrong. :)
Fingerfood
Sith
Sith
Posts: 1262
Joined: Fri Nov 30, 2007 9:40 pm

Re: Changing the default hero

Post by Fingerfood »

Just on a sidenote, put it in

Code: Select all

[code]Insert .lua here
[/code]tags. And isn't there a topic on this in the Evrything You Need thread?

EDIT:
My bad. It was a Hero/Unit list.
http://www.gametoast.com/forums/viewtop ... =27&t=2780
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: Changing the default hero

Post by elfie »

Grev wrote:In the .lua, you must go to the hero set part, and in team layout with what people you can play as, put the hero there too..
The hero odf name must be put in i think.
Where is the team layout part? is that also in the lua? and where should i put the hero odf?
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Changing the default hero

Post by DarthD.U.C.K. »

if you want to have the emperor as imp hero

Code: Select all

  ReadDataFile("SIDE\\all.lvl",
                    "all_inf_rifleman",
                    "all_inf_rocketeer",
                    "all_inf_sniper",
                    "all_inf_engineer",
                    "all_inf_officer",
                    "all_inf_wookiee",
                    "all_hero_hansolo_tat")
                    
    ReadDataFile("SIDE\\imp.lvl",
                    "imp_inf_rifleman",
                    "imp_inf_rocketeer",
                    "imp_inf_engineer",
                    "imp_inf_sniper",
                    "imp_inf_officer",
                    "imp_inf_dark_trooper",
                    "imp_hero_bobafett",
///add this:    "imp_hero_emperor",
                    "imp_fly_destroyer_dome")

	ReadDataFile("SIDE\\tur.lvl",
						"tur_bldg_tat_barge",	
						"tur_bldg_laser")	
 
/// if you want to load the hero from your own side, add thgese lines:	ReadDataFile("DC:SIDE\\YourSide.lvl",
///						                                                                   "imp_hero_emperor",	
	SetupTeams{
		all = {
			team = ALL,
			units = 20,
			reinforcements = 150,
			soldier	= { "all_inf_rifleman",9, 25},
			assault	= { "all_inf_rocketeer",1,4},
			engineer = { "all_inf_engineer",1,4},
			sniper	= { "all_inf_sniper",1,4},
			officer	= { "all_inf_officer",1,4},
			special	= { "all_inf_wookiee",1,4},

		},
		imp = {
			team = IMP,
			units = 20,
			reinforcements = 150,
			soldier	= { "imp_inf_rifleman",9, 25},
			assault	= { "imp_inf_rocketeer",1,4},
			engineer = { "imp_inf_engineer",1,4},
			sniper	= { "imp_inf_sniper",1,4},
			officer	= { "imp_inf_officer",1,4},
			special	= { "imp_inf_dark_trooper",1,4},
		},
	}
    
    SetHeroClass(ALL, "all_hero_hansolo_tat")
    SetHeroClass(IMP, "imp_hero_bobafett") ///change this line to this: SetHeroClass(IMP, "imp_hero_emperor") 
The_Emperor
Supreme Galactic Ruler
Posts: 2118
Joined: Sat Dec 10, 2005 6:30 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Waaaaay over there.

Re: Changing the default hero

Post by The_Emperor »

Colortags 'n stuff don't work with code tags, here's the fixed stuft.
Hidden/Spoiler:
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"all_hero_hansolo_tat")

ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_bobafett",
"imp_hero_emperor",
"imp_fly_destroyer_dome")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_tat_barge",
"tur_bldg_laser")

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "all_inf_rifleman",9, 25},
assault = { "all_inf_rocketeer",1,4},
engineer = { "all_inf_engineer",1,4},
sniper = { "all_inf_sniper",1,4},
officer = { "all_inf_officer",1,4},
special = { "all_inf_wookiee",1,4},

},
imp = {
team = IMP,
units = 20,
reinforcements = 150,
soldier = { "imp_inf_rifleman",9, 25},
assault = { "imp_inf_rocketeer",1,4},
engineer = { "imp_inf_engineer",1,4},
sniper = { "imp_inf_sniper",1,4},
officer = { "imp_inf_officer",1,4},
special = { "imp_inf_dark_trooper",1,4},
},
}

SetHeroClass(ALL, "all_hero_hansolo_tat")
SetHeroClass(IMP, "imp_hero_emperor")
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: Changing the default hero

Post by elfie »

thanks guys, i'll give it a shot
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: Changing the default hero

Post by elfie »

eureka it works! thanxs soo much for helping me guys!

So please remember to edit your first post and add 'Solved' to the topic title -Staff
Post Reply