Canoe, bridge, garrison and occlusion

Hello,
I’m new to AOE2 modding, and I’m trying to modify the behavior of the Canoe for a custom scenario. Here are my requirement :

  • Canoe must be able to go through Bridge CD middle B and C
  • Canoe must accept garrison
  • Canoe must not attack unless there is a unit in garrison
  • Bonus : when crossing a bridge, the canoe must be occluded by the bridge

But I have some issue with my mod.

1) Canoe pass through bridge
1.1) Test with Water 2D bridge
I try to do that by creating a new terrain table only for the Canoe. I copy the terrain table 12, Water small wave and edit the flag for 28 Water 2D bridge to make it passable. But now the canoe can go everywhere, even in grass and I don’t understand why.
1.2) Test with 93 Moddable Walkable Shallows

  • I edit my bridge pieces to use 93 Moddable Walkable Shallows as Foundation terrain
  • I create a copy of the terrainn table 12 Water small wave and assign it to canoe
  • I remove the passable flat for terrain 93 Moddable Walkable Shallows in the different water terrain tables (small wave, medium wave and big wave)
    → This work fine for the canoe, but all other ships can also go through the 93 Moddable Walkable Shallows terrain. It’s like if the terrain tables is not doing anything.
    Am I missing something ? Is there some strange beahviour between the terrain tables and the terrain attribut “Type” that I don’t understand ?

2) Canoe must accept garrison

  • I change the class of the canoe from 22 Warship to 20 - Transport boat
  • I set the Garrison capacity to 5
  • I add the unit Trait “Garrison” (first checkbox)
  • Everything work perfectly

3)Canoe must attack only when there is a unit in Garrison

  • My idea was to use the flag “Enalbed” in the task “7: Combat” but I don’t think this flag can detect if a unit is in garrison.
  • I don’t know how to do that. if someone have an idea or an example in an existing mod it will help me.

4) Occluded (or remove the graphic) when crossing a bridge

  • I can probably make it work by using the Fog visibility flag and some trigger in the scenario editing mode, but it won’t be funny
  • I try to change the occlusion class of the canoe and the Z collision but it’s not working

If someone have some time and some idea to help me it will be very helpful.
Thanks in advance

Those bridges changed the terrain on which they are created, to make them “walkable” by everyone.

You can make a custom terrainTable so this terrain would be also crossable by the canoe, but then it will also be able to cross all the regular middle bridges not just the wodden.

I’m not sure that you can add a new TerrainTable in AGE, but normally you just need to copy the current terrain table used by the canoe (attribute can have different name, TerrainTable / Terrain Restriction) and then just change the terrain ID for the one used as “foundation terrain” on the bridge and make it passable instead of blocking.

You can easily do that with attributes now.

Not sure you can do that, but you can give it 1 dmg by default and then having some extra projectiles with the Secondary Projectile system, and then you give to those projectile the damage values you want. Main projectile always use the unit damage stats, while the secondaries use their own damage stats.

That’s hard to achieve actually. The only way to do that is by using an illusion with the bridge sprite anchor point. The canoe will be occluded by the bridge only after a certain X-Y position relative to the bridge, so the idea is to have nothing up to that specific point when the ship passes under the graphics to avoid the canoe to be “above” the bridge.

There is maybe also a way to change at which level the canoe sprite is rendered directly in its graphic setting. I don’t know exactly what value you’ll have to use, but it’s the “Layer” field of the graphic you’ll have to work with. You’ll have to manage to have the canoe using a layer that will automatically go under it.

I’m gonna study that after this answer and come back to you after if I find anything.

It’s not necessary, you can do that withotu change the class of the ship, you’ll just have different mouse cursor behavior / will need to add task to units so they recognize the canoe correctly on the garrison task. But your method works too yap.

Town Center. Study the Town Center, it’s only shooting when garrisoned with eligible unit. So it’s possible at some point. Docks also have that feature since the Last Chieftain, so if it’s not Hardcoded you can achieve it. Let’s just hope it’s not building only.

As mentioned above, it’s not with the unit attribute you’ll achieve that, but with the Canoe graphic setting directly, the “Layer” one.


So I’m gonna study your water issue because it’s not supposed to do what it’s doing.

Terrain Table 12 is “All - Bridge, ground impact”.

I think you just copied the wrong one, it’s Terrain Table 13 for Water Smal wave. Try do the exact same thing you did, but with a copied version of TT 13 instead of 12.