Custom Terrain Generation


Changes how land and water are generated. Highly customizable.

4 months ago
0.16 - 1.1
994
Environment

g How to use custom scenario?

5 years ago

I tried one of your custom scenarios by entering "IslandifySquares(pattern, islandradius = 32, bridgelength = 48, bridgewidth = 2)" into the custom field. Upon generation i got a failure message.
How do i enter/use these kind of scenarios?

5 years ago

Unfortunately it is very hard for the mod to provide useful feedback when the user enters invalid lua code, so you just get a cryptic error message when the code fails. If you don't have experience working with lua (or coding in general) the simplest suggestion I can give is to try things that look like the examples in the Examples section. For your particular question hopefully the following information will help.

To use the information in the Full Listing section to make a valid input, you need to choose the pattern you want (here, IslandifySquares) and replace each of the parameters (pattern, islandradius, bridgelength, bridgewidth) with values of your choice. Sometimes you don't have to supply a value for some of the parameters, and a default will be chosen instead; so if you omit the fourth parameter to IslandifySquares you will get a bridgewidth of 2.

The first parameter of IslandifySquares is itself another pattern, so you need to choose which pattern you want to islandify. You see that "Cross(width = 1)" is a pattern, so let us choose the Cross pattern, but with a width of 4, which we would write as "Cross(4)". Now if we want the default values for islandradius, bridgelength, and bridgewidth, the code we enter is:

IslandifySquares(Cross(4))

which is the same thing as each of the following:

IslandifySquares(Cross(4), 32)
IslandifySquares(Cross(4), 32, 48)
IslandifySquares(Cross(4), 32, 48, 2)

By replacing "Cross(4)" with a different pattern and the numbers 32, 48, 2 with other numbers of our liking, we can get very different results. Looking in the Examples section, the "bridged maze 3" pattern is given by the code:

IslandifySquares(Maze3(), 50, 10, 4)

Let me know if you have any further questions.

New response