翔鹰帝国网|帝国时代论坛|帝国时代系列|神话时代
 找回密码
 注册翔鹰会员(昵称)
搜索
楼主: mozonglin7

Utt AI修改版,更换AI卡片组全带出兵加速卡!可联机

  [复制链接]

0

主题

0

精华

0

积分

扈从

耕战
0
鹰币
10
天龙币
0
回帖
4
附庸关系0
发表于 2017-2-13 08:56:55 | 显示全部楼层
感谢大神
回复

使用道具 举报

0

主题

0

精华

0

积分

扈从

耕战
0
鹰币
10
天龙币
0
回帖
1
附庸关系0
发表于 2017-2-16 00:19:03 | 显示全部楼层
楼主,utt ai疯狂进攻的,卡片组有更换么‘’
回复

使用道具 举报

8

主题

3

精华

4210

积分

公爵

耕战
512
鹰币
404
天龙币
0
回帖
32
附庸关系0
 楼主| 发表于 2017-2-27 22:19:15 | 显示全部楼层
youninajiuhao 发表于 2017-2-16 00:19
楼主,utt ai疯狂进攻的,卡片组有更换么‘’

都换了
回复

使用道具 举报

3

主题

0

精华

48

积分

骑士

耕战
0
鹰币
10
天龙币
0
回帖
21
附庸关系0
发表于 2017-3-15 12:40:08 | 显示全部楼层
楼主这个ai很强,但是有时候电脑不进攻,要不只造一波兵,死玩就再也不造了,然后就不发展了。特别是土耳其和美洲三国动不动就不发展了。希望楼主能改改电脑有时候不发展的毛病!
回复

使用道具 举报

0

主题

0

精华

99

积分

骑士

耕战
10
鹰币
60
天龙币
0
回帖
46
附庸关系0
发表于 2017-3-22 23:22:05 本帖来自手机 | 显示全部楼层
下载了这个UTT卡组更换版,发现法国电脑没有带步兵,骑兵,炮兵军事加速卡
回复

使用道具 举报

8

主题

3

精华

4210

积分

公爵

耕战
512
鹰币
404
天龙币
0
回帖
32
附庸关系0
 楼主| 发表于 2017-3-23 13:25:58 | 显示全部楼层
本帖最后由 mozonglin7 于 2017-3-23 14:04 编辑
mygirl921 发表于 2017-3-22 23:22
下载了这个UTT卡组更换版,发现法国电脑没有带步兵,骑兵,炮兵军事加速卡

请按照说明安装AI
游戏目录下AI3文件夹删除(注意是删除,不然跟原来的AI文件混一起会没效果的),把这个解压后的AI3文件夹复制粘贴进去就可以了。


电脑小白的请往下看:
首先我的文档My Games/Age of Empires 3/AI3 文件夹里装的只是AI每局游戏的缓存文件,如果你把加强AI的文件丢这个位置的,全都无效。。。

打个比方吧,比如你的游戏安装在D盘甲文件夹,那这个D盘甲文件夹就是你游戏目录

然后你每次在游戏里的存档记录截图主城等,会自动缓存在C盘我的文档乙文件夹,一般乙文件夹里的文件名很多会和游戏目录里的相同,但用处是不一样的。

所以对应不同的修改加强内容,也是放在不同的地方,具体请看安装说明。

如果还是不会查找游戏目录的,请自行百度吧,我只能帮你到这了。
回复

使用道具 举报

3

主题

0

精华

48

积分

骑士

耕战
0
鹰币
10
天龙币
0
回帖
21
附庸关系0
发表于 2017-3-23 15:24:05 | 显示全部楼层
mozonglin7 发表于 2017-3-23 13:25
请按照说明安装AI
把游戏目录下AI3文件夹删除(注意是删除,不然跟原来的AI文件混一起会没效果的),把 ...

疯狂进攻 那个   土耳其不发展, 楼主希望改善下土耳其的ai
回复

使用道具 举报

