放置贸易路线



创建悬崖还是在创建地图的基础上加上几个语句,然后把地形语句删掉。
贸易路线格式: int tradeRouteID = rmCreateTradeRoute(); int socketID=rmCreateObjectDef("sockets to dock Trade Posts"); rmAddObjectDefItem(socketID, "SocketTradeRoute", 1, 0.0); //rmAddObjectDefConstraint(socketID, 贸易站地点放置限制); rmSetObjectDefAllowOverlap(socketID, true); rmSetObjectDefMinDistance(socketID, 0.0); rmSetObjectDefMaxDistance(socketID, 8.0); rmAddTradeRouteWaypoint(tradeRouteID, 0.00, 0.52); rmAddTradeRouteWaypoint(tradeRouteID, 0.20, 0.51); rmAddTradeRouteWaypoint(tradeRouteID, 0.40, 0.40); rmAddTradeRouteWaypoint(tradeRouteID, 0.55, 0.45); rmAddTradeRouteWaypoint(tradeRouteID, 0.75, 0.75); rmAddTradeRouteWaypoint(tradeRouteID, 0.80, 0.71); rmAddTradeRouteWaypoint(tradeRouteID, 0.39, 0.81); rmAddTradeRouteWaypoint(tradeRouteID, 1.00, 0.70); bool placedTradeRoute = rmBuildTradeRoute(tradeRouteID, "water"); if(placedTradeRoute == false) rmEchoError("Failed to place trade route"); // add the sockets along the trade route. rmSetObjectDefTradeRouteID(socketID, tradeRouteID); vector socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.07); rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.22); rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.40); rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.53); rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.69); rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.90); rmPlaceObjectDefAtPoint(socketID, 0, socketLoc);
/* 语句作用解释在下方 int tradeRouteID = rmCreateTradeRoute(); 定义tradeRouteID,并创建贸易路线 int socketID=rmCreateObjectDef("sockets to dock Trade Posts"); 定义socketID并创建单位 rmAddObjectDefItem(socketID, "SocketTradeRoute", 1, 0.0); 创建贸易站地点,数量为1,范围0(即为定位点所在位置) rmAddObjectDefConstraint(socketID, XXXXXX); 生成贸易站地点(SocketTradeRoute)时使用XXXXXX放置限制 rmSetObjectDefAllowOverlap(socketID, true); 允许重叠??? rmSetObjectDefMinDistance(socketID, 0.0); 定位点最小偏移距离 rmSetObjectDefMaxDistance(socketID, 8.0); 定位点最大偏移距离 rmAddTradeRouteWaypoint(tradeRouteID, 0.00, 0.52); 设定贸易路线起点(地图XZ坐标); rmAddTradeRouteWaypoint(tradeRouteID, 0.20, 0.51); 设定贸易路线中续点(地图XZ坐标) rmAddTradeRouteWaypoint(tradeRouteID, 0.40, 0.40); 设定贸易路线中续点(地图XZ坐标) rmAddTradeRouteWaypoint(tradeRouteID, 0.55, 0.45); 设定贸易路线中续点(地图XZ坐标) rmAddTradeRouteWaypoint(tradeRouteID, 0.75, 0.75); 设定贸易路线中续点(地图XZ坐标) rmAddTradeRouteWaypoint(tradeRouteID, 0.80, 0.71); 设定贸易路线中续点(地图XZ坐标) rmAddTradeRouteWaypoint(tradeRouteID, 0.39, 0.81); 设定贸易路线中续点(地图XZ坐标) rmAddTradeRouteWaypoint(tradeRouteID, 1.00, 0.70); 设定贸易路线终点(地图XZ坐标); bool placedTradeRoute = rmBuildTradeRoute(tradeRouteID, "water"); 亚洲地图类型为water,还有一个叫dirt;如果water不能升级贸易路线就改成dirt;如果dirt不能升级贸易路线就改成water,如果后面有时间的话,我可能会会制作水上贸易路线的教程。17:15 2019/3/25 除了这些还有其他,例如snow,如果你有兴趣的话,可以自己看一下Art5.bar的terrain\traderoutes.xml与Data3.bar的traderoutes.xml。 if(placedTradeRoute == false) rmEchoError("Failed to place trade route"); // add the sockets along the trade route. rmSetObjectDefTradeRouteID(socketID, tradeRouteID); vector socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.07); 设定第一个贸易站地点在贸易路线的长度7%(0.07)位置。 rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.22); 设定第二个贸易站地点在贸易路线的22%位置。 rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.40); 设定第三个贸易站地点在贸易路线的40%位置。 rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.53); 设定第四个贸易站地点在贸易路线的53%位置。 rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.69); 设定第五个贸易站地点在贸易路线的69%位置。 rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.90); 设定第六个贸易站地点在贸易路线的90%位置。 rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); */
贸易路线类型
rmBuildTradeRoute(int tradeRouteID, string terrainTypeName): Builds the trade route with the given terrain type.
I:马拉雪橇 dirt II:驿马车 stone III:火车 train
I:雪地马拉雪橇 snow II:驿马车 stone III:火车 train
I:亚洲·人力车 water II:亚洲·驿马车 water2 III:亚洲·火车 water3
I:帆船 temp

