(Land-to-Sea Seamless Transitions)
Hello everyone! I'm bringing you a new script called Tide-Runners.
This mod allows units to automatically transform when moving between land and water.
Once a unit (like an Explorer) enters the sea, it instantly shifts into a coastal vessel.
Through a configuration table at the beginning of the script, you can define for each unit if it preserves movement points after transformation or if a notification is sent to the player.
In this tutorial, I show how to apply it ONLY to the Explorer, but I also provide playable rulesets below where it is already implemented for "Workers" and "Engineers" for testing.
Workers: Engineers:
So lets apply to the Explorer:
1) Define Unit Classes
Open the units.ruleset file and add the following unit classes:
These are copies of the Land and Sea unit classes, but with some 'flags' removed since they are specifically designed for non-military units.
Code: Select all
; ------------------------------------------------------------------------------
; Class for land units
[unitclass_land_ocean]
name = _("LandOcean")
min_speed = 1
hp_loss_pct = 0
flags = "BuildAnywhere", "DoesntOccupyTile", "ZOC", "TerrainDefense",
"TerrainSpeed", "Airliftable", "NonNatBombardTgt"
; Class for maritime units (coastal only)
[unitclass_ocean_land]
name = _("OceanLand")
min_speed = 2
hp_loss_pct = 0
flags = "ZOC"
; ------------------------------------------------------------------------------
Further down in the same file, modify the 'class' property for the units that will undergo transformation.
Note: The "Raft" unit is a copy of the Trireme but without transport capacity (transport_cap = 0).
Code: Select all
; Set the 1st class for the Explorer
[unit_explorer]
name = _("Explorer")
class = "LandOcean"
; Set the 2nd class (coastal)
[unit_raft]
name = _("Raft")
class = "OceanLand"
Open the terrain.ruleset file and add the classes to all terrains, except Deep Ocean, using the 'native_to' property.
If applicable, apply it also to the 'extras' Road, Railroad, Maglev, Fortress, and Fort.
Code: Select all
[terrain_forest]
name = _("Forest")
native_to = "OceanLand", "LandOcean",
"Sea", "Air", "Missile", "Helicopter", "Trireme"
Code: Select all
[extra_road]
name = _("Road")
native_to = "OceanLand", "LandOcean"
"Land", "Small Land", "Merchant", "Big Land"