8

主题

3

精华

4210

积分

公爵

耕战
512
鹰币
404
天龙币
0
回帖
32
附庸关系0
 楼主| 发表于 2017-3-23 16:04:07 | 显示全部楼层
本帖最后由 mozonglin7 于 2017-3-23 16:05 编辑
bbstar303 发表于 2017-3-23 15:24
疯狂进攻 那个   土耳其不发展, 楼主希望改善下土耳其的ai

没发现你说的问题,我这测试土耳其是正常发展的。请按照说明安装AI,别把加强AI文件丢到我的文档里
回复

使用道具 举报

3

主题

0

精华

48

积分

骑士

耕战
0
鹰币
10
天龙币
0
回帖
21
附庸关系0
发表于 2017-3-23 17:13:06 | 显示全部楼层
mozonglin7 发表于 2017-3-23 16:04
没发现你说的问题,我这测试土耳其是正常发展的。请按照说明安装AI,别把加强AI文件丢到我的文档里

电脑土耳其只造农民只发展经济 ,但是不发展军事 不进攻 ,只造一波兵死完了以后就再也不造兵了。
回复

使用道具 举报

0

主题

0

精华

5

积分

扈从

耕战
0
鹰币
10
天龙币
0
回帖
6
附庸关系0
发表于 2017-3-23 19:44:49 | 显示全部楼层
楼主能否在拿破伦时代的基础上修改下AI,这是拿破仑时代2.17b的链接https://www.moddb.com/mods/napoleonic-era/downloads/ne-217b-for-pc
回复

使用道具 举报

11

主题

0

精华

-259

积分

流徒

耕战
-60
鹰币
85
天龙币
0
回帖
62

翔鹰建站十周年纪念章

附庸关系0
发表于 2017-7-19 17:55:31 本帖来自手机 | 显示全部楼层
我想找会城镇中心全被打掉后自动重建的AI 一直找不到 试了楼主的ai也不行 怎么办?
回复

使用道具 举报

0

主题

0

精华

99

积分

骑士

耕战
10
鹰币
60
天龙币
0
回帖
46
附庸关系0
发表于 2017-9-27 19:21:03 本帖来自手机 | 显示全部楼层
woailplz 发表于 2017-1-3 18:36
我想知道这个版本的AI会自己拉墙吗?

不管什么版本的AI都可以拉墙。UTT,蜗牛,雷光,天明,这4种目前主要AI都可以自己修改让电脑拉墙。你想让AI拉墙其实很简单,修改限制AI拉墙的条件。在你的帝国3安装目录下找到AI3文件(注意是你帝国3目录下,不是文档那里的AI3),找到Main.xs文件,用记事本打开,搜索查找decided   to   do   walls,把前面的//删除就是允许电脑拉墙了。为了能保证电脑在墙破坏后自动修复墙,你还需要在rule  delaywalls(造墙)和rule  fillInwallGaps(修复墙规则)里面把这两项的数值修改成相同的。
回复

使用道具 举报

0

主题

0

精华

29

积分

骑士

耕战
0
鹰币
10
天龙币
0
回帖
99
附庸关系0
发表于 2017-10-7 13:49:56 本帖来自手机 | 显示全部楼层
做的不错,滋瓷~
回复

使用道具 举报

1

主题

0

精华

13

积分

骑士

耕战
0
鹰币
10
天龙币
0
回帖
9
附庸关系0
发表于 2017-12-5 16:17:50 | 显示全部楼层
您好,我最近在修改一个AI,但是不知道怎么修改让AI军队进攻不撤退和AI建筑物间隙距离,可否告知修改哪个地方?谢谢了
回复

使用道具 举报

1

主题

0

精华

13

积分

骑士

耕战
0
鹰币
10
天龙币
0
回帖
9
附庸关系0
发表于 2017-12-6 21:43:49 | 显示全部楼层
现在只有移除AI军队撤退机制不知道怎么弄了,跪求大神告知!
回复

