创建悬崖




创建悬崖还是在创建地图的基础上加上几个语句,然后把地形语句删掉。
语句是: [( )] rmSetAreaCliffType(int areaID, string cliffName): Sets the cliff type for an area.
[( )] rmSetAreaCliffType(int areaID, string cliffName): 给地形设定悬崖类型,然后这个地形就变成悬崖了,cliffName参考下表。
Amazon Andes Andeswall Araucania Central
araucania central coast araucania central coast2 Araucania North Araucania North Coast
Araucania North Coast2 Araucania South Araucania Southern Coast Bayou
California californiacoast californiacoast2 Caribbean
Carolina Carolina Coast Carolina Inland Cave
Ceylon Coastal Japan Deccan Plateau Deccan Plateau River
Great Plains Himalayas New England New England Inland
New England Inland Grass New England snow New England_texgrass Orinoco
Painteddesert Patagonia Patagonia Rocky Mountain Edge
Rocky Mountain2 Sonora SPC Caribbean SPC Mountain Pass
SPC Rocky cliffs Texas Texas Grass Yellow River





例如这是一个地形:
  int TestID=rmCreateArea("Test ID Area");
  rmSetAreaSize(TestID, rmAreaTilesToFraction(500), rmAreaTilesToFraction(500));
  rmSetAreaWarnFailure(TestID, true);
  rmSetAreaSmoothDistance(TestID, 0);
  rmSetAreaCoherence(TestID, 0.0);
  rmSetAreaMix(TestID, "himalayas_a");
  rmSetAreaBaseHeight(TestID, 4.0);
  rmSetAreaElevationOctaves(TestID, 3);
  rmSetAreaObeyWorldCircleConstraint(TestID, false);
  rmSetAreaLocation(TestID, 0.5, 0.5);
  rmBuildArea(TestID);


将上述语句改成悬崖如下:
  int TestID=rmCreateArea("Test ID Area");
  rmSetAreaSize(TestID, rmAreaTilesToFraction(500), rmAreaTilesToFraction(500));
  rmSetAreaCliffType(TestID, "SPC Caribbean");
  rmSetAreaWarnFailure(TestID, true);
  rmSetAreaSmoothDistance(TestID, 0);
  rmSetAreaCoherence(TestID, 0.0);
  //rmSetAreaMix(TestID, "himalayas_a");将设定地形类型语句删除,就算是保留也不会再起任何作用了。
  rmSetAreaBaseHeight(TestID, 4.0);//地形高度也能作为悬崖高度
  rmSetAreaElevationOctaves(TestID, 3);
  rmSetAreaObeyWorldCircleConstraint(TestID, false);
  rmSetAreaLocation(TestID, 0.5, 0.5);
  rmBuildArea(TestID);



int TestID=rmCreateArea("Test ID Area"); rmSetAreaSize(TestID, rmAreaTilesToFraction(500), rmAreaTilesToFraction(500)); rmSetAreaCliffType(TestID, "SPC Caribbean"); rmSetAreaWarnFailure(TestID, true); rmSetAreaSmoothDistance(TestID, 0); rmSetAreaCoherence(TestID, 0.0); //rmSetAreaMix(TestID, "himalayas_a");将设定地形类型语句删除,就算是保留也不会再起任何作用了。 rmSetAreaBaseHeight(TestID, 10.0);//地形高度10 rmSetAreaElevationOctaves(TestID, 3); rmSetAreaObeyWorldCircleConstraint(TestID, false); rmSetAreaLocation(TestID, 0.5, 0.5); rmBuildArea(TestID);
与前面几个教程一样,悬崖可以删掉rmSetAreaLocation定位,然后用放置限制随机放置,这里不再列出。
事实上悬崖我也搞不太懂,悬崖还有几个语句例如rmSetAreaCliffHeight:
[( )] rmSetAreaCliffHeight(int areaID, float val, float variance, float ramp): Set an area's cliff height.
rmSetAreaCliffHeight是一个可以设定悬崖高度的语句,以下是rmSetAreaCliffHeight的测试结果 int TestID=rmCreateArea("Test ID Area"); rmSetAreaSize(TestID, rmAreaTilesToFraction(500), rmAreaTilesToFraction(500)); rmSetAreaWarnFailure(TestID, true); rmSetAreaSmoothDistance(TestID, 0); rmSetAreaCoherence(TestID, 0.8); //rmSetAreaBaseHeight(TestID, 4.0); rmSetAreaCliffType(TestID, "SPC Caribbean"); rmSetAreaCliffHeight(TestID, rmRandInt(6, 8), 100.0, 1.0); rmSetAreaElevationOctaves(TestID, 3); rmSetAreaObeyWorldCircleConstraint(TestID, false); rmSetAreaLocation(TestID, 0.5, 0.5); rmSetAreaHeightBlend(TestID, 100); rmBuildArea(TestID);










