Jump to content

Updated Spline, CSV, Height, Paint, Place, Scripts


WrinkleysRule

Recommended Posts

  • Wrinkley

NOTE:

These scripts are personal edits of original scripts by various authors ( Stegei, Evgeny Zaitsev, Nicolas Wrobel,TracMax and W_R ) and posted on the FarmerBoysModding site
for members of the FarmerBoysModding community's personal use and not intended for any general public release.
Furthermore they are posted on the understanding that NO monetary gain whatsoever,regardless of source can be made from all or parts of them by any person(s).
Including but not limited to, Patreon, soliciting for or requiring donations for work done for any purpose, posting on a website that gives any form of remuneration per download or view.

Copyright remains with the original creators of these scripts.

 

It would appear there has been some confusion with the new and old versions of these scripts so to avoid any confusion delete any previous versions of these scripts before installing these new versions and read the New Tutorials relevant to the script you are using.

24/05/23 --- Newer versions of some of these scripts available here

 

Installation

First a big thank you to Stegei, Evgeny Zaitsev, Nicolas Wrobel and TracMax  the originators of some of these scripts.

Whats New

All the scripts no longer require the use of the Script Editor and are now executed directly from the script dropdown in GE ,- Select--Scripts

The scripts now contain a set of Set Up scripts (Spline CSV Creator Set Up, Terrain Paint Set Up, Terrain Height Set Up and Spline Placement Transform ).

These have to be run before using the main script as they create in the User Attributes panel of GE the User Attributes required for each script.

They only require to be run once for each spline used whilst editing, also if the map is saved between edits the User Attributes created are also saved to the spline used so the setup script does not have to be run again when the map is opened for subsequent edits.

 

Because of the various changes/updates to all the scripts it is recommended that all previous versions be deleted before installing the new versions.

 

Download and unzip the Updated Spline Scripts.zip, and copy/paste the contents as laid out in the zip directly into

C:\Users\Your Computer name\AppData\Local\GIANTS Editor 64bit 9.0.3\scripts

The Updated Spline Scripts.Zip  contains the following files,  a brief description of each follows, further detailed information is contained in the relevant tutorials.

 

Spline CSV Creator Set Up           Creates in Giants Editor User Attributes Panel the User Attributes for the 

Spline CSV Creator script.

 

Spline CSV Creator                          Creates a new Spline.i3d aligned to the terrain with the CSV distance set by the

CSV Distance attribute in the User Attributes panel,  also created is a

 Spline CSV data .txt both are placed in the new  CSVdata  folder created in the root folder of your map.

Requires Spline CSV Creator Set Up to be executed first.

 

 

 

Terrain Paint Set Up                       This script prints the terrain layer textures numerically in the Giants Editor Console

 log.

It also creates in the Giants Editor User Attributes panel the necessary User Attributes  for the Terrain Paint  script operation..

Terrain Paint                                      For painting along the spline using map terrain textures, different textures can be

 selectedand painted for the centre and left and right edge areas.

Requires Terrain Paint Set Up to be executed first.

Terrain Height Set Up                    Creates in the User Attributes panel of Giants Editor the necessary User Attributes

 for the Terrain Height script

Terrain Height                                  Allows for setting the terrain height using a spline and has independent height

 settings for centre width, left and right edge width.

Requires Terrain Height Set Up to be executed first.

Spline Placement Transform      Creates a splineObjects transform group with the correct hierarchy in the

 Giants Editor Scenegraph and in User Attributes panel the User Attributes necessary

 for the operation of the Spline Placement script.

Spline Placement                           Places objects along a spline at terrain height at fixed or random distances

along/around and either side of the spline

                Requires Spline Placement Transform to be executed first

Spline Placement Delete             Deletes ALL objects in the placedObjects  transform group.

                                -----------------------------------------------------------------------------------------------------------------

 

 

 

Giants Editor Spline Scripts User Attributes

Brief description of the various User Attribute settings, further information available in the relevant tutorial.

 

Note:

If the map is saved the User Attributes created will be saved (complete with settings) to the relevant Transform Group/Object and will be available when the map is reopened, as such to avoid complications with the save if any of the individual User Attributes are deleted (by selecting the red X) then the next time any of the scripts are run a warning will be printed in the Console log, example below

\ WARNING\

                ATTRIBUTES ERROR

                  PLEASE RESELECT

                SPLINE PLACEMENT  TRANSFORM

The User Attributes will then have to be set up again by reselecting the named Set Up script in the above case the error is with the Spline Placement  script

Spline CSV Creator script

User Attributes created after selecting Scripts-- Spline CSV Creator Set Up

T0rYI2Z.png

Terrain Height script

User Attributes created after selecting Scripts—Terrain Height Set Up

B0cVhv1.png%20%20

Terrain Paint script        

User Attributes created after selecting Scripts—Terrain Paint Set Up

2UudFBv.png

 

The letters in brackets on the left of each Attribute name are there to ensure correct layout if more than one set of spline attributes are set up on a single spline, the script name is also entered to separate the individual Script Attributes, example below.

wi1W8mB.png

Spline Placement script

This script isn’t affected by the multiple attributes problem (shown above)  although it still uses the same spline as the rest the Attributes are assigned to the splinePlacementTransform not the spline itself.

User Attributes created after selecting Scripts—Spline Placement Transform

BVZYV8E.png

To avoid errors and having to repeat the various Set Up scripts it is advisable not to delete any of the

User Attributes until work has finished using the particular spline after which they can be all deleted if required.

 

Further information available from the tutorials

 

Export a Spline from Giants Editor Into Blender to Create Roads/Railways (Updated)

Terrain Height, Paint Terrain and Spline Placement scripts (Updated)

 

Note:

Before using any of these scripts on a current Work In Progress (WIP) map, it is recommended that a blank starter map is used to experiment and get familiar with the scripts, settings, executions and results.

Read the New Tutorials as the operation and execution  of all the scripts has changed.

 

 

 

 

 

Updated Spline Scripts_18.12.2022.zip

  • Like 1
  • Thanks 4
Link to comment
Share on other sites

when i tried new the placement script i get this error 

Quote

Warning (script): 'getNumUserAttribute': Argument 1 has wrong type. Expected: Int. Actual: Nil 
  D:\auto_builder\cache\svn\62f28a84498cda5975f048d2294ab8f7\src\base\scripting\lua\LuaScriptSystem.cpp (903): expectedType == Value::VoidType || expectedType == Value::ClassType
LUA call stack:
  =C:/Users/jdunn/AppData/Local/GIANTS Editor 64bit 9.0.3/scripts/farmerboymoddingscripts/splinePlacement.lua (62) : getNumUserAttribute

    \  WARNING\
    ATTRIBUTES ERROR 
      PLEASE RESELECT 
    SPLINE PLACEMENT TRANSFORM

 

Link to comment
Share on other sites

  • Wrinkley

 

So, have you with the splinePlacement transform group selected then filled in the relevant User Attributes and with the splinePlacement transform group still selected, selected the Spline Placement script to place the objects.

 

The splinePlacement transform group has to be selected when entering the User Attributes and also when the  Spline Placement script is run.

Link to comment
Share on other sites

  • Wrinkley

Apologies, I have just noticed an incorrect instruction in the Spline Placement Transform script printed in the Console log, the last line should read,

Set Attribute Values then Select 'Spline Placement' script to Execute

and not

Set Attribute Values then Select 'Place Objects 2' script to Execute

I have altered it and included  the corrected version in the Updated Spline Scripts at the bottom of the tutorial.

 

Link to comment
Share on other sites

  • Wrinkley

The scripts have now all been updated (28/10/22.)
The man difference is in the Spline CSV Creator and Spline CSV Creator Set Up scripts, these have now been changed so that all inputs are done from the User Attribute Panel in Giants Editor.
There is no longer any need to copy/paste the spline.i3d or spline__CSV data from the Giants Editor log.txt this is now down automatically by creating a new folder (CSVdata) in your map root folder and creating a new spline_CSV.i3d and spline _CSVdata.txt in that folder.