使用道具 举报

0

主题

0

精华

99

积分

骑士

耕战
10
鹰币
60
天龙币
0
回帖
46
附庸关系0
发表于 2017-12-29 13:26:33 | 显示全部楼层
w81568233 发表于 2017-7-19 17:55
我想找会城镇中心全被打掉后自动重建的AI 一直找不到 试了楼主的ai也不行 怎么办?

//是否转移主基地
rule shouldIMigrate
inactive
minInterval 10
group startup
{
   int armySize = aiPlanGetNumberUnits(gLandDefendPlan0, cUnitTypeLogicalTypeLandMilitary) + aiPlanGetNumberUnits(gLandReservePlan, cUnitTypeLogicalTypeLandMilitary);
   int enemyArmySize = -1;   
   bool migrate = false;
   static int enemyArmyQuery = -1;
   if (enemyArmyQuery < 0)
   {  // Initialize the queryID
      enemyArmyQuery = kbUnitQueryCreate("Enemy army query");
      kbUnitQuerySetIgnoreKnockedOutUnits(enemyArmyQuery, true);
      kbUnitQuerySetPlayerRelation(enemyArmyQuery, cPlayerRelationEnemyNotGaia);
      kbUnitQuerySetUnitType(enemyArmyQuery, cUnitTypeLogicalTypeLandMilitary);
      kbUnitQuerySetState(enemyArmyQuery, cUnitStateAlive);
      kbUnitQuerySetSeeableOnly(enemyArmyQuery, true);   // Ignore units we think are under fog
   }
   
   // Check main base first
   kbUnitQuerySetPosition(enemyArmyQuery,  kbBaseGetLocation(cMyID, kbBaseGetMainID(cMyID)));
   kbUnitQuerySetMaximumDistance(enemyArmyQuery, cvDefenseReflexSearchRadius);   
   kbUnitQuerySetSeeableOnly(enemyArmyQuery, true);
   kbUnitQuerySetState(enemyArmyQuery, cUnitStateAlive);
   kbUnitQueryResetResults(enemyArmyQuery);
   enemyArmySize = kbUnitQueryExecute(enemyArmyQuery);
   if (enemyArmySize >= 2)
   {  
      // Enemy army size at least 3x my size and more than 30 units total. Thus, we migrate
      if ( ((armySize * 3.0) < enemyArmySize) && (enemyArmySize > 30) )
      {  // Too big to handle                     
         xsEnableRule("createNewBase");         
      }                     
   }   
}

//相关参数设定
bool findACompletedTownCenter()
{
   bool retVal = false;
   static int townCenterQuery = -1;
   if (townCenterQuery < 0)
   {
      townCenterQuery=kbUnitQueryCreate("Completed Town Center Query");
      kbUnitQuerySetIgnoreKnockedOutUnits(townCenterQuery, true);
   }  
   //Define the query
   if (townCenterQuery != -1)
   {
      kbUnitQuerySetPlayerRelation(townCenterQuery, -1);
      kbUnitQuerySetPlayerID(townCenterQuery, cMyID);
      kbUnitQuerySetUnitType(townCenterQuery, cUnitTypeTownCenter);
      kbUnitQuerySetState(townCenterQuery, cUnitStateAny);
      kbUnitQuerySetAscendingSort(townCenterQuery, true);   // Ascending distance from initial location          
   }  
   else
      return(retVal);

   // Run the query
   kbUnitQueryResetResults(townCenterQuery);
   int count = kbUnitQueryExecute(townCenterQuery);
   int tcID = kbUnitQueryGetResult(townCenterQuery, 0);  
   
   if (tcID >=0)
      retVal = true;

   return(retVal);
}