variance:变化幅度;
ramp :斜坡; 总合以上测试结果大概就是
rmSetAreaCliffHeight(int areaID, float val悬崖高度, float variance浮动高度(悬崖最高值), float ramp斜坡,一般为1.0,数值越大斜坡越直,<1的话已经不能算悬崖了,0.0直接变成平地)
也只能这样解释了,我也被搞懵了。 不管这个语句了,另一个语句: rmSetAreaCliffEdge(int areaID, int count, float size, float variance, float spacing, int mapEdge): Set cliff edge parameters for an area. ---------------------------------------------------- int TestID=rmCreateArea("Test ID Area"); rmSetAreaSize(TestID, rmAreaTilesToFraction(500), rmAreaTilesToFraction(500)); rmSetAreaWarnFailure(TestID, true); rmSetAreaSmoothDistance(TestID, 0); rmSetAreaCoherence(TestID, 0.8); rmSetAreaCliffType(TestID, "SPC Caribbean"); rmSetAreaCliffHeight(TestID, rmRandInt(6, 8), 1.0, 1.0); rmSetAreaCliffEdge(TestID, 3, rmAreaTilesToFraction(2000), 1, 1, 0); rmSetAreaElevationOctaves(TestID, 3); rmSetAreaObeyWorldCircleConstraint(TestID, false); rmSetAreaLocation(TestID, 0.5, 0.5); rmSetAreaHeightBlend(TestID, 100); rmBuildArea(TestID);
int TestID=rmCreateArea("Test ID Area"); rmSetAreaSize(TestID, rmAreaTilesToFraction(500), rmAreaTilesToFraction(500)); rmSetAreaWarnFailure(TestID, true); rmSetAreaSmoothDistance(TestID, 0); rmSetAreaCoherence(TestID, 0.8); rmSetAreaCliffType(TestID, "SPC Caribbean"); rmSetAreaCliffHeight(TestID, rmRandInt(6, 8), 1.0, 1.0); rmSetAreaCliffEdge(TestID, 3, rmAreaTilesToFraction(2000), 0, 10, 0); rmSetAreaElevationOctaves(TestID, 3); rmSetAreaObeyWorldCircleConstraint(TestID, false); rmSetAreaLocation(TestID, 0.5, 0.5); rmSetAreaHeightBlend(TestID, 100); rmBuildArea(TestID);
int TestID=rmCreateArea("Test ID Area"); rmSetAreaSize(TestID, rmAreaTilesToFraction(500), rmAreaTilesToFraction(500)); rmSetAreaWarnFailure(TestID, true); rmSetAreaSmoothDistance(TestID, 0); rmSetAreaCoherence(TestID, 0.8); rmSetAreaCliffType(TestID, "SPC Caribbean"); rmSetAreaCliffHeight(TestID, rmRandInt(6, 8), 1.0, 1.0); rmSetAreaCliffEdge(TestID, 1, 1.0, 0.1, 1.0, 0); rmSetAreaElevationOctaves(TestID, 3); rmSetAreaObeyWorldCircleConstraint(TestID, false); rmSetAreaLocation(TestID, 0.5, 0.5); rmSetAreaHeightBlend(TestID, 100); rmBuildArea(TestID);

