Jump to content

New Spline Paint, Height, CSV, Field Creation(Dimension) Panel Scripts


WrinkleysRule

Recommended Posts

  • Wrinkley

I have updated these scripts to use the new pop up panel format currently in GE 9.0.4.

The original scripts will still be available should you prefer to use them as sometimes the operation of these new versions may seem a little slower.

Refer to the relevant tutorials on ways of using these new scripts

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

Create Field Dimensions and Farmlands Tutorial

 Spline Panels.zip available at the end of this topic

Installation, copy paste the Spline Panel folder into the

C:/Users/Your Computer Name/AppData/Local/GIANTS Editor 64bit 9.0.4/scripts

Folder.

Spline Paint Panel

This is the updated version of the Spline Paint script and no longer needs a separate Set Up script to create User Attributes or a separate Terrain Layers script to print the terrain Layer no as a reference.

The script itself works roughly the same way as the previous version so parts of the tutorial are still relevant regarding operation.

Texture’s are now automatically read from the map.i3d and selected by using the relevant drop down arrows, any additional textures created and added to the map.i3d will also be automatically added to the drop down selections.

 

The script only needs to be activated once further execution is done via the Paint Button.

To activate the Paint Terrain by Spline pop up, in GE  -- Scripts—Spline Paint Panel the following panel will it appear.

qR8lhjk.png

Measurements can be inputted manually (recommended) or by using the sliders <> next to the relevant boxes.

Example image showing texture drop down with DIRT Selected

EOhFy3d.png

Once you have made your selections ensure the spline is selected (if no spline selected a warning will appear in the console log) and select the Paint button at the bottom.

Other splines can be used simply by selecting them adding  any new settings and selecting Paint.

Random Paint is carried out the same as before, this time by selecting Selected in the drop down then add your settings and select the Paint Button.

Individual sides of random paint(left or right) can also be selected by selecting -1 (at the bottom of the drop down list) in the non painting edge texture drop down.

Spline Height Panel

 

This updated script no longer requires a separate Set Up script or use User Attributes to work.

 Activate the Set Terrain Height by Spline  pop up in GE  by selecting Script—Spline Height Panel this only needs to be done once in each session as the Panel can be used with other splines without further activation, execution of any new settings being carried out by selecting the Set Height button

nwgKA5I.png

The settings can be set either manually or by using the slider <>.

A spline can be selected before or after filling in the various settings, if a spline is not selected a warning will appear in the console log prompting you to select a spline

When happy with values and with a spline selected, select the Set Height button at the bottom of the panel to activate the script.

There are some restrictions on minimum/maximum values,

Set Centre Width –  0 to 255m

Set Spline Height --  -50 to 255m (-50 to allow for spline transformations on higher terrain)

Set Edge Width --  0 to 50m

Set Edge Height Left/right -- -20 to 20

Set Edge Smooth Left/Right – 1 to 20

Set Distance Between Points – 0.5  to 100

The existing tutorial on Spline Height can still be used for reference.

 

An updated version of the Spline CSV Creator Panels script is available here

https://farmerboysmodding.com/index.php?/topic/2471-spline-csv-creator-panel-updated/

This new version creates a spline.obj file from the newly created spline for direct import into Blender without the need to convert from a .csv file

 

This spline.obj will still need converting to a curve in Blender to create roads etc.

 

Spline CSV Creator Panel

This updated script again no longer needs a Set Up script to initialise User Attributes to work.

It now does not need a map name inputted as the script  automatically puts the CSVdata folder created by the script and containing the new spline.i3d and splineCsvData.txt files in the same folder as the map.i3d

 

 

Activate the CSV Creator pop up by selecting Scripts – Spline CSV Creator Panel in

 

W1pETKW.png

 

Select a spline, enter the distance required between CSV points and select the Create CSV button.

Other splines can also be used by repeating the above ensuring that any new splines have a different name.

Used in conjunction with the Blender Plugin for CSV Data

 

 

Field Creation(Dimension) Scripts

These are in a separate folder called Field Creation Scripts and consist of three separate scripts

that are needed to perform a complete field creation.

Create_FieldDimensions Panel

The pop up Create Field Dimensions is activated in GE by selecting Scripts—Field Creation Scripts - Create Field Dimensions Panel

No further activation is required as further script execution is now done by the Create Field Dimension button

The FieldDimension_SetUp script is no longer required as the Create Field Dimensions Panel script when activated now automatically creates a new transform Group in the scenegraph 'Field_Creation_Transform' with all the required transform groups.

MKEbl0K.png

 

Create_Field_Dimension pop up