//建造新基地
rule createNewBase
inactive
minInterval 5
{
   // First, create a query if needed, then use it to look for a completed town center
   static int townCenterQuery = -1;
   if (townCenterQuery < 0)
   {
      townCenterQuery=kbUnitQueryCreate("Completed Town Center Query");
      kbUnitQuerySetIgnoreKnockedOutUnits(townCenterQuery, true);
   }  
   //Define the query
   if (townCenterQuery != -1)
   {
      kbUnitQuerySetPlayerRelation(townCenterQuery, -1);
      kbUnitQuerySetPlayerID(townCenterQuery, cMyID);
      kbUnitQuerySetUnitType(townCenterQuery, cUnitTypeTownCenter);
      kbUnitQuerySetState(townCenterQuery, cUnitStateAlive);          
   }  
   
   // Run the query
   kbUnitQueryResetResults(townCenterQuery);
   int count = kbUnitQueryExecute(townCenterQuery);
      
   if (count < 1)
      return;  

   for (i=0; < count)
   {
      int tcID = kbUnitQueryGetResult(townCenterQuery, i);
      aiEcho("New TC is "+tcID+" at "+kbUnitGetPosition(tcID));
   }

   if (findACompletedTownCenter() == true)  
   {
      int tcBase = kbUnitGetBaseID(tcID);
      gMainBase = kbBaseGetMainID(cMyID);
      aiEcho(" TC base is "+tcBase+", main base is "+gMainBase);
      // We have a TC.  Make sure that the main base exists, and it includes the TC
      if ( gMainBase < 0 )
      {  // We have no main base, create one
         gMainBase = createMainBase(kbUnitGetPosition(tcID));
         aiEcho(" We had no main base, so we created one: "+gMainBase);
      }
      tcBase = kbUnitGetBaseID(tcID);  // in case base ID just changed
      if ( tcBase != gMainBase )
      {
         aiEcho(" TC "+tcID+" is not in the main base ("+gMainBase+".");
         aiEcho(" Setting base "+gMainBase+" to non-main, setting base "+tcBase+" to main.");
         kbBaseSetMain(cMyID, gMainBase, false);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeEasy, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeHuntAggressive, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeFish, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeFarm, gMainBase);
         aiRemoveResourceBreakdown(cResourceWood, cAIResourceSubTypeEasy, gMainBase);
         aiRemoveResourceBreakdown(cResourceGold, cAIResourceSubTypeEasy, gMainBase);
         kbBaseSetMain(cMyID, tcBase, true);
         gMainBase = tcBase;
      }               
   }
   else
    return;
}

//建造其它TC
rule createOtherTC
inactive
minInterval 5
{
        // British explorer to build 1 additional TC
      if ((cMyCiv == cCivBritish) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional British town center");
      }

      // French explorer to build 1 additional TC
      if ((cMyCiv == cCivFrench) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional French town center");
      }

      // Spanish explorer to build 2 additional TCs
      if ((cMyCiv == cCivSpanish) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Spanish town center");
      }

      // Russians explorer to build 2 additional TCs
      if ((cMyCiv == cCivRussians) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Russians town center");
      }

      // Germans explorer to build 2 additional TCs
      if ((cMyCiv == cCivGermans) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Germans town center");
      }

      // Dutch explorer to build 2 additional TC
      if ((cMyCiv == cCivDutch) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Portuguese town center");
      }

      // Ottoman explorer to build 1 additional TC
      if ((cMyCiv == cCivOttomans) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Ottoman town center");
      }

      // Sioux explorer to build 2 additional TCs
      if ((cMyCiv == cCivXPSioux) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Sioux town center");
      }

      // Iroquois explorer to build 1 additional TC
      if ((cMyCiv == cCivXPIroquois) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Iroquois town center");
      }

      // Aztec explorer to build 1 additional TC
      if ((cMyCiv == cCivXPAztec) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Aztec town center");
      }

      // Chinese explorer to build 2 additional TCs
      if ((cMyCiv == cCivChinese) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Chinese town center");
      }

      // Japanese explorer to build 1 additional TC
      if ((cMyCiv == cCivJapanese) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Japanese town center");
      }

      // Indians explorer to build 1 additional TC
      if ((cMyCiv == cCivIndians) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Indians town center");
      }
}