创建贸易路线一般放在首位,(在河、水域流后面创建),然后使用放置限制让所有单位、群组、森林避开贸易路线。

接下来添加上述的模板试试看吧:传送门
  Debug.xs - 记事本 ____ X
文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)
	include "mercenaries.xs";
	include "ypAsianInclude.xs";
	include "ypKOTHInclude.xs";

	void main(void)
	{
		// ---------------------------------------- Map Info -------------------------------------------
		int playerTilesX=13200;			//设定地图X大小
		int playerTilesZ=13200;			//设定地图Z大小(帝国3的Y是高度,Z才是我们平常所用到的Y)


		//如果玩家大于4将playerTilesX与playerTilesZ改为11500(同一个值的int只能出现1次,当你需要修改数值的时候,不能再加入int)
		if (cNumberNonGaiaPlayers >4){	playerTilesX=11500;	playerTilesZ=11500;}



		if (cNumberNonGaiaPlayers >6){	playerTilesX=10500;	playerTilesZ=10500;}		//Modify Map X&Z Size of 6,7,8 Player



		int SizeX = 2*sqrt(cNumberNonGaiaPlayers*playerTilesX);
		int SizeZ = 2*sqrt(cNumberNonGaiaPlayers*playerTilesZ);



		string MapTerrain ="Carolinas\ground_marsh3_car";	//<-------- 地图地形,自己参照剧情编辑器 <--------

		string MapLighting ="319a_Snow";			//<-------- 照明,自己参照剧情编辑器 <--------

		string PlayerTerrain ="Carolinas\ground_marsh1_car";	//<--------- 玩家范围地形 <---------




		//设定地图XZ大小,分别调用上面用int定义的SizeX与SizeZ,即为rmSetMapSize(13200,13200);如果玩家大于4将改为11500
		rmSetMapSize(SizeX, SizeZ);



		rmSetMapElevationParameters(cElevTurbulence, 0.15, 2.5, 0.35, 3.0); // type, frequency, octaves, persistence, variation 

		rmSetMapElevationHeightBlend(1.0);


		//地形初始化,设定地图初始地形,调用上面用string定义MapTerrain,即为"Carolinas\ground_marsh3_car";
		rmTerrainInitialize(MapTerrain,6);



		//设定照明,调用上面用string定义MapLighting,即为"319a_Snow"
		rmSetLightingSet(MapLighting);



		rmSetGlobalRain(0.9);		//设定下雨
		chooseMercs();
		rmSetMapType("yucatan");
		rmSetMapType("water");
		rmSetMapType("default");	//设定地图类型,地图类型影响到宝藏
		rmSetMapType("land");
		rmSetMapType("bayou");
		rmSetSeaLevel(0); // this is height of river surface compared to surrounding land. River depth is in the river XML.

		rmSetStatusText("",0.01);//读取地图进度条


	
	int tradeRouteID = rmCreateTradeRoute();
	int socketID=rmCreateObjectDef("sockets to dock Trade Posts");
	rmAddObjectDefItem(socketID, "SocketTradeRoute", 1, 0.0);
	//rmAddObjectDefConstraint(socketID, 贸易站地点放置限制);
	rmSetObjectDefAllowOverlap(socketID, true);
	rmSetObjectDefMinDistance(socketID, 0.0);
	rmSetObjectDefMaxDistance(socketID, 8.0);
 
	rmAddTradeRouteWaypoint(tradeRouteID, 0.00, 0.52);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.20, 0.51);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.40, 0.40);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.55, 0.45);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.75, 0.75);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.80, 0.71);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.39, 0.81);
	rmAddTradeRouteWaypoint(tradeRouteID, 1.00, 0.70);
 
	bool placedTradeRoute = rmBuildTradeRoute(tradeRouteID, "dirt");	//不是亚洲类型的地图就用dirt
	if(placedTradeRoute == false)
	rmEchoError("Failed to place trade route"); 
 
	// add the sockets along the trade route.
	rmSetObjectDefTradeRouteID(socketID, tradeRouteID);
 
	vector socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.07);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); 
	socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.22);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); 
	socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.40);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc);
	socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.53);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc);
	socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.69);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc);
	socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.90);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc);









		rmPlacePlayersCircular(0.35, 0.35, 0.0);   	//圆形放置玩家


		//玩家范围
		float AreaSizePlayer = rmAreaTilesToFraction(700);
		for(i=1; <=cNumberNonGaiaPlayers)
		{
			int id=rmCreateArea("Player"+i);
			rmSetPlayerArea(i, id);
			rmSetAreaWarnFailure(id, false);
			rmSetAreaSize(id, AreaSizePlayer, AreaSizePlayer);
			rmSetAreaLocPlayer(id, i);
			rmSetAreaCoherence(id, 0.85);
			rmSetAreaSmoothDistance(id, 2);
			rmSetAreaMinBlobs(id, 1);
			rmSetAreaMaxBlobs(id, 1);
			rmSetAreaTerrainType(id,PlayerTerrain);
			rmBuildArea(id);
		}


		//定义城镇中心
		int TownCenterID = rmCreateObjectDef("player TC");
		if (rmGetNomadStart())
		{
			rmAddObjectDefItem(TownCenterID, "CoveredWagon", 1, 0.0);
		}
		else
		{
			rmAddObjectDefItem(TownCenterID, "TownCenter", 1, 0);
		}
		rmSetObjectDefMinDistance(TownCenterID, 0.0);
		rmSetObjectDefMaxDistance(TownCenterID, 20.0);
		for(i=1; <=cNumberNonGaiaPlayers)
		{
			rmPlaceObjectDefAtLoc(TownCenterID, i, rmPlayerLocXFraction(i), rmPlayerLocZFraction(i));
		}


		//定义起始单位(civs.xml定义那些开局单位)
		int startingUnits = rmCreateStartingUnitsObjectDef(5.0);
		rmSetObjectDefMinDistance(startingUnits, 6.0);
		rmSetObjectDefMaxDistance(startingUnits, 10.0);

		for(i=1; <=cNumberNonGaiaPlayers)
		{
			
			vector TCLocation = rmGetUnitPosition(rmGetUnitPlacedOfPlayer(TownCenterID, i));

			
			rmPlaceObjectDefAtLoc(startingUnits, i, rmXMetersToFraction(xsVectorGetX(TCLocation)), rmZMetersToFraction(xsVectorGetZ(TCLocation)));
		}

		




		rmSetStatusText("",0.50);//读取地图进度条





		rmSetStatusText("",1.00);//读取地图进度条


					//愿神兽会保佑你不会出错。
 			/*----------------------------------------------------------------------------------------------*
			*    ┏┓   ┏┓										*
			*   ┏┛┻━━━┛┻┓									*
			*   ┃       ┃									*
			*   ┃   ━   ┃									*
			*   ┃ ┳┛ ┗┳ ┃									*
			*   ┃       ┃									*
			*   ┃   ┻   ┃									*
			*   ┃       ┃									*
			*   ┗━┓   ┏━┛     Code is far away from bug with the animal protecting		*
			*     ┃   ┃    									*
			*     ┃   ┃										*
			*     ┃   ┃										*
			*     ┃   ┃										*
			*     ┃   ┃										*
			*     ┃   ┗━━━┓									*
			*     ┃       ┣┓									*
			*     ┃       ┏┛									*
			*     ┗┓┓┏━┳┓┏┛									*
			*      ┃┫┫ ┃┫┫									*
			*      ┗┻┛ ┗┻┛									*
			*----------------------------------------------------------------------------------------------*/
	} //END







