Skip to content

Template for terrain heights

1 to 2 of 2
Posted October 12, 2020· Edited October 12, 2020

Some template to enter / import terrain heights using the scripting API:
Save this as SetHeight.nlvm and then use in the advanced tab the nl2script description editor to set SetHeight.nlvm as the Script Class there and after you saved the nl2script file in the same directory it can be executed using the Execute Plugin... function also in the advanced tab:

import com.nolimitscoaster.NoLimits;

public class SetHeight{
    public static void main(){
        float[][] heightData = {
            {10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 15.f, 15.f, 20.f, 20.f, 20.f, 15.f, 15.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 15.f, 15.f, 20.f, 20.f, 20.f, 15.f, 15.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 15.f, 15.f, 20.f, 20.f, 20.f, 15.f, 15.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 15.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f},
            {10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f, 10.f},
        };

        int startX = 377;
        int startY = 394;

        NoLimits.getEditor().getPark().setTerrainHeightsAtVertices(
                heightData,
                0, 0,
                heightData.length, heightData[0].length,
                startX, startY
        );
    }
}

you can use some spreadsheet software for example to edit / import and transform the terrain data, you can set up to 770 rows / cols.
startX and startY is the offset, counting starts at 0, ensure startX + the numbers of rows / start Y + number of cols is not larger than 770.

1 to 2 of 2