rmSetAreaCliffEdge大概是在边缘生成额外悬崖 rmSetAreaCliffEdge(int areaID, int count数量, float size大小, float variance高度浮动, float spacing???, int mapEdge???) --------------------------------------------------------------------------- 创建悬崖还可以使用rmAddAreaInfluenceSegment(int areaID, float xFraction1, float zFraction1, float xFraction2, float zFraction2): Adds an area influence segment. 生成根据两个坐标连成的直线生成额外悬崖。 rmAddAreaInfluenceSegment(TerrainID, 1.0, 1.0, 0.0, 0.0);添加后,如果定位点在rmAddAreaInfluenceSegment的直线范围里面,会额外生成一条直线地形。例如rmSetAreaLocation为0.5,0.5;而rmAddAreaInfluenceSegment第一个点为1.0,1.0,第二个点为0.0,0.0,那么1.0,1.0到0.0,0.0之间会生成额外地形,大小依然为rmSetAreaSize定义的大小。(似乎还有什么影响着悬崖大小......) int TestID=rmCreateArea("Test ID Area"); rmSetAreaSize(TestID, rmAreaTilesToFraction(500), rmAreaTilesToFraction(500)); rmSetAreaWarnFailure(TestID, true); rmSetAreaSmoothDistance(TestID, 0); rmSetAreaCoherence(TestID, 0.8); rmSetAreaCliffType(TestID, "SPC Caribbean"); rmSetAreaCliffHeight(TestID, rmRandInt(6, 8), 1.0, 1.0); rmAddAreaInfluenceSegment(TestID, 0.0, 0.1, 0.6, 0.6); rmSetAreaElevationOctaves(TestID, 3); rmSetAreaObeyWorldCircleConstraint(TestID, false); rmSetAreaLocation(TestID, 0.5, 0.5); rmSetAreaHeightBlend(TestID, 100); rmBuildArea(TestID);
再把rmSetAreaCliffEdge加上去 int TestID=rmCreateArea("Test ID Area"); rmSetAreaSize(TestID, 0.1, 0.1); rmSetAreaWarnFailure(TestID, true); rmSetAreaSmoothDistance(TestID, 0); rmSetAreaCoherence(TestID, 0.8); rmSetAreaCliffType(TestID, "SPC Caribbean"); rmSetAreaCliffHeight(TestID, rmRandInt(6, 8), 1.0, 1.0); rmSetAreaCliffEdge(TestID, 1, 10, 1, 1, 0); rmAddAreaInfluenceSegment(TestID, 0.0, 0.0, 1.0, 1.0); rmSetAreaElevationOctaves(TestID, 3); rmSetAreaObeyWorldCircleConstraint(TestID, false); rmSetAreaLocation(TestID, 0.5, 0.5); rmSetAreaHeightBlend(TestID, 100); rmBuildArea(TestID);
可以添加多个rmAddAreaInfluenceSegment int TestID=rmCreateArea("Test ID Area"); rmSetAreaSize(TestID, 0.1, 0.1); rmSetAreaWarnFailure(TestID, true); rmSetAreaSmoothDistance(TestID, 0); rmSetAreaCoherence(TestID, 0.8); rmSetAreaCliffType(TestID, "SPC Caribbean"); rmSetAreaCliffHeight(TestID, rmRandInt(6, 8), 1.0, 1.0); rmSetAreaCliffEdge(TestID, 1, 10, 1, 1, 0); rmAddAreaInfluenceSegment(TestID, 0.0, 0.0, 1.0, 1.0); rmAddAreaInfluenceSegment(TestID, 0.5, 1.0, 0.5, 0.0); rmAddAreaInfluenceSegment(TestID, 0.0, 1.0, 1.0, 0.0); rmAddAreaInfluenceSegment(TestID, 0.0, 0.5, 1.0, 0.5); rmSetAreaElevationOctaves(TestID, 3); rmSetAreaObeyWorldCircleConstraint(TestID, false); rmSetAreaLocation(TestID, 0.5, 0.5); rmSetAreaHeightBlend(TestID, 100); rmBuildArea(TestID);
--------------------------------------------------------------------------- 补充:峡谷地形 int TestID=rmCreateArea("Test ID Area"); rmSetAreaSize(TestID, 0.1, 0.1); rmSetAreaWarnFailure(TestID, true); rmSetAreaSmoothDistance(TestID, 0); rmSetAreaCoherence(TestID, 0.8); rmSetAreaCliffType(TestID, "SPC Caribbean"); rmSetAreaCliffHeight(TestID, -10, 1.0, 1.0); rmSetAreaCliffEdge(TestID, 1, 10, 1, 1, 0); rmSetAreaElevationOctaves(TestID, 3); rmSetAreaObeyWorldCircleConstraint(TestID, false); rmSetAreaLocation(TestID, 0.5, 0.5); rmSetAreaHeightBlend(TestID, 100); rmBuildArea(TestID);
删除rmSetAreaCliffEdge后
---------------------------------------------------------------------------


请问rmSetAreaCliffEdge到底怎样控制?请问!@#¥%……&*这是什么?

本次教程还没有结束,但是作者跑了。