Preventing the AI from spawning as certain classes?
Moderator: Moderators
Preventing the AI from spawning as certain classes?
Hello again.
With the release of the Modding Tools, I've been happily poking away at the ODFs.
However, I was wondering if there was a way to stop the AI from spawning as a specific class? I looked around at some of the ODFs and couldn't see anything...
Thanks.
With the release of the Modding Tools, I've been happily poking away at the ODFs.
However, I was wondering if there was a way to stop the AI from spawning as a specific class? I looked around at some of the ODFs and couldn't see anything...
Thanks.
RE: Preventing the AI from spawning as certain classes?
Go to the mission script file of the map where you want to change the spawn numbers. They're in C:\BF2_ModTools\data_ModID\Common\scripts\ModID, in any of the .lua files (open in notepad). Scroll down until you see: (or the equivalent if you are playing under galactic civil war) and change the numbers following the class you don't want the bots to spawn as to 0, 0. So, for example, if you didn't want to bots to spawn as the wampa in the example above, you would change that part to read: That will set the min, max number of bots that will spawn as this character class to 0.
Code: Select all
SetupTeams{
rep = {
team = REP,
units = 32,
reinforcements = 150,
soldier = { "snw_inf_wampa", 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 = 10,
reinforcements = -1,
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},
Code: Select all
SetupTeams{
rep = {
team = REP,
units = 32,
reinforcements = 150,
soldier = { "snw_inf_wampa", 0, 0},
...................
RE: Preventing the AI from spawning as certain classes?
We could do that with BF1 too... it's nothing new.
Er, how exactly can you put all the heroes on one map but so the AI cannot play as them??
Also, on a similar vein: when deciding which heroes to put on a map, how do you know what the names are... for instance, darth maul is:
SetHeroClass(CIS, "cis_hero_darthmaul")
What would say, dooku or yoda be?? WOuld it be Countdooku or just dooku.
I hope its clear what I'm saying
Oh also, is it possible to edit existing levels in this way:
eg. Geonosis??
Also, on a similar vein: when deciding which heroes to put on a map, how do you know what the names are... for instance, darth maul is:
SetHeroClass(CIS, "cis_hero_darthmaul")
What would say, dooku or yoda be?? WOuld it be Countdooku or just dooku.
I hope its clear what I'm saying
Oh also, is it possible to edit existing levels in this way:
eg. Geonosis??
Re: RE: Preventing the AI from spawning as certain classes?
Not a very exciting example, but on my Hoth Snow Patrol map the AI wasn't allowed to spawn as rocket troopers. They were only available to the player.Super_Shadowman wrote:Hmm? I never noticed that. Give me an example of a map where it was used.
RE: Re: RE: Preventing the AI from spawning as certain class
@ merlin: Go to your mission script files in C:\BF2_ModTools\data_ModID\Common\scripts\ModID. Take one of the .lua files in the folder, and open it up. Scroll down till you see something like:
And replace those two sections with:
This is from a section from the Mos Eisley Assault mission script. It tells the game to load each of those character classes when it opens the map. Then scroll down (in the same file) until you see:
and replace this section with:
This section tells the game when making the sides, those characters go on those sides (villains/heroes or whatever you want to name them). That segment is also from the Mos Eisley Assault script. If you want to prevent the bots from spawning as any of the characters, simply change the numbers after each character (ie. (IMP, "rep_hero_anakin",[bold]1,2[/bold])) to "0,0" which will set the minimum and maximum number of bots who will spawn as those characters. As for finding out the names of all the heroes in game, they're all right there in the code above So Count Dooku is "cis_hero_countdooku" and Yoda is "rep_hero_yoda."
As for getting the characters in the normal game maps, I'm not sure. It can probably be done, but I don't know how :\
Code: Select all
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"........"
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"........"
Code: Select all
ReadDataFile("SIDE\\all.lvl",
"all_hero_luke_jedi",
"all_hero_hansolo_tat",
"all_hero_leia",
"all_hero_chewbacca")
ReadDataFile("SIDE\\imp.lvl",
"imp_hero_darthvader",
"imp_hero_emperor",
"imp_hero_bobafett")
ReadDataFile("SIDE\\rep.lvl",
"rep_hero_yoda",
"rep_hero_macewindu",
"rep_hero_anakin",
"rep_hero_aalya",
"rep_hero_kiyadimundi",
"rep_hero_obiwan")
ReadDataFile("SIDE\\cis.lvl",
"cis_hero_grievous",
"cis_hero_darthmaul",
"cis_hero_countdooku",
"cis_hero_jangofett")
Code: Select all
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},
}
}
and replace this section with:
Code: Select all
SetupTeams{
hero = {
team = ALL,
units = 32,
reinforcements = -1,
soldier = { "all_hero_hansolo_tat",1,2},
assault = { "all_hero_chewbacca", 1,2},
engineer= { "all_hero_luke_jedi", 1,2},
sniper = { "rep_hero_obiwan", 1,2},
officer = { "rep_hero_yoda", 1,2},
special = { "rep_hero_macewindu", 1,2},
},
}
AddUnitClass(ALL,"all_hero_leia", 1,2)
AddUnitClass(ALL,"rep_hero_aalya", 1,2)
AddUnitClass(ALL,"rep_hero_kiyadimundi",1,2)
SetupTeams{
villain = {
team = IMP,
units = 32,
reinforcements = -1,
soldier = { "imp_hero_bobafett", 1,2},
assault = { "imp_hero_darthvader",1,2},
engineer= { "cis_hero_darthmaul", 1,2},
sniper = { "cis_hero_jangofett", 1,2},
officer = { "cis_hero_grievous", 1,2},
special = { "imp_hero_emperor", 1,2},
},
}
AddUnitClass(IMP, "rep_hero_anakin",1,2)
AddUnitClass(IMP, "cis_hero_countdooku",1,2)
As for getting the characters in the normal game maps, I'm not sure. It can probably be done, but I don't know how :\
@ Merlin: When adding character classes not originally on the side you're spawning them as (ie, CIS heroes to the Republic Side) , you have to add them to the .req files in C:\BF2_ModTools\data_ModID\Sides\SideName. The names would be "SideName.req" and "SideNameShell.req." So simply add your character names/classes to the lists of characters already in there.