Shallow water crossings
Posted: Wed Mar 27, 2019 9:03 pm
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
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:
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:
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:
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:
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
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
Code: Select all
Locomotor@NAVAL:
Name: naval
Crushes: crate
TerrainSpeeds:
Water: 100
Shallow: 70
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
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: