Can you make Canals use conditions ?
-
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"/>
</attachment>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 ?Thanks
-
@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.
-
@Cernel right on thanks
-
Yeah, here was the most recent discussion: https://github.com/triplea-game/triplea/issues/344
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.
-
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

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login