VNsffPY.png

The Main Fields transform to create the fieldDimensions will be the fieldsNew –fields transform group and Markers transform newFieldMarkers – Markers.

Field dimensions created for the Paint Farmland Field xml Panel will use the farmlandDimensions –fields transform group and the same Markers TG (once the markers have been reset to suit)

Once the markers are created select the relevant fields transform enter the field no and select the Create Field Dimension button to execute the script.

Any duplicate field numbers will activate a warning text in the console log.

 

Paint Farmland Field xml Panel

This panel is activated in GE by selecting Scripts—Field Creation Scripts – Paint Farmland Field xml Panels Panel.

As is the case with the other scripts no further activation is required as all execution is done by the Create Farmlands button

kRDHgD8.png

 

Set Path to XML – gives two choices farmlands.xml, if your farmlands.xml is in the same folder as your map.i3d or xml/farmlands.xml if you farmland.xml is in a separate xml folder in your map.i3d folder.

These two paths are the most commonly used by map makers if you have the farmlands.xml elsewhere then I suggest moving it temporarily to the map.i3d folder.

 

Set Total Fields – this is adjustable either by manual entry (recommended) or by the slider <> between 1 and 255 the 130 is an arbitrary figure farmlands.xml entries will still only show your actual field numbers.

 

Set Land Price – is the multiplier applied to any land prices adjustable either by manual entry (recommended) or by the slider <> between 0 and 10

 

Set NPC Area – Allows choosing of an NPC area "ALPINE","US","FR" from the drop down selection can be different for each field if required.

 

 

Number of Different NPC’s  -- This is the number of different NPC’s available in the base scripts a number between 1 and 15 is randomly chosen by the script or can be selected manually for each field ownership created. Number can be increased if map maker has added extra NPC’s.

 

Show on Farmlands Screen – If Yes then the field is shown on the games Farmlands screen, No the field will not be shown, used in cases where the farmland is bought with a placeable i.e. BGA

 

Default Farm PropertyYes assigns that field to the ownership of the default (player) farm, No field is then buyable in the normal manner.

 

Once all the relevant details have been entered select the  farmlandDimensions –fields –field01 for example and select the Create Farmlands button.

The infoLayer_farmlands.grle will have been painted (can be checked in GE by selecting the Terrain Info Layer Paint Mode together with the Info Layer –farmland and the Lands Farmlands number) and an entry for that field created in the farmlands.xml the field number being obtained from the field name i.e field01 will be Field01 in the farmlands.xml

Warnings will appear in the log if a field number already exists in the farmlands.xml

Subsequent fields can be created by selecting the next field number in the farmlandDimensions –fields transform and selecting Create Farmlands

 

I have included the Paint Field Ground Foliage script (although not yet updated, WIP) together with its reference image, in this folder to keep all the scripts for Field Creation together.

A little tip for speedily resetting the markers to create the new field dimensions for the Paint Farmland Farmlands xml script is to  scale the X and Z axis by a factor of 0.1/2 depending on size required, (marker size has no effect on actual position) but bear in mind the scaling will be done with reference to the Markers TG (fieldmapIndicator position) so could appear distorted depending on position

 

Spline Place and Spline Foliage scripts will also be updated to use the new pop up panel system in due course.

 

 

Further information and guidance can be currently found in the  Create Field Dimensions and Farmlands Tutorial, though this will also be updated in due course to reflect the changes.

 

 

 

Spline Panels.zip

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi there, I am using previous scripts for Terrain Paint just fine, and I'm also using the Spline CSV Creator Panel with no issues.  However, the Spline Paint Panel causes GE to freeze up.  GE log doesn't say anything.  How do I troubleshoot this?  I love the easier use of these scripts and would like to be using them all.  Thanks!

 

image.thumb.png.b26a28bc2735dd27d24e610357743466.png

Link to comment
Share on other sites

  • Wrinkley

I did mention at the start of this topic that the newer  versions of the scripts seem to be a bit slower

However, the script appears to freeze when the area to be painted is quite large and in your case this appears to be so with a centre width of 8m and two edge widths of 8m giving an overall 24 m painting area along what looks like a full map width of 2k

The script is still working if the Paint button is still Blue (which your image shows),  you can also check by left clicking the viewport, the red X on the top right of the panel will appear along with an hour glass in the viewport and disappear when the script has finished (along with the Blue colour on the Paint button).

You can speed the process up by setting the Set Texture Distance to 1 which shouldn't have too much effect on the final paint (some edges may appaear a bit more jagged)

Edit; 14.26 10/06/23

