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