//变更主基地
rule ChangeBase
active
minInterval 5
//group startup
{
   if(kbGetAge()<cAge4)
        return;
   static int lastchangebaseTime=0;
   if(kbBaseGetMainID(cMyID)<0)
   {
   xsEnableRule("createNewBase");
   return;}
   else
   {
   if((xsGetTime()-lastchangebaseTime)>300000)
   {
   static int townCenterQuery = -1;
   if (townCenterQuery < 0)
   {
      townCenterQuery=kbUnitQueryCreate("Completed Town Center Query");
      kbUnitQuerySetIgnoreKnockedOutUnits(townCenterQuery, true);//去掉重复结果?
   }  
   //Define the query
   if (townCenterQuery != -1)
   {
      kbUnitQuerySetPlayerRelation(townCenterQuery, -1);//查询关系?
      kbUnitQuerySetPlayerID(townCenterQuery, cMyID);
      kbUnitQuerySetUnitType(townCenterQuery, cUnitTypeTownCenter);
      kbUnitQuerySetState(townCenterQuery, cUnitStateAlive);//查询状态?
   }  
   
   // Run the query
   kbUnitQueryResetResults(townCenterQuery);//重置结果。
   int count = kbUnitQueryExecute(townCenterQuery);//执行查询,得到数量。
      
   if (count < 1)
      return;  

   for (i=0; < count)
   {
      int tcID = kbUnitQueryGetResult(townCenterQuery, i);//得到结果。
      aiEcho("New TC is "+tcID+" at "+kbUnitGetPosition(tcID));//“kbUnitGetPosition”获取位置?
   }

      int tcBase = kbUnitGetBaseID(tcID);
      gMainBase = kbBaseGetMainID(cMyID);
      aiEcho(" TC base is "+tcBase+", main base is "+gMainBase);
          // We have a TC.  Make sure that the main base exists, and it includes the TC
      if ( gMainBase < 0 )
      {  // 我们要新建一个基地。
         gMainBase = createMainBase(kbUnitGetPosition(tcID));
         aiEcho(" We had no main base, so we created one: "+gMainBase);
      }
      tcBase = kbUnitGetBaseID(tcID);  // in case base ID just changed
      if ( tcBase != gMainBase )
      {
         aiEcho(" TC "+tcID+" is not in the main base ("+gMainBase+".");
         aiEcho(" Setting base "+gMainBase+" to non-main, setting base "+tcBase+" to main.");
         kbBaseSetMain(cMyID, gMainBase, false);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeEasy, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeHuntAggressive, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeFish, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeFarm, gMainBase);
         aiRemoveResourceBreakdown(cResourceWood, cAIResourceSubTypeEasy, gMainBase);
         aiRemoveResourceBreakdown(cResourceGold, cAIResourceSubTypeEasy, gMainBase);
         kbBaseSetMain(cMyID, tcBase, true);
         gMainBase = tcBase;
      }
          lastchangebaseTime=xsGetTime();
        }
        }
}
回复

使用道具 举报

0

主题

0

精华

99

积分

骑士

耕战
10
鹰币
60
天龙币
0
回帖
46
附庸关系0
发表于 2017-12-29 13:28:30 | 显示全部楼层
w81568233 发表于 2017-7-19 17:55
我想找会城镇中心全被打掉后自动重建的AI 一直找不到 试了楼主的ai也不行 怎么办?

