andy5995 Posted October 16, 2024 Share Posted October 16, 2024 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 Link to comment Share on other sites More sharing options...
andy5995 Posted October 16, 2024 Author Share Posted October 16, 2024 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 Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted October 17, 2024 Share Posted October 17, 2024 We need a better tooltip for the Obstructors. Something like, "<Building> cannot be placed on this terrain." 1 Link to comment Share on other sites More sharing options...
andy5995 Posted October 19, 2024 Author Share Posted October 19, 2024 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. Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted October 20, 2024 Share Posted October 20, 2024 1 hour ago, andy5995 said: But the map generates very slow so I'm abandoning this method. How slow is it? Link to comment Share on other sites More sharing options...
andy5995 Posted October 20, 2024 Author Share Posted October 20, 2024 14 hours ago, Lion.Kanzen said: How slow is it? Longer than a minute on a large map. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now