TA:WD
Moderator: Moderators
- GrOuNd_ZeRo
- Posts: 1370
- Joined: 30 Apr 2005, 01:10
Downlaod NTAI and goto the file Agents.cpp and inside the function Factor::Update() there should be great lists of unitnames, the lists take up most fot he file.
They take the form of soemthign like this
if(unitname == name of units chekcing)
if unti hasnt already got a buildqueue
assign these..........
it might have a check to assign the variable energy either a solar generator or a wind generator.
So what you need is what your building with and what you want it to build.
e.g
commander will build this this and that, that will build those those and these, these will build etc........
They take the form of soemthign like this
if(unitname == name of units chekcing)
if unti hasnt already got a buildqueue
assign these..........
it might have a check to assign the variable energy either a solar generator or a wind generator.
So what you need is what your building with and what you want it to build.
e.g
commander will build this this and that, that will build those those and these, these will build etc........
Build lists are defined by a number as so..
Inside the UnitFinished function:
and so on. also if it's a factory uu->repeater = true;
for the commander: in update() I'd add somethign like this
then the big list fo unti names:
In other utnis you could add if statements to change ti around a bit but they would always give the same result when used witht eh commander.
In the above the first tiem buitl would be "CORMEX" and the last buitl "CORADVSOL"
EDIT:: For mex class compatability I need to add a set of unitnames of all the emxes used, one for UW and one for land (that is if UW is used)
Code: Select all
// CORE
#define CCORCOM 1
#define CORCON 2
#define CORNECRO 3
#define CORACK 4
#define CORLAB 5
#define CORALAB 6
#define CORGANT 7
#define CORAP 8
#define CORVP 9
#define CORSY 10
#define CORAVP 11
#define CORASY 12
#define CORCS 13
Code: Select all
string na = "CORCA";
if((ud->name == na)&&(set == false)){
uu->BList = CORCON;
this->builders.push_back(uu);
set = true;
return;
}
na = "CORCK";
if((ud->name == na)&&(set == false)){
uu->BList = CORCON;
this->builders.push_back(uu);
set = true;
return;
}
na = "CORCV";
if((ud->name == na)&&(set == false)){
uu->BList = CORCON;
this->builders.push_back(uu);
set = true;
return;
}
na = "CORNECRO";
if((ud->name == na)&&(set == false)){
uu->BList = CORNECRO;
this->builders.push_back(uu);
set = true;
return;
}
for the commander: in update() I'd add somethign like this
Code: Select all
na = "NATOCOM";
if((uu->ud->name == na)&&(set == false)){
uu->BList = CNATOCOM; // thed efined build list
this->builders.push_back(uu);
G->L->print("NTAI NATO");
race = R_NATO; // a race number defined at the top
set = true;
return;
}
Code: Select all
/* CORE commander */if(uz->BList == CCORCOM){
if(frame == 5){
if(ew == true){
energy = "CORSOLAR";
}else{
energy = "CORWIND";
}
uz->AddTask("CORAP");
uz->AddTask("CORMAKR");
uz->AddTask("CORMAKR");
uz->AddTask("CORMEX");
uz->AddTask("CORMAKR");
uz->AddTask("CORMEX");
uz->AddTask("CORMAKR");
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORSY");
uz->AddTask("CORALAB");
uz->AddTask("CORMEX");
uz->AddTask("CORMAKR");
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMAKR");
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask("CORMEX");
uz->AddTask("CORALAB");
uz->AddTask("CORLLT");
uz->AddTask("CORMAKR");
uz->AddTask("CORMEX");
uz->AddTask("CORMAKR");
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMAKR");
uz->AddTask(energy);
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORRAD");
uz->AddTask("CORMEX");
uz->AddTask("CORMEX");
uz->AddTask("CORLAB");
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMEX");
G->basepos = G->cb->GetUnitPos(uz->uid);
this->UnitIdle(uz->uid);
continue;
}
}
Code: Select all
* CORE con kbot/aircraft */if(uz->BList == CORCON){
if(frame == 150){ // the unti will start building after 150 frames (30 frames per second. If this is set to the first frame ro thsi doesnt exist then the utni will start building before ti's elft the factory.)
uz->AddTask("CORADVSOL");
uz->AddTask("CORMEX");
uz->AddTask("CORAVP");
uz->AddTask("CORMEX");
uz->AddTask("CORALAB");
uz->AddTask("CORADVSOL"); // if this unti doesnt exist an error is logged to the logfile and the task is skipped.
uz->AddTask("CORMEX");
uz->AddTask("CORAP");
uz->AddTask("CORESTOR");
uz->AddTask("CORALAB");
uz->AddTask("CORRAD");
uz->AddTask("CORESTOR");
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask("CORRL");
uz->AddTask(energy);
if((Tframe%3)==1){ 1/3 chance of this.
uz->AddTask("CORMAKR");
uz->AddTask(energy);
uz->AddTask(energy);
if(Tframe<15000){ // build kbot lab if less than this time, toherwise build ana dv kbot lab instead.
uz->AddTask("CORALAB");
uz->AddTask("CORRL");
} else {
uz->AddTask("CORTOAST");
uz->AddTask("CORPUN");
uz->AddTask("CORMEX");
}
uz->AddTask(energy);
}else if((Tframe%3)==2){ 1/3 chance of this
uz->AddTask(energy);
if(Tframe>10000){ // 10,000/30 seconds.
uz->AddTask("CORADVSOL");
uz->AddTask("CORADVSOL");
uz->AddTask("CORMEX");
uz->AddTask("CORALAB");
uz->AddTask("CORTOAST");
uz->AddTask("CORPUN");
}
if(Tframe<10000){
uz->AddTask("CORMEX");
uz->AddTask("CORMEX");
uz->AddTask("CORLAB");
uz->AddTask("CORRL");
}
uz->AddTask("CORRL");
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask("CORADVSOL");
uz->AddTask(energy);
uz->AddTask("CORRL");
}else{
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask("CORMEX");
uz->AddTask("CORHLT");
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask("CORRL");
if((Tframe%2)==1){ // 50% chance of the following beign built
uz->AddTask("CORMEX");
uz->AddTask("CORRL");
uz->AddTask("CORMAKR");
uz->AddTask("CORADVSOL");
uz->AddTask("CORMEX");
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMEX");
}
}
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMEX");
uz->AddTask(energy);
uz->AddTask("CORMEX");
this->UnitIdle(uz->uid);
continue;
}
}
EDIT:: For mex class compatability I need to add a set of unitnames of all the emxes used, one for UW and one for land (that is if UW is used)
- GrOuNd_ZeRo
- Posts: 1370
- Joined: 30 Apr 2005, 01:10
I'll keep the discriptions as simple as possible, I will not add combat units though.
Commanders:
NATOCOM (NATO)
IHCCOM (Mospact) (IHC is an obsolete name for Mospact, Mospact units are either IHC or Mosp)
L0 Factory:
NATOBARR (Barracks, Builds infantry units)
IHCBARR
L0 Resources (commander and engineer)
NATOMINE (MEX, extracts more than an OTA mex but less than a Moho)
IHCMINE
NATOGASP (Gas Powerplant, produces 75 energy)
IHCGASP
NATOCONT (Ore Silo, Stores Metal)
IHCCONT
NATOBATT (Capacitator, Stores Energy)
IHCBATT
L0 Defense (commander and engineer)
NATOPB (Pillbox, armed with Heavy Machinegun, effective against infantry, light vehicles and (slow) aircraft.
IHCPB
NATOATPB (Anti-Tank pillbox, armed with Anti-Tank missiles, not effective against infantry and aircraft)
IHCATPB
GDF-005 (NATO Air Defense, kind of like a light flakker)
ZU-23 (Mospact Air Defense, lighter gun, but fires faster)
NATORAD (Radar unit)
IHCRAD
L0 Construction:
NATOENGI (Engineer, construction infantry)
IHCENGI
L1 Factories:
NATOWFL1 (Vehicle Facotory Level 1)
NATOELBA (Elite Barracks)
IHCWFL1
IHCELBA
L1 Resources
(Same as commander)
L1 Defense
(Same as Com except for some Artillery)
M198 (NATO Artillery, kinda like a Guardian, but less health)
D-20 (Mospact Artillery, is cheaper but less health)
L1 construction:
NATOENVI (engineering vehicle, builds level 2 structures)
IHCENVI
CCH-192 (NATO Construction Helicopter)
KA-152 (Mospact Construction Helicopter)
L2 Factories:
NATOAPL1 (Aircraft Plant Level 1)
IHCAPL1
NATOWFL2 (Vehicle Factory Level 2
IHCWFL2
L2 Resources (build by Engineering vehicle and helicopter)
NATOMFAC (Mining Facillity, extracts more metal, has more armor and is armed with 2 machineguns)
IHCMFAC
NATONUKP (Nuclear Powerplant, produces 900 energy)
IHCNUKP
L2 Defense
JERNAS (NATO Anti-Air Missile turret)
LY-60 (Mospact SAM)
NATOGT (Turret with Tank gun, missiles and auto-cannon)
MOSPGT
NATOGTWR (Guard Tower, large LOS and has a sniper rifle)
MOSPGTWR
NATORADT (L2 Radar Tower)
IHCRADT
Well, I hope this is enough for your AI, if you need other names let me know.
Commanders:
NATOCOM (NATO)
IHCCOM (Mospact) (IHC is an obsolete name for Mospact, Mospact units are either IHC or Mosp)
L0 Factory:
NATOBARR (Barracks, Builds infantry units)
IHCBARR
L0 Resources (commander and engineer)
NATOMINE (MEX, extracts more than an OTA mex but less than a Moho)
IHCMINE
NATOGASP (Gas Powerplant, produces 75 energy)
IHCGASP
NATOCONT (Ore Silo, Stores Metal)
IHCCONT
NATOBATT (Capacitator, Stores Energy)
IHCBATT
L0 Defense (commander and engineer)
NATOPB (Pillbox, armed with Heavy Machinegun, effective against infantry, light vehicles and (slow) aircraft.
IHCPB
NATOATPB (Anti-Tank pillbox, armed with Anti-Tank missiles, not effective against infantry and aircraft)
IHCATPB
GDF-005 (NATO Air Defense, kind of like a light flakker)
ZU-23 (Mospact Air Defense, lighter gun, but fires faster)
NATORAD (Radar unit)
IHCRAD
L0 Construction:
NATOENGI (Engineer, construction infantry)
IHCENGI
L1 Factories:
NATOWFL1 (Vehicle Facotory Level 1)
NATOELBA (Elite Barracks)
IHCWFL1
IHCELBA
L1 Resources
(Same as commander)
L1 Defense
(Same as Com except for some Artillery)
M198 (NATO Artillery, kinda like a Guardian, but less health)
D-20 (Mospact Artillery, is cheaper but less health)
L1 construction:
NATOENVI (engineering vehicle, builds level 2 structures)
IHCENVI
CCH-192 (NATO Construction Helicopter)
KA-152 (Mospact Construction Helicopter)
L2 Factories:
NATOAPL1 (Aircraft Plant Level 1)
IHCAPL1
NATOWFL2 (Vehicle Factory Level 2
IHCWFL2
L2 Resources (build by Engineering vehicle and helicopter)
NATOMFAC (Mining Facillity, extracts more metal, has more armor and is armed with 2 machineguns)
IHCMFAC
NATONUKP (Nuclear Powerplant, produces 900 energy)
IHCNUKP
L2 Defense
JERNAS (NATO Anti-Air Missile turret)
LY-60 (Mospact SAM)
NATOGT (Turret with Tank gun, missiles and auto-cannon)
MOSPGT
NATOGTWR (Guard Tower, large LOS and has a sniper rifle)
MOSPGTWR
NATORADT (L2 Radar Tower)
IHCRADT
Well, I hope this is enough for your AI, if you need other names let me know.
- GrOuNd_ZeRo
- Posts: 1370
- Joined: 30 Apr 2005, 01:10
Whichever, you can just enter the commander, but if you do that then onyl the commander will build anything, all the factories it builds will just stand still and do nothing. So you need a similair entry for construction units, and for factories.
Anythign that builds needs a buildtree otherwise it'll do one of the following when it's built:
guard stuff
resurrect stuff
reclaim stuff.
Anythign that builds needs a buildtree otherwise it'll do one of the following when it's built:
guard stuff
resurrect stuff
reclaim stuff.
XTA-TA=X? X v0.66 SE, that doesn't sounds like anything.Masse wrote:that naming thing reminds me of this other naming problem...
--------------------------------------------------------------------------
to all mod makers
please all mod makers...
TAKE THE F*KING TA OUT OF THE NAMES OF THE MODS !!111!!
But I agree, the mods arn't for TA anymore but for Spring. So they should be named to that.