Jump to content

Recommended Posts

Posted

This tutorial will show how to create fields with/without islands using the Field-Island Splines script  in conjunction with the GE Field Toolkit  (Scripts –Shared Scripts– Map – Farmland Fields – Field Toolkit).

 

Download the Field-Island Splines  zip file (found at the bottom of this tutorial) and unzip, place the script in the following folder

Download the Field-Island Splines  zip file (found at the bottom of this tutorial) and unzip, place the script in the following folder

C:/Users/******/AppData/Local/GIANTS Editor 64bit 10.0.4/scripts  (replacing ****** with your computer name)

 

Field-Island Splines script

FieldIslandSplinesPanel.png.aa103a0a3a173b09cd3c6886bf994aa2.png

This script is in two sections the top panel section ‘Create new points from FieldSpline/IslandSplines’ is used for creating fields with or without islands it basically works by using a spline to create the field edge then using a second spline to create island shapes and when the Create New Points is selected it creates a new list of polygonPoints in the polygonPoints Transform Group.

If creating a field with islands then the field and island splines must be selected in order, top to bottom, if only creating a field then just select the field and Create New Points, field creation can then be carried on using the GE Field Toolkit.

The bottom panel section ‘Create new Field Spline from existing points’ is used when modifying existing fields, because of the different ways some fields are created (when adding Islands points placement accuracy is important) it may be necessary to create a new fieldSpline from the original polygonPoints .

When Create New Field Spline is selected a new fieldSpline ( with the name of the current field ) will be created using the existing points and placed in the polygonPoints Transform group the original points can then be deleted.

Because some base game mod maps fields do not close the spline correctly when the script is executed (Create New Field Spline) the script will  automatically add a new final point at the same location as the ‘S’ cv, so effectively closing the spline.

Islands can be created in any shape and once created saved in a separate folder so creating a ready made album of different shaped islands that can be used in any field.

 

The following sections show how the script can used.

Creating a Field with Islands from scratch

When inserting points one quick method is  to select CTRL ‘B’ and select the cv with the left mouse button,  keeping the left mouse button pressed move to the next placement point and press Insert repeat until shape completed

Open GE and select Scripts –Shared Scripts – Map – Farmland Fields – Field Toolkit to activate the Field Toolkit panel

In the Scenegraph select the fields Transform Group (TG)  (gameplay –fields), in the Field Toolkit pop up select Create Field a new field will be created in the fields TG (numbered in the next available value) in this case field2 (this is the field that will be created first in this tutorial), also in this TG is the polygonPoints,nameIndicator and teleportindicater transform groups.

Selecting the fields2 TG , CTRL ‘B’ , left mouse click to place the fields2 TG  at the entrance of your field ,the Field Notes panel will obscure the actual placement so in the Field Toolkit  under Field Notes select Toggle Visibility All to turn it off.

When placing fields it is best to place the field TG at the entrance to the field and move the fieldMapIndicator to the centre of the field if required and leave the teleportindicator at the field entrance

Select the polygonPoints TG and delete all the points.

In GE Select Create –Spline and cut/paste into the polygonPoints TG (do not middle mouse drag as it will assign new translations to the spline) name this spline fieldSpline02 (to avoid confusion when more than one spline is used) in the Attributes Panel -Shape Tab change the Spline Type to Linear  this spline type is the same format used by the Field Toolkit when creating fields.

Ensure you have the Translate Spline CV panels in the Attributes Transform Panel if not then Select – View – Show – Physics Selection – Enable All , the Translate Spline CV panels is required as some of the cv’s require accurate placement for the fields/islands to work correctly

Select the ‘S’ cv and delete it  -- This will align the start of the spline to the polygonPoints TG (0,0,0)

Select the ‘E’ cv and working clockwise place the spline around the edge of the field (using the method described earlier) place the final point as close to the ‘S’ cv then in the  Translate Spline CV panels set the X, Y, Z coordinates to 0 (zero) this will place the ‘E’ cv exactly on the ‘S’ cv (there is no need to close the spline), accurate placement is required otherwise problems will occur with the field generation.

Field Spline

1.fieldNew.thumb.png.9f4381503361f0590239640c8b9615a7.png

