andy5995 Posted October 16 Report Share Posted October 16 This is for https://github.com/0ad-matters/community-maps-2/issues/134 This works but I think there must be a better way. It seems crude, and the object (a placement obstruction) covers most, but not all, the tiles. Any suggestions? The usage of createArea() was already in the map script. The new code is the call to createDecoration() g_Map.log("Freezing water"); createArea( new MapBoundsPlacer(), [ new TerrainPainter("alpine_ice_01"), new TileClassPainter(clIce), new SmoothElevationPainter(ELEVATION_SET, heightSeaGround - 0.1, 0), ], stayClasses(clWater, 0)); createDecoration( [ [new SimpleObject("obstructors/placement", 1, 1, 0, 0)], ], [ scaleByMapSize(600, 1800), ], stayClasses( clIce, 0, ) ); 2 Quote Link to comment Share on other sites More sharing options...
andy5995 Posted October 16 Author Report Share Posted October 16 So this works, got some help from @Jammyjamjamman and @trompetin17 g_Map.log("Freezing water"); const IceArea = new createArea( new MapBoundsPlacer(), [ new TerrainPainter("alpine_ice_01"), new TileClassPainter(clIce), new SmoothElevationPainter(ELEVATION_SET, heightSeaGround - 0.1, 0), ], stayClasses(clWater, 0)); for (const position of IceArea.getPoints()) g_Map.placeEntityPassable("obstructors/placement", 0, position); 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted October 17 Report Share Posted October 17 We need a better tooltip for the Obstructors. Something like, "<Building> cannot be placed on this terrain." 1 Quote Link to comment Share on other sites More sharing options...
andy5995 Posted October 19 Author Report Share Posted October 19 On 16/10/2024 at 5:22 PM, andy5995 said: So this works But the map generates very slow so I'm abandoning this method. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted October 20 Report Share Posted October 20 1 hour ago, andy5995 said: But the map generates very slow so I'm abandoning this method. How slow is it? Quote Link to comment Share on other sites More sharing options...
andy5995 Posted October 20 Author Report Share Posted October 20 14 hours ago, Lion.Kanzen said: How slow is it? Longer than a minute on a large map. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.