I have added a diplomat unit with a variety of new features. To be supported by the AI, I attempted to add a UNITAI_DIPLOMAT to the SDK. I added it in CvEnums.h, exposed it to python in CyEnumsInterface.cpp, added it to CvGameCoreUtils.cpp, and added this code to CvUnitAI::AI_update() (creating CvUnitAI::AI_diplomatMove() obviously):
When I load my mod, this error appears:
So I have a few questions:
1) Where else do I have to add UNITAI_DIPLOMAT to get it to load? (I did a full project search for UNITAI_MISSIONARY to give myself an idea of where to add code, so I know there are other places where I need to add this--which leads me to my other questions--but I thought I covered everything that would allow the mod to load...
)
2) I found the other UnitAIs appear in CvUnitAI::AI_groupFirstVal(), where each UnitAI returns an integer. Any idea what this function does?
3) Some other functions I found the UnitAIs in were CvPlayerAI::AI_bestTech(), CvPlayerAI::AI_unitValue(), CvTeamAI::AI_getTechMonopolyValue(), CvPlayer::disbandUnit(), and CvPlayerAI::AI_disbandUnit(). How important is it to add a new UNITAI to these functions? If it is necessary, I may need some guidance on what to add.
Thanks in advance!
Code:
case UNITAI_DIPLOMAT:
AI_diplomatMove();
break;
When I load my mod, this error appears:
Assert Failed
File: CvGlobals.cpp
Line: 3493
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: info type UNITAI_DIPLOMAT not found, Current XML file is: xml\Units/CIV4UnitInfos.xml
So I have a few questions:
1) Where else do I have to add UNITAI_DIPLOMAT to get it to load? (I did a full project search for UNITAI_MISSIONARY to give myself an idea of where to add code, so I know there are other places where I need to add this--which leads me to my other questions--but I thought I covered everything that would allow the mod to load...

2) I found the other UnitAIs appear in CvUnitAI::AI_groupFirstVal(), where each UnitAI returns an integer. Any idea what this function does?
3) Some other functions I found the UnitAIs in were CvPlayerAI::AI_bestTech(), CvPlayerAI::AI_unitValue(), CvTeamAI::AI_getTechMonopolyValue(), CvPlayer::disbandUnit(), and CvPlayerAI::AI_disbandUnit(). How important is it to add a new UNITAI to these functions? If it is necessary, I may need some guidance on what to add.
Thanks in advance!