If just creating a field then Select the spline – Select Scripts –User Scripts -Field-Island Splines  and Select -Create New Points a new list of points will be created in the fields transform, delete or save the spline to another TG and carry on with the field creation using the Field Toolkit in the normal way.

Image below shows the spline selected, script executed , Toggle Debug Rendering activated, Align polygonPoints to terrain (this also calculates the new field size) and the insets shows the field Repainted and the various log entries.

2.fieldNew.thumb.png.31a0772445be99b7dbfbe63362da7322.png

 

Single / Multiple Islands

Create a second spline cut/paste into the polygonPoints TG   (immediately below the fieldSpline ) and rename it to islandSpline, (again in the Attributes Panel -Shape Tab change the Spline Type to Linear  ) then delete the ‘S’cv as detailed above.

With the ‘E’ cv selected draw out your shape (using the method described earlier) the images below show the creation of both single and multiple islands.

Single Island

newSingleIsland_1.thumb.png.47885ac7267020dfef548f4ba2f854eb.png

Multiple Islands

newMultipleIslands.thumb.png.dbbdc5b6cb93ed6f8fc5f86c4d7c637d.png

The following image shows a fieldSpline and a three island spline (islandSpline_3) being used to create a field with three islands (suitable for power/pylons installation)

 

threePaintedF.thumb.png.7623934761f871c3579b41e890414cc9.png

In the following image I have duplicated the islandSpline_3 and moved the islands individually to different parts of the field by box selecting (click drag) one of the islands and

moving it by the translation gizmo ( if box select is used Ctrl ‘B’ will place all points at the same location) to a different position, then with the spline selected freeze transform any rotation value

that has occurred during the island moving, repeating the method for the other islands before selecting Create New Points.

multiplepainted.thumb.png.a89c519b1634f3d1a6e3985de79d4617.png

The splines have to be moved (to another TG or deleted) before Aligning or Renaming the polygonPoints otherwise they will become point 1,2,3 respectively

Then In the Field Toolkit panel

Align Polygon Points to Terrain - Select – Selected Field

Rename Polygon Points - Select – Selected Field

Repaint Fields - Select – Selected Field

Validate - Select – Selected Field    Note: If you have a duplicate points warning in the console log then delete the duplicates and Rename Polygon points.

 

Modifying Existing Fields

For this part I will be using a US map created by the New Mod from Game option but the method should work with other maps, I will also be using the island_3 spline from the previous section.

With the field TG (in this case field14) selected, in the Field Toolkit Panel- Select Clear Fields (Selected Field), Clear Fruits (Selected Field), this should clear any terrain detail paint and any crops associated with this field.

With the  island_3 spline  imported into the map cut/pasted it into the polygonPoints TG and then adjusted by the box selecting (click drag) method to suit the proposed new layout 

Important, when adjusting the island sections ensure that they do not overlap or intersect with any other part of the spline otherwise problems will occur when the new field/island boundaries are created.

The image below shows the initial creation of the new island’s layout, the spline was rotated to suit the new layout , this rotation must be Freeze Transformed –(Edit – Freeze Transformations –Rotate) ensure that only the Rotation box is ticked if  the Translate box is ticked deselect it.

1A.thumb.png.a2aa1a2f628d9bcacd4507606ec743fe.png

Next with the spline selected, in the Field Island Splines panel select the Create New Points button this will create the new points from the spline and place them in the polygonPoints TG below the spline (Fig. 2)

Fig.2

2A.thumb.png.149bedac52b61d11e8b32ca7978b481d.png

 

The final steps are as follows,

Cut/Paste the spline into another place (TG) in the Scenegraph (otherwise it wil be renamed  as a point and cause problems ingame)

In the Field Toolkit panel

Align Polygon Points to Terrain - Select – Selected Field

Rename Polygon Points - Select – Selected Field

Repaint Fields - Select – Selected Field

Validate - Select – Selected Field    Note: If you have a duplicate points warning in the console log then delete all of the named points and Rename Polygon points.

Save the map and open in Game, below is an image of the farmlands panel and the islands with a Courseplay course confirming the new island layout.

ingame2.thumb.png.96aea2614ebc6f85dc903852bbf58910.png

 

 

 

 

Field Island Splines.zip

  • Thanks 1
  • WrinkleysRule changed the title to Create Fields with/without Islands using Splines

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