toska wrote: ↑Sat Mar 06, 2021 9:38 pm
Greetings, I would like to add vegetation to the stream boxes.
Which files decide which types of terrain contain vegetation and which does not?
Do you mean in the random map generator?
If so streams are actually placed by the following loop in BM_PopulateFromTileData() in /Data/Battle/Scripts/MapGenerateBattle.bsf
Code: Select all
// Streams, rivers and roads - also need to be done outside main loop (if streams trump roads where incompatible)
for (x = 0; x < width; x++)
{
for (y = 0; y < height; y++)
{
data = BM_GetTileDataX(x, y, 1);
border = 0;
if (IsValidTile(x,y) != 1)
{
border = 1;
}
if ((data == 11) || (data == 12)) // Stream data not generated outside border
{
PlaceTileByType(x, y, style, "WATER", 1);
if (GetUniversalVar("StreamSize") == 1)
{
PlaceTileByType(x, y, style, "MEDIUMSTREAMS", 0);
}
if (GetUniversalVar("StreamSize") == 2)
{
PlaceTileByType(x, y, style, "DEEPSTREAMS", 0);
}
}
if ((data == 16) || (data == 17))
{
PlaceTileByType(x, y, style, "WATER", 0);
}
if (((data == 6) || (data == 12) || (data == 17)) && (border == 0)) // Road
{
PlaceTileByType(x, y, style, "TRACK", 1);
// PlaceTileByType(x, y, style, "ROAD", 1);
}
}
}
You would need to place the vegetation objects after the
Code: Select all
PlaceTileByType(x, y, style, "WATER", 1);
line.
The hard part would be avoiding placing vegetation in the middle of the stream. That is why I didn't do it myself.
The actual stream overlays are placed automatically by the engine, so you have no control over which ones are used where - at least not without a lot of extra code, as used for rivers.