Brief view operating the Spline CSV Creator and Spline CSV Creator Set Up scripts,


Open Map in Giants Editor,


Create a spline and align it to the road/rail network you wish to model, naming it accordingly.
The spline can be called any name as long as it has the word spline in it i.e. road01_spline,  spline_2 etc,
the name chosen will also be the name of the spline.i3d and spline_CSVdata.txt  created in the CSVdata folder in your map root folder.


Select --Scripts --Spline CSV Creator Set Up
Insert map name in the (b).Map Name attribute --Full name must be entered note also the entry is case sensitive.
Enter required value in the (c).CSV Distance attribute.


With the spline selected, Select -- Scripts --Spline CSV Creator .
A new Spline.i3d  with your chosen Spline name will be placed in a newly created CSVdata folder in the map root folder along with a Spline_CSVdata.txt file.

(For this example a spline name of road01_spline and a map name of Manor Farm has been used)
The message ‘New Spline: road01_spline_CSV.i3d and  road01_CSVdata.txt created in Manor Farm / CSVdata Folder’ will also appear in the consol log


The new road01_spline.i3d can be imported directly into the map in GE by selecting File-Import and navigating to the CSVdata folder in the map root folder and selecting the road01_spline_CSV.i3d which will then appear at the correct location in your map.
The road01_CSVdata .txt  is for use with the csv_importer script in Blender 2.79(only at the moment) and can be referenced in Blender directly from the CSVdata folder.

All the other scripts and tutorials have been updated to reflect this new change.
 

  • Thanks 1
Link to comment
Share on other sites

  • Wrinkley

Added Updated scripts due to a couple of errors in Spline Placement script.

Line 62 should read ---   local monitor = getNumUserAttribute(splPl)       not   ---local monitor = getNumUserAttribute(mSplineID)

Line 74 should read --- local scaleHigh= getUserAttribute(splPl, "(h).Set Scale High ")           not  --- local scaleHigh= getUserAttribute(splPl, "(h.)Set Scale High ")

Apologies for errors

 

Link to comment
Share on other sites

  • Wrinkley

In the User attributes there is a setting for adjusting the distance between textures when painting "(s).Set Distance Between Textures" which is set by default at 0.5, try lowering this figure to say 0.25 and see what result you get.

Your image is almost the same as the example image in the tutorial of a setting of 1.5 in the "(s).Set Distance Between Textures" attribute.

Link to comment
Share on other sites

  • Wrinkley

To overcome this problem change the following in the Terrain Paint script  at  line 99    "for i = 0, mSideCount, 1 do" to --- "for i = 0, mSideCount, mSplinePiece do" this will set the texture paint distance to the "(s).Set Distance Between Textures" value

I will do some further tests before updating the main scripts to this new setting

 

Link to comment
Share on other sites

  • 2 weeks later...

@WrinkleysRule

is it possible to remake the terrainPaint script so that it draws not ordinary textures on a spline, but cultivated, etc in terrainDetail?

It would be very useful if want to get a field quickly and with precise edges without using gimp/photoshop...

so that they are drawn inside a closed spline

 

Link to comment
Share on other sites

  • Wrinkley

Unfortunately there doesn't seem to be any commands within the Giants Editor Lua set up that will allow painting of foliage or terrain detail by spline, unlike the textures which have the 'setTerrainLayerAtWorldPos' command

Why don't you just use the spline to create the field border, then using the Limit to Texture box in the FoliageLayer Painting panel  to paint the chosen Terrain Detail without overpainting the spline paint texture.

for example spline paint -- grass

foilage Layer --Terrain detail --Ground TYpe --Cultivated

Limit to Texture -- dirt  or whatever the terrain texture  is inside the  spline grass border area

Because of the way the terrain is painted you will only be able to get precise edges by painting in a North/South or East/West direction following the terrain sections.

You can also use the new field spline to place hedges/trees etc around your field, (removing sections for gateways manually of course)

The image below shows the result of the above settings although I have substituted the dirt texture for Rough Sand to give a clearer indication of the painting--- centre texture is the Terrain Detail ---Cultivated

 

OG11Dlp.png

Link to comment
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