User Tools

Site Tools


4rpl:commands:floodfillterrain

This is an old revision of the document!


Index

FloodFillTerrain

FloodFillTerrain(<-posX <-posZ <-minHeight <-maxHeight <-maxSize) ->listOfCells

Description

Returns a list of 2d vectors representing map coordinates that satisfy the following conditions:

  • The set is connected.
  • The set is empty or contains (posX, posZ)
  • The set is filled only with squares at height between min_height inclusive and max_height exclusive. (i.e. if set to 3 and 6, it will grab cells with a height of 3, 4, or 5.
  • MaxSize is the upper bound limit for cell iteration. It is not directly related to the size of the list that is returned. The number of Cells returned is the number of cells that fit the criteria specified.

Warning: This currently has a bug (current for 1.4), and will accept heights 1 tile below min_height, so a min height of 3 will add tiles with a height of 2 as well, but not tiles with a height of 1.

Examples

FloodFillTerrain(GetUnitCell(self) 1 20 999999) ->listOfCells

Index

4rpl/commands/floodfillterrain.1667654546.txt.gz · Last modified: 2025/02/14 14:56 (external edit)