Shallow water crossings

they should be ship passable

Information and discussion for custom maps and mods.
Post Reply
User avatar
MlemandPurrs
Posts: 32
Joined: Wed Mar 27, 2019 8:40 pm

Shallow water crossings

Post by MlemandPurrs »

The diagonal bridges can be destroyed for passing through with an ship, if you place one of the linear muddy land bridges in your map however it will disrupt the flow of game, effectively dividing the water part of your map into two. In my opinion they should be ship passable for that reason alone as the current iteration limits map making greatly.

I have managed to implement this for my mod, simply:
for every tileset in tilesets\ add an duplicate of beach type, like this

Code: Select all

	TerrainType@Shallow:
		Type: Shallow
		TargetTypes: Ground
		Color: B09C78
then find the number of the muddy bridge templates looking through the editor, for example they are 247 until 252 in snow terrain
open the tilesetname.yaml, search for that Id:, change every Beach to Shallow under its definition Template@numbers: definition, like this:

Code: Select all

	Template@247:
		Id: 247
		Images: f01.sno
		Size: 3,3
		Categories: Bridge
		Tiles:
			0: Rough
			1: Road
			2: Road
			3: Shallow
			4: Shallow
			5: Shallow
			6: Shallow
			7: Shallow
			8: Shallow
then go into world.yaml, we will have to add movespeed for the new Shallow terrain into each locomotor definition so the units can move through the new terrain type, ive simply duplicated Beach= value for Shallow as it previously was Beach. like this:

Code: Select all

	Locomotor@NAVAL:
		Name: naval
		Crushes: crate
		TerrainSpeeds:
			Water: 100
			Shallow: 70
lastly it wouldnt look good and make little sense(other than possibly for balance reasons) if submarines can pass through the shallow water without having to surface to fix that add a GrantConditionOnTerrain and tweak the Cloak a bit, like:

Code: Select all

	Cloak:
		CloakTypes: Underwater
		InitialDelay: 0
		CloakDelay: 50
		CloakSound: subshow1.aud
		UncloakSound: subshow1.aud
		CloakedCondition: underwater
		Palette: submerged
		PauseOnCondition: cloak-force-disabled || shallowcrossing
	GrantConditionOnTerrain@CROSSINGFORD:
		Condition: shallowcrossing
		TerrainTypes: Shallow
I didnt simply use Beach directly as that had unwanted side effects of Ships able to go on coasts as the LST can does, i wanted to cross only those fords.

Also maybe better to split the Submarine definition into its own, so Submarine units inherit it rather than having to insert it into every Submarine's definition:

Code: Select all

^Submarine
	Inherits: ^Ship
	RepairableNear:
		Buildings: spen
	Targetable:
		TargetTypes: Ground, Water, Ship, Submarine
		RequiresCondition: !underwater
	Targetable@UNDERWATER:
		TargetTypes: Underwater, Submarine
		RequiresCondition: underwater
	Targetable@REPAIR:
		RequiresCondition: !underwater && damaged
		TargetTypes: Repair
	GrantConditionOnDamageState@DAMAGED:
		Condition: damaged
		ValidDamageStates: Light, Medium, Heavy, Critical
	Cloak:
		CloakTypes: Underwater
		InitialDelay: 0
		CloakDelay: 50
		CloakSound: subshow1.aud
		UncloakSound: subshow1.aud
		CloakedCondition: underwater
		Palette: submerged
		PauseOnCondition: cloak-force-disabled || shallowcrossing
	GrantConditionOnDamageState@UNCLOAK:
		Condition: cloak-force-disabled
		ValidDamageStates: Critical
	GrantConditionOnTerrain@CROSSINGFORD:
		Condition: shallowcrossing
		TerrainTypes: Shallow
	-MustBeDestroyed:

lawANDorder
Posts: 140
Joined: Tue Oct 24, 2017 3:20 pm

Re: Shallow water crossings

Post by lawANDorder »

Interesting. Will your mod be public at some day?

Post Reply