The GE Paint Terrain By Spline script (Scripts -Terrain--Paint Terrain By Spline ) has a maximum width (single width no edges) of 10m, whereas I have set the width of both Centre and edge Width to a max of 255, perhaps I in a future update I should reduce both down to a maximum of 10m including edges for the script to work the same as the base script.

Link to comment
Share on other sites

  • 3 months later...

Hi all, 

I found and corrected an issue in the SplinePaintPanel.lua:

The script took ages for me to finish, especially on longer splines, therefore I started searching the code what causes this. The reason for the script being unneccesary slow is the inner loop where the textures are painted, at

for i = 0, mSideCount,mSplinePiecePoint do

I think you would want to use mSplinePieceP (which is the same as texDistance) instead of mSplinePiecePoint. mSplinePiecePoint is defined as the current percentage of the length of the spline. So you are making way too small steps / too many loops for painting to the left and right of the spline. 

The other scripts don't have this issue.

Kind Regards,

Nadine

Link to comment
Share on other sites

  • Wrinkley

The script is deseigned that way to allow you to vary the distance between the textures , you can adjust the distance bewteen textures (and consequently the number of loops) --Set Distance between Textures

"mSplinePiecePoint is defined as the current percentage of the length of the spline "      incorrect  mSplinePiecePoint is defined as fraction(decimal) of the length of the spline,  full length of the spline is mSplinePiecePoint = 1

For reference check the GE version script --Window --Script Editor - Select Editor Utils -- scroll to line 490 (lines 443 to 503 show the complete script)

 

Link to comment
Share on other sites

  • Wrinkley

Create FieldDimensions script.

A problem entering decimal numbers into the field angle attribute has arisen

A simple fix is in Giants Editor open the script in the SCript Editor, navigate to line 139 and change

setUserAttribute(field, "fieldAngle", "Integer", 0)

to

setUserAttribute(field, "fieldAngle", "Float", 0)

and save the script

The main zip files will be updated in due course.

There is no need to redo any exsisting field dimensions

All that is required is to open the map.i3d in notepad ++and useing the Search function place the following in the Find what panel

name="fieldAngle" type="integer" value="90"/>

and selecting the Replace tab place in that panel

name="fieldAngle" type="float" value="90"/>

then Select Find Next and replace for each exsisting field Dimension.

You can just select Replace All but that sometimes can replace other items if you do want to use that Option make sure that

Search Mode is set to Normal and Match Whole Word Only is selected.

Pay particular attention to the upper Lower Case in the script it has to be ' Float' but in the i3d it is 'float' otherwise you will get errors in the GE console Log

Link to comment
Share on other sites

  • 2 weeks later...

I encountered an issue after installing this. After install my editor decided it no longer wanted to respond. oddly when I unplugged my second monitor it started working again. Any resolution to this?

Link to comment
Share on other sites

  • Wrinkley

What version of Giants Editor are you using and is the game  installation path correct in Preferences Game Installation.

Quote

I encountered an issue after installing this.

Which script (if any) were you trying to use

I run three monitors without any problems, when using the editor I have the left hand monitor with any scripts/script editor, centre monitor is viewport only, right hand monitor is the Senegraph/Terrain editing/Material editing/console log etc panels

Link to comment
Share on other sites

Im using 9.0.6. The preferences are correct i had been using it all day. It works perfectly as long as i only have 1 monitor i even plugged the monitor back in and immediately it stopped working. As long as i had both monitors plugged in it wouldnt even open the program just immediate not responding.

Edit: it does the same thing no matter what script i put in the folder whether its specifically for 9.0.6 or not. Im trying to follow a video tutorial that uses this file here.

Link to comment
Share on other sites

  • Wrinkley

As it appears to be a Display problem I can only suggest checking your display settings in System -Display and ensure that everything is set up correctly.

Mine are set

Note: Make this my main display is normally greyed out when in Extend seclected

Extend these displays --Selected

Remember window locations based on monitor connection --Selected

Minimize windows when monitor disconnected  --Selected

Ease cursor movement between displays --Selected

Link to comment
Share on other sites

  • 2 weeks later...

in theory i should be able to draw a spline, paint terrain height by spline and use the tutorial abobve to create a road on said spline height adjusted roadbed and get a completely countured surface to the blender road i make, yes?

Link to comment
Share on other sites

  • Wrinkley

Providing you follow the Tutorials for the each script you use, yes

"get a completely countured surface to the blender road i make, yes?"

To create a road aligned to the terrain in Blender you must first create a spline in GE and set the terrain height correctly for your road

then import the spline int o Blender and create your road from that spline.

 

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