TheLadiesOgre
Aspiring Codesmith
- Joined
- Jan 16, 2009
- Messages
- 505
Where the bloody hell do I find how they are defined. I have been all through the sdk by "Find in Files-- MissionAI" and I've found a whole lot of stuff that is very informative, though not what I need right now. What I need to know is how does the AI determine what to do on each MissionAI. Where does it say "if this unit has MISSIONAI_BLAH_BLAH then behave like this". Does it not say this anywhere? If it doesn't, which of the MISSIONAI's correlates to "go over there to so-and-so's city on the other side of the same continent and attack it either until you take it or die" If there isn't one like that can I just plug a new one in like this:
and then plug it into all of the relevant places in my additions? Would I then be able to do something like this following pseudocode:
I know that there is enough combined C++ genius on this forum to get this accomplished right and working beautifully. I know it may be a lot of work and I am willing to do it, if the community if willing to bear with me and my question (and lend suggestions, tips, pointers)
Spoiler :
Code:
enum MissionAITypes // Exposed to Python
{
NO_MISSIONAI = -1,
MISSIONAI_SHADOW,
MISSIONAI_GROUP,
MISSIONAI_LOAD_ASSAULT,
MISSIONAI_LOAD_SETTLER,
MISSIONAI_LOAD_SPECIAL,
MISSIONAI_GUARD_CITY,
MISSIONAI_GUARD_BONUS,
MISSIONAI_GUARD_TRADE_NET,
MISSIONAI_GUARD_SPY,
MISSIONAI_ATTACK_SPY,
MISSIONAI_SPREAD,
MISSIONAI_SPREAD_CORPORATION,
MISSIONAI_CONSTRUCT,
MISSIONAI_HURRY,
MISSIONAI_GREAT_WORK,
MISSIONAI_EXPLORE,
MISSIONAI_BLOCKADE,
MISSIONAI_PILLAGE,
MISSIONAI_FOUND,
MISSIONAI_BUILD,
MISSIONAI_ASSAULT,
MISSIONAI_CARRIER,
//TLO: AI Land Transport Usage Start
MISSIONAI_PICKUP,
MISSIONAI_ASSAULT_LAND
//TLO: AI Land Transport Usage End
};
and then plug it into all of the relevant places in my additions? Would I then be able to do something like this following pseudocode:
Spoiler :
Code:
if (pLoopUnit == (UNITAI_ATTACK || UNITAI_PILLAGE))
{
if (AREAAI != (AREAAI_DEFENSIVE || AREAAI_NEUTRAL))
{
if ((kPlayer.getNUMUnitInfos(UNIT_TRANSPORT_CHOPPER) > 0) && (bLandWar))
{
pLoopUnit->setMissionAI(MISSIONAI_ASSAULT_LAND)
I know that there is enough combined C++ genius on this forum to get this accomplished right and working beautifully. I know it may be a lot of work and I am willing to do it, if the community if willing to bear with me and my question (and lend suggestions, tips, pointers)