把下面这个复制粘贴到你的游戏安装目录下的AI3文件里,再进游戏就会发现AI基地被摧毁后在资源采集范围内重新建立基地
rule shouldIMigrate
inactive
minInterval 10
group startup
{
   int armySize = aiPlanGetNumberUnits(gLandDefendPlan0, cUnitTypeLogicalTypeLandMilitary) + aiPlanGetNumberUnits(gLandReservePlan, cUnitTypeLogicalTypeLandMilitary);
   int enemyArmySize = -1;   
   bool migrate = false;
   static int enemyArmyQuery = -1;
   if (enemyArmyQuery < 0)
   {  // Initialize the queryID
      enemyArmyQuery = kbUnitQueryCreate("Enemy army query");
      kbUnitQuerySetIgnoreKnockedOutUnits(enemyArmyQuery, true);
      kbUnitQuerySetPlayerRelation(enemyArmyQuery, cPlayerRelationEnemyNotGaia);
      kbUnitQuerySetUnitType(enemyArmyQuery, cUnitTypeLogicalTypeLandMilitary);
      kbUnitQuerySetState(enemyArmyQuery, cUnitStateAlive);
      kbUnitQuerySetSeeableOnly(enemyArmyQuery, true);   // Ignore units we think are under fog
   }
   
   // Check main base first
   kbUnitQuerySetPosition(enemyArmyQuery,  kbBaseGetLocation(cMyID, kbBaseGetMainID(cMyID)));
   kbUnitQuerySetMaximumDistance(enemyArmyQuery, cvDefenseReflexSearchRadius);   
   kbUnitQuerySetSeeableOnly(enemyArmyQuery, true);
   kbUnitQuerySetState(enemyArmyQuery, cUnitStateAlive);
   kbUnitQueryResetResults(enemyArmyQuery);
   enemyArmySize = kbUnitQueryExecute(enemyArmyQuery);
   if (enemyArmySize >= 2)
   {  
      // Enemy army size at least 3x my size and more than 30 units total. Thus, we migrate
      if ( ((armySize * 3.0) < enemyArmySize) && (enemyArmySize > 30) )
      {  // Too big to handle                     
         xsEnableRule("createNewBase");         
      }                     
   }   
}

//相关参数设定
bool findACompletedTownCenter()
{
   bool retVal = false;
   static int townCenterQuery = -1;
   if (townCenterQuery < 0)
   {
      townCenterQuery=kbUnitQueryCreate("Completed Town Center Query");
      kbUnitQuerySetIgnoreKnockedOutUnits(townCenterQuery, true);
   }  
   //Define the query
   if (townCenterQuery != -1)
   {
      kbUnitQuerySetPlayerRelation(townCenterQuery, -1);
      kbUnitQuerySetPlayerID(townCenterQuery, cMyID);
      kbUnitQuerySetUnitType(townCenterQuery, cUnitTypeTownCenter);
      kbUnitQuerySetState(townCenterQuery, cUnitStateAny);
      kbUnitQuerySetAscendingSort(townCenterQuery, true);   // Ascending distance from initial location          
   }  
   else
      return(retVal);

   // Run the query
   kbUnitQueryResetResults(townCenterQuery);
   int count = kbUnitQueryExecute(townCenterQuery);
   int tcID = kbUnitQueryGetResult(townCenterQuery, 0);  
   
   if (tcID >=0)
      retVal = true;

   return(retVal);
}

