Can you make Canals use conditions ?

  • Moderators

    Revisiting this. Tried a while back and couldn't get it to work. Anyway, can I add a condition to the "canalAttachment" ?
    I have this:

    <attachment name="canalAttachmentDanish" attachTo="113 Sea Zone" javaClass="games.strategy.triplea.attachments.CanalAttachment" type="territory">
    <option name="conditions" value="CDGneutralsModified"/>
    <option name="canalName" value="Danish Straits"/>
    <option name="landTerritories" value="Denmark"/>

    I get this error:
    Missing property definition for option 'conditions' in attachment 'canalAttachmentDanish'

    Looks as if "canals" doesn't work using "conditions". Is that right ? Is there a way around this if so ?
    I have the "condition" listed before the"canal" in the xml. I want to turn the "canal" on or off depending on "conditions". Can triplea do that ?


  • Moderators Admin

    @beelee Supporting conditions check for canals is something that has been requested a number of times, but nothing ever came out of it.

    In general, the way canals are coded is weird and arguably confusing, with the double attachments, and options doubled, as well (conditions would be too, if supported without restyling the whole canal attachements).

    For now, you can hack what you want by making a dummy "box" territory that is required by the canal and that is triggered under those conditions to the ownership of whoever is supposed to be able to make use of the canal. Normally ownership must exist since start turn, but if you change ownership directly with triggers without counting the territory as captured I suppose that should not apply, but you have to test it, to be sure.

  • Moderators

    @Cernel right on thanks

  • Admin

    Yeah, here was the most recent discussion:

    Honestly the biggest challenge here is dealing with all the existing maps. If we had a clean slate, I would design the attachments differently and allow for conditions.

  • Moderators


    well not any simple solutions it appears. I see it's closed now as well.

    If one were to start from scratch, could you then make the canal thingy like a game property or something to that effect ? Then the old maps would still work as long as the new canal thing wasn't activated ? Or would there be conflicts between the two that wouldn't allow it ?

    I'm guessing starting from scratch would be labor intensive from a time standpoint as well ?

    At any rate, thanks for the link and reply. My fantasy of actually trying to learn how to do stuff like that has run into the reality of my small cranium 🙂

Log in to reply