Jump to content
Sign in to follow this  

Set Terrain Height, Paint Terrain and Spline Placement Scripts

Recommended Posts

First a big thank you to Evgeny Zaitsev, Nicolas Wrobel and TracMax  the originators of these scripts
This is an example/tutorial of what can be done using the set TerrainHeightBySpline, paint Terrain by Spline and splinePlacement scripts with a little modification to the some of the original scripts.
I have used a FS19 Starter map I created for this with extra textures added to it which accounts for the large number of textures listed in the paint Terrain by Spline script, however the textures used are the standard in-game textures
No extra smoothing has been done on any of the terrain as this is just an example.
As I am going to be using the same spline throughout I will use the  Spline Placement Create script to create the relevant transform groups before creating and adding the spline.
All the relevant values and parameters are shown on the right hand side of each image

set Terrain Height By Spline

The first Image shows the start with a spline already created using the Spline Placement Create script and inserted in the correct position in the transform group and ready to use the set TerrainHeightBySpline script


The modification to this script enables a smoothing of the edges by progressively lowering the height ( or raising) of the transform at a set distance from the centre of the spline/transform area it  also allows for different offset on either side (e.g.Left up Right down) . This makes final smoothing/blending a lot easier as it is partly carried out by the script itself

If using the one spline for multiple scripts it is advisable at this point to note the position of the spline as it will be moved when using the different scripts and will enable you to return to the original spline position should you to decided to do further terrain adjustments later on


Pic 1 shows how it can be used to create banks on either side of a roadway by selecting the spline and executing the script. The script text on the right hand side of the image shows the settings used.


The following are examples of using the setOffsetHeight to true and changing the mHeightR = mHeight + i/smooth and mHeightL = mHeight + i/smooth parameters to minus on one side and plus on the other and adjusting the local smooth parameter to create smoother edges when on a hill

Pic 3 No Smoothing


Pic4 local smooth to 10



Paint Terrain by Spline

Modification to this script now allows a width setting to the centre texture as well as seperate textures for left and right or just one single texture across the whole width selected from the centre texture.
Pic 5 shows the result of this modification, the script text on the right hand side of the image shows the settings used. Note the spline has been moved to the left by 1m so centre textures are in the middle of the roadway this is to compensate for the setTerrainLayerAtWorldPos parameter which offsets the textures by using the spline as an edge rather than middle.

Pic 5



A quick little conversion of one side by resetting the spline back to original position and adjusting the mHeightL = mHeight + i/smooth to mHeightL = mHeight - i/smooth all other parameters remaining the same to create a ditch on one side and a bank on the other.


Spline Placement_v1.3

A very useful script for placing objects on a map especially fences hedges trees, etc.

Notes on use

Make sure all the items translations/rotations in the addObject transform group are set to zero and all objects are aligned along their Z axis (easily done in GE by rotating the object until its aligned along the Z axis then Edit—Freeze Transformation – Rotation (making sure ONLY rotation box is ticked) otherwise you might find some hedges/fences are 90 degrees to your spline compared with the other objects.

This can be adjusted by the local internal,X,Y,Z rotation parameters in the script but will cause all other items in the transform group to be rotated as well.


If you make an error or are unhappy with the result you can either use the SplinePlacementDelete script, or select the relevant objects in the scenograph in the placedObjects transform group and delete them, then run the SplinePlacement script again.


When doing multiple placements at the same location with different parameters i.e. First run; Hedges with varying scale, Second run; Trees with random rotation, it is advisable to create new transform group/s in the scenograph and cut paste the result of each run into them re combining later into one transform group if required.


To increase the width between items when using randomOrder ,  add blank transform/s group into the addObject transform group between the items.

Remember to save the map after every different addition in case the script or GE fails.

It may be necessary to do final adjustments in GE as placement on bends/corners can be slightly out due to the length of the object being placed

The following images show some examples of its use together with various ways of placing objects by selecting the splinePlacement transform group and executing the script.
The script text on the right hand side shows the various settings used to achieve these results



Spline moved to the right bank, local object distance is set to 8 as hedge is 9m long randomOrder= true


Pic 8

Spline moved to left bank and using just one post5 section, local object distance set to 4.2 randomOrder = false,  further adjustment will be necessary to rotation of some posts especially on bends


Pic 9

Using 3 post 5 objects and 1 hedge, local object distance left at 4.2 randomOrder= true



Just an idea using a decal made from an old road dds to place lines on the road, decal size 7m x 4m local object distance 3.8. randomOrder= false. Obviously needs adjustment, but by rotating and scaling some of the decals on the bends quite a reasonably effect can be produced. You will find that some of decals will be below the road surface to start with, so create a transform group and cut paste the lines into it and adjust the Y translation to 0.05 also ensure the Rigid Body box is un-ticked if finally using in game.

Lines i3d included in zip file attached


I suggest experimentation on a blank map with the splines and scripts to see what effects are possible once mastered they will make map creation a lot quicker and easier

After downloading the attached Scripts and Liness.zip, unzip and  copy/paste the into Windows(C)--Users---Computer name---AppData--Local--GIANTS Editor 64bit 8.1.0-scripts folder.

Window--Script Editor and select the relevant script which will open in the script editor window

Open your map in GE and create a spline adjust it to the shape required.

To alleviate any problems which can be caused by rotating the spline, the best way is to use just one end of the spline .

After creating the spline delete the “S” cv  (key “Delete”) it will be automatically reapplied to the next cv which is the original rotation point of the spline, then use the “E” cv to create your spline area, adding cv’s as necessary using the “Insert” key


The instructions for each script are in the script headings

Further development of the scripts may occur from time to time


Scripts and Lines.zip

  • Like 1
  • Haha 1

Share this post

Link to post
Share on other sites

for anyone a bit confused, i used this to understand this a bit more and how to use the script editor, credits to Toranion modding https://www.youtube.com/watch?v=P1AcTjzFVMg

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...