//建造新基地
rule createNewBase
inactive
minInterval 5
{
   // First, create a query if needed, then use it to look for a completed town center
   static int townCenterQuery = -1;
   if (townCenterQuery < 0)
   {
      townCenterQuery=kbUnitQueryCreate("Completed Town Center Query");
      kbUnitQuerySetIgnoreKnockedOutUnits(townCenterQuery, true);
   }  
   //Define the query
   if (townCenterQuery != -1)
   {
      kbUnitQuerySetPlayerRelation(townCenterQuery, -1);
      kbUnitQuerySetPlayerID(townCenterQuery, cMyID);
      kbUnitQuerySetUnitType(townCenterQuery, cUnitTypeTownCenter);
      kbUnitQuerySetState(townCenterQuery, cUnitStateAlive);          
   }  
   
   // Run the query
   kbUnitQueryResetResults(townCenterQuery);
   int count = kbUnitQueryExecute(townCenterQuery);
      
   if (count < 1)
      return;  

   for (i=0; < count)
   {
      int tcID = kbUnitQueryGetResult(townCenterQuery, i);
      aiEcho("New TC is "+tcID+" at "+kbUnitGetPosition(tcID));
   }

   if (findACompletedTownCenter() == true)  
   {
      int tcBase = kbUnitGetBaseID(tcID);
      gMainBase = kbBaseGetMainID(cMyID);
      aiEcho(" TC base is "+tcBase+", main base is "+gMainBase);
      // We have a TC.  Make sure that the main base exists, and it includes the TC
      if ( gMainBase < 0 )
      {  // We have no main base, create one
         gMainBase = createMainBase(kbUnitGetPosition(tcID));
         aiEcho(" We had no main base, so we created one: "+gMainBase);
      }
      tcBase = kbUnitGetBaseID(tcID);  // in case base ID just changed
      if ( tcBase != gMainBase )
      {
         aiEcho(" TC "+tcID+" is not in the main base ("+gMainBase+".");
         aiEcho(" Setting base "+gMainBase+" to non-main, setting base "+tcBase+" to main.");
         kbBaseSetMain(cMyID, gMainBase, false);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeEasy, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeHuntAggressive, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeFish, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeFarm, gMainBase);
         aiRemoveResourceBreakdown(cResourceWood, cAIResourceSubTypeEasy, gMainBase);
         aiRemoveResourceBreakdown(cResourceGold, cAIResourceSubTypeEasy, gMainBase);
         kbBaseSetMain(cMyID, tcBase, true);
         gMainBase = tcBase;
      }               
   }
   else
    return;
}

//建造其它TC
rule createOtherTC
inactive
minInterval 5
{
        // British explorer to build 1 additional TC
      if ((cMyCiv == cCivBritish) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional British town center");
      }

      // French explorer to build 1 additional TC
      if ((cMyCiv == cCivFrench) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional French town center");
      }

      // Spanish explorer to build 2 additional TCs
      if ((cMyCiv == cCivSpanish) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Spanish town center");
      }

      // Russians explorer to build 2 additional TCs
      if ((cMyCiv == cCivRussians) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Russians town center");
      }

      // Germans explorer to build 2 additional TCs
      if ((cMyCiv == cCivGermans) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Germans town center");
      }

      // Dutch explorer to build 2 additional TC
      if ((cMyCiv == cCivDutch) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Portuguese town center");
      }

      // Ottoman explorer to build 1 additional TC
      if ((cMyCiv == cCivOttomans) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Ottoman town center");
      }

      // Sioux explorer to build 2 additional TCs
      if ((cMyCiv == cCivXPSioux) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Sioux town center");
      }

      // Iroquois explorer to build 1 additional TC
      if ((cMyCiv == cCivXPIroquois) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Iroquois town center");
      }

      // Aztec explorer to build 1 additional TC
      if ((cMyCiv == cCivXPAztec) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Aztec town center");
      }

      // Chinese explorer to build 2 additional TCs
      if ((cMyCiv == cCivChinese) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Chinese town center");
      }

      // Japanese explorer to build 1 additional TC
      if ((cMyCiv == cCivJapanese) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Japanese town center");
      }

      // Indians explorer to build 1 additional TC
      if ((cMyCiv == cCivIndians) && (cvOkToBuild == true))
      {
         createSimpleBuildPlan(cUnitTypeTownCenter, 2, 90, true, cEconomyEscrowID, kbBaseGetMainID(cMyID), 1);
         aiEcho("Starting build plan for an additional Indians town center");
      }
}

