Page 1 of 1

Changing the default hero (Solved)

Posted: Fri Jan 25, 2008 8:32 pm
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

Re: Changing the default hero

Posted: Fri Jan 25, 2008 8:35 pm
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.

Re: Changing the default hero

Posted: Fri Jan 25, 2008 9:18 pm
by authraw
If you post your lua, we might be able to see where you went wrong. :)

Re: Changing the default hero

Posted: Fri Jan 25, 2008 10:07 pm
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

Re: Changing the default hero

Posted: Sat Jan 26, 2008 11:17 am
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?

Re: Changing the default hero

Posted: Sat Jan 26, 2008 11:27 am
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") 

Re: Changing the default hero

Posted: Sat Jan 26, 2008 11:36 am
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")

Re: Changing the default hero

Posted: Sat Jan 26, 2008 11:48 am
by elfie
thanks guys, i'll give it a shot

Re: Changing the default hero

Posted: Sat Jan 26, 2008 11:54 am
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