创建第二条贸易路线: 传送门
  Debug.xs - 记事本 ____ X
文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)
	include "mercenaries.xs";
	include "ypAsianInclude.xs";
	include "ypKOTHInclude.xs";

	void main(void)
	{
		// ---------------------------------------- Map Info -------------------------------------------
		int playerTilesX=13200;			//设定地图X大小
		int playerTilesZ=13200;			//设定地图Z大小(帝国3的Y是高度,Z才是我们平常所用到的Y)


		//如果玩家大于4将playerTilesX与playerTilesZ改为11500(同一个值的int只能出现1次,当你需要修改数值的时候,不能再加入int)
		if (cNumberNonGaiaPlayers >4){	playerTilesX=11500;	playerTilesZ=11500;}



		if (cNumberNonGaiaPlayers >6){	playerTilesX=10500;	playerTilesZ=10500;}		//Modify Map X&Z Size of 6,7,8 Player



		int SizeX = 2*sqrt(cNumberNonGaiaPlayers*playerTilesX);
		int SizeZ = 2*sqrt(cNumberNonGaiaPlayers*playerTilesZ);



		string MapTerrain ="Carolinas\ground_marsh3_car";	//<-------- 地图地形,自己参照剧情编辑器 <--------

		string MapLighting ="319a_Snow";			//<-------- 照明,自己参照剧情编辑器 <--------

		string PlayerTerrain ="Carolinas\ground_marsh1_car";	//<--------- 玩家范围地形 <---------




		//设定地图XZ大小,分别调用上面用int定义的SizeX与SizeZ,即为rmSetMapSize(13200,13200);如果玩家大于4将改为11500
		rmSetMapSize(SizeX, SizeZ);



		rmSetMapElevationParameters(cElevTurbulence, 0.15, 2.5, 0.35, 3.0); // type, frequency, octaves, persistence, variation 

		rmSetMapElevationHeightBlend(1.0);


		//地形初始化,设定地图初始地形,调用上面用string定义MapTerrain,即为"Carolinas\ground_marsh3_car";
		rmTerrainInitialize(MapTerrain,6);



		//设定照明,调用上面用string定义MapLighting,即为"319a_Snow"
		rmSetLightingSet(MapLighting);



		rmSetGlobalRain(0.9);		//设定下雨
		chooseMercs();
		rmSetMapType("yucatan");
		rmSetMapType("water");
		rmSetMapType("default");	//设定地图类型,地图类型影响到宝藏
		rmSetMapType("land");
		rmSetMapType("bayou");
		rmSetSeaLevel(0); // this is height of river surface compared to surrounding land. River depth is in the river XML.

		rmSetStatusText("",0.01);//读取地图进度条


	
	int tradeRouteID = rmCreateTradeRoute();
	int socketID=rmCreateObjectDef("sockets to dock Trade Posts");
	rmAddObjectDefItem(socketID, "SocketTradeRoute", 1, 0.0);
	//rmAddObjectDefConstraint(socketID, 贸易站地点放置限制);
	rmSetObjectDefAllowOverlap(socketID, true);
	rmSetObjectDefMinDistance(socketID, 0.0);
	rmSetObjectDefMaxDistance(socketID, 8.0);
 
	rmAddTradeRouteWaypoint(tradeRouteID, 0.00, 0.52);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.20, 0.51);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.40, 0.40);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.55, 0.45);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.75, 0.75);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.80, 0.71);
	rmAddTradeRouteWaypoint(tradeRouteID, 0.39, 0.81);
	rmAddTradeRouteWaypoint(tradeRouteID, 1.00, 0.70);
 
	bool placedTradeRoute = rmBuildTradeRoute(tradeRouteID, "train");	//改成train看看
	if(placedTradeRoute == false)
	rmEchoError("Failed to place trade route"); 
 
	// add the sockets along the trade route.
	rmSetObjectDefTradeRouteID(socketID, tradeRouteID);
 
	vector socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.07);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); 
	socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.22);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc); 
	socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.40);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc);
	socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.53);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc);
	socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.69);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc);
	socketLoc = rmGetTradeRouteWayPoint(tradeRouteID, 0.90);
	rmPlaceObjectDefAtPoint(socketID, 0, socketLoc);


	//第二条贸易路线,int定义以及rmCreateObjectDef名称不要与第一条有重复

	int tradeRoute2ID = rmCreateTradeRoute();
	int socket2ID=rmCreateObjectDef("sockets to dock Trade Posts2");
	rmAddObjectDefItem(socket2ID, "SocketTradeRoute", 1, 0.0);
	//rmAddObjectDefConstraint(socket2ID, 贸易站地点放置限制);
	rmSetObjectDefAllowOverlap(socket2ID, true);
	rmSetObjectDefMinDistance(socket2ID, 0.0);
	rmSetObjectDefMaxDistance(socket2ID, 8.0);
 
	rmAddTradeRouteWaypoint(tradeRoute2ID, 0.00, 1.0);
	rmAddTradeRouteWaypoint(tradeRoute2ID, 1.00, 0.00);
 
	bool placedTradeRoute2 = rmBuildTradeRoute(tradeRoute2ID, "snow");	//改成snow看看有什么效果
	if(placedTradeRoute2 == false)
	rmEchoError("Failed to place trade route"); 
 
	// add the sockets along the trade route.
	rmSetObjectDefTradeRouteID(socket2ID, tradeRoute2ID);
 
	vector socketLoc2 = rmGetTradeRouteWayPoint(tradeRoute2ID, 0.25);		//第二条贸易路线只设定4个贸易站地点
	rmPlaceObjectDefAtPoint(socket2ID, 0, socketLoc2); 
	socketLoc2 = rmGetTradeRouteWayPoint(tradeRoute2ID, 0.40);
	rmPlaceObjectDefAtPoint(socket2ID, 0, socketLoc2);
	socketLoc2 = rmGetTradeRouteWayPoint(tradeRoute2ID, 0.60);
	rmPlaceObjectDefAtPoint(socket2ID, 0, socketLoc2);
	socketLoc2 = rmGetTradeRouteWayPoint(tradeRoute2ID, 0.75);
	rmPlaceObjectDefAtPoint(socket2ID, 0, socketLoc2);








		rmPlacePlayersCircular(0.35, 0.35, 0.0);   	//圆形放置玩家


		//玩家范围
		float AreaSizePlayer = rmAreaTilesToFraction(700);
		for(i=1; <=cNumberNonGaiaPlayers)
		{
			int id=rmCreateArea("Player"+i);
			rmSetPlayerArea(i, id);
			rmSetAreaWarnFailure(id, false);
			rmSetAreaSize(id, AreaSizePlayer, AreaSizePlayer);
			rmSetAreaLocPlayer(id, i);
			rmSetAreaCoherence(id, 0.85);
			rmSetAreaSmoothDistance(id, 2);
			rmSetAreaMinBlobs(id, 1);
			rmSetAreaMaxBlobs(id, 1);
			rmSetAreaTerrainType(id,PlayerTerrain);
			rmBuildArea(id);
		}


		//定义城镇中心
		int TownCenterID = rmCreateObjectDef("player TC");
		if (rmGetNomadStart())
		{
			rmAddObjectDefItem(TownCenterID, "CoveredWagon", 1, 0.0);
		}
		else
		{
			rmAddObjectDefItem(TownCenterID, "TownCenter", 1, 0);
		}
		rmSetObjectDefMinDistance(TownCenterID, 0.0);
		rmSetObjectDefMaxDistance(TownCenterID, 20.0);
		for(i=1; <=cNumberNonGaiaPlayers)
		{
			rmPlaceObjectDefAtLoc(TownCenterID, i, rmPlayerLocXFraction(i), rmPlayerLocZFraction(i));
		}


		//定义起始单位(civs.xml定义那些开局单位)
		int startingUnits = rmCreateStartingUnitsObjectDef(5.0);
		rmSetObjectDefMinDistance(startingUnits, 6.0);
		rmSetObjectDefMaxDistance(startingUnits, 10.0);

		for(i=1; <=cNumberNonGaiaPlayers)
		{
			
			vector TCLocation = rmGetUnitPosition(rmGetUnitPlacedOfPlayer(TownCenterID, i));

			
			rmPlaceObjectDefAtLoc(startingUnits, i, rmXMetersToFraction(xsVectorGetX(TCLocation)), rmZMetersToFraction(xsVectorGetZ(TCLocation)));
		}

		




		rmSetStatusText("",0.50);//读取地图进度条





		rmSetStatusText("",1.00);//读取地图进度条


					//愿神兽会保佑你不会出错。
 			/*----------------------------------------------------------------------------------------------*
			*    ┏┓   ┏┓										*
			*   ┏┛┻━━━┛┻┓									*
			*   ┃       ┃									*
			*   ┃   ━   ┃									*
			*   ┃ ┳┛ ┗┳ ┃									*
			*   ┃       ┃									*
			*   ┃   ┻   ┃									*
			*   ┃       ┃									*
			*   ┗━┓   ┏━┛     Code is far away from bug with the animal protecting		*
			*     ┃   ┃    									*
			*     ┃   ┃										*
			*     ┃   ┃										*
			*     ┃   ┃										*
			*     ┃   ┃										*
			*     ┃   ┗━━━┓									*
			*     ┃       ┣┓									*
			*     ┃       ┏┛									*
			*     ┗┓┓┏━┳┓┏┛									*
			*      ┃┫┫ ┃┫┫									*
			*      ┗┻┛ ┗┻┛									*
			*----------------------------------------------------------------------------------------------*/
	} //END



把dirt改成train与sonw后直接变成火车贸易路线与雪地贸易路线


让城镇中心、矿场、森林、水域避开贸易路线方法:
rmCreateTradeRouteDistanceConstraint(string name, float minDistance): Make a constraint to avoid trade routes. 
rmCreateTypeDistanceConstraint(string name, string Unittype, float distance): Make a type distance constraint.


例如:
		设定与贸易路线最小间隔距离15
	int avoidTradeRouteFar = rmCreateTradeRouteDistanceConstraint("avoid trade route", 15.0);

		设定与socketTradeRoute(贸易站地点)最小间隔距离12
	int avoidTradeRouteSocketFar = rmCreateTypeDistanceConstraint("avoid trade route socket far", "socketTradeRoute", 12.0);


这个教程就不再演示操作了,前面已经演示了几遍添加放置限制的教程,你应该懂了,不懂我也没办法,写一个放置限制的教程要20-90分钟(因为地图容易出错、找错误难,而且要确保教程的语句直接复制到教程100%能使用),所以我是不愿意制作的。

本次教程结束。