//变更主基地
rule ChangeBase
active
minInterval 5
//group startup
{
   if(kbGetAge()<cAge4)
        return;
   static int lastchangebaseTime=0;
   if(kbBaseGetMainID(cMyID)<0)
   {
   xsEnableRule("createNewBase");
   return;}
   else
   {
   if((xsGetTime()-lastchangebaseTime)>300000)
   {
   static int townCenterQuery = -1;
   if (townCenterQuery < 0)
   {
      townCenterQuery=kbUnitQueryCreate("Completed Town Center Query");
      kbUnitQuerySetIgnoreKnockedOutUnits(townCenterQuery, true);//去掉重复结果?
   }  
   //Define the query
   if (townCenterQuery != -1)
   {
      kbUnitQuerySetPlayerRelation(townCenterQuery, -1);//查询关系?
      kbUnitQuerySetPlayerID(townCenterQuery, cMyID);
      kbUnitQuerySetUnitType(townCenterQuery, cUnitTypeTownCenter);
      kbUnitQuerySetState(townCenterQuery, cUnitStateAlive);//查询状态?
   }  
   
   // Run the query
   kbUnitQueryResetResults(townCenterQuery);//重置结果。
   int count = kbUnitQueryExecute(townCenterQuery);//执行查询,得到数量。
      
   if (count < 1)
      return;  

   for (i=0; < count)
   {
      int tcID = kbUnitQueryGetResult(townCenterQuery, i);//得到结果。
      aiEcho("New TC is "+tcID+" at "+kbUnitGetPosition(tcID));//“kbUnitGetPosition”获取位置?
   }

      int tcBase = kbUnitGetBaseID(tcID);
      gMainBase = kbBaseGetMainID(cMyID);
      aiEcho(" TC base is "+tcBase+", main base is "+gMainBase);
          // We have a TC.  Make sure that the main base exists, and it includes the TC
      if ( gMainBase < 0 )
      {  // 我们要新建一个基地。
         gMainBase = createMainBase(kbUnitGetPosition(tcID));
         aiEcho(" We had no main base, so we created one: "+gMainBase);
      }
      tcBase = kbUnitGetBaseID(tcID);  // in case base ID just changed
      if ( tcBase != gMainBase )
      {
         aiEcho(" TC "+tcID+" is not in the main base ("+gMainBase+".");
         aiEcho(" Setting base "+gMainBase+" to non-main, setting base "+tcBase+" to main.");
         kbBaseSetMain(cMyID, gMainBase, false);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeEasy, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeHuntAggressive, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeFish, gMainBase);
         aiRemoveResourceBreakdown(cResourceFood, cAIResourceSubTypeFarm, gMainBase);
         aiRemoveResourceBreakdown(cResourceWood, cAIResourceSubTypeEasy, gMainBase);
         aiRemoveResourceBreakdown(cResourceGold, cAIResourceSubTypeEasy, gMainBase);
         kbBaseSetMain(cMyID, tcBase, true);
         gMainBase = tcBase;
      }
          lastchangebaseTime=xsGetTime();
        }
        }
}
回复

使用道具 举报

0

主题

0

精华

1

积分

扈从

耕战
0
鹰币
10
天龙币
0
回帖
2
附庸关系0
发表于 2018-4-20 21:20:30 | 显示全部楼层
雷光AI  没25张卡 后期电脑出兵也不够快   老玩家要求兵海来弱
回复

使用道具 举报

0

主题

0

精华

17

积分

骑士

耕战
0
鹰币
10
天龙币
0
回帖
9
附庸关系0
发表于 2018-6-24 14:46:10 | 显示全部楼层
读取不了附件了

点评

已重新上传  发表于 2018-7-8 17:49
回复

使用道具 举报

0

主题

0

精华

68

积分

骑士

耕战
8
鹰币
10
天龙币
0
回帖
55
附庸关系0
发表于 2018-6-27 11:18:11 | 显示全部楼层
下载不了了

点评

已补档  发表于 2018-7-8 17:50
回复

使用道具 举报

本版积分规则

排行榜|小黑屋|翔鹰帝国

GMT+8, 2024-4-24 01:49 , Processed in 0.220939 second(s), 225 queries , File On.

Powered by Hawk Studio  QS Security Corp.® Licensed

Copyright © 2001-2023, Hawkaoe.net All Rights Reserved

快速回复 返回顶部 返回列表