Require Airbase to Intercept
-
@hepps Yeah, this should be doable in a similar way that scramble works. I'll just need to make sure to keep the existing functionality as well for maps that are already using it. Most likely either add additional parameters to canIntercept, a new unit property requiresUnitToIntercept, or property to require airbase.
Options:
1.<option name="canIntercept" value="true:germanAirfield:italianAirfield:japaneseAirfield"/><option name="canIntercept" value="true"/> <option name="requiresUnitsToIntercept" value="germanAirfield:italianAirfield:japaneseAirfield"/><option name="canIntercept" value="true"/> <option name="requiresAirbaseToIntercept" value="true"/> -
@redrum said in Intercepting ability attached to Airfields:
<option name="canIntercept" value="true"/>
<option name="requiresUnitsToIntercept" value="germanAirfield:italianAirfield:japaneseAirfield"/>This just happens so many times in mapmaking. You have to manually list all units that you know are all "things that obviously enable intercepting". The same happens when e.g. you have to keep listing all units that can accept a particular support, or units that can be targeted by a particular AA attack, etc. It would make things a hell a lot easier if we had macros, or definable unit / territory / etc. categories. Something like
<categories> <category name="enableIntercept" type="unit"> <element name="germanAirfield"/> <element name="italianAirfield"/> <element name="japaneseAirfield"/> </category> <category name="isAffectedByMyFavouriteTrigger" type="unit"> <element name="aLongListOfUnits"/> <element name="evenMoreUnits"/> <element name="youDontHaveToModifyAMillionTriggers"/> <element name="whenYouChangeAroundStuff"/> <element name="youOnlyHaveToModifyThisCategory"/> </category> </categories>and then
<option name="canIntercept" value="true"/> <option name="requiresUnitsToIntercept" value="enableIntercept"/>and
<attachment name="triggerAttachment_myFavouriteTrigger_No_13618567561" attachTo="Japanese" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_myFavouriteCondition_No_13618567561"/> <option name="unitType" value="isAffectedByMyFavouriteTrigger"/> <option name="unitProperty" value="attack" count="1"/> <option name="uses" value="1"/> </attachment>And if you decide that in the next version the unit evenMoreUnits is no longer worthy of being affected by all of the million triggers, you simply delete one line, instead of deleting one line from each trigger.
-
@redrum said in Intercepting ability attached to Airfields:
@hepps Yeah, this should be doable in a similar way that scramble works. I'll just need to make sure to keep the existing functionality as well for maps that are already using it. Most likely either add additional parameters to canIntercept, a new unit property requiresUnitToIntercept, or property to require airbase.
Options:
1.
<option name="canIntercept" value="true:germanAirfield:italianAirfield:japaneseAirfield"/><option name="canIntercept" value="true"/>
<option name="requiresUnitsToIntercept" value="germanAirfield:italianAirfield:japaneseAirfield"/><option name="canIntercept" value="true"/>
<option name="requiresAirbaseToIntercept" value="true"/>Option 3 seems like it would work best. Since you could make it (as with so many other properties) so that if it was not defined in the XML it would automatically default to "false" in all games. Thereby not affecting any existing game.
-
-
The other thing that I meant to add to this is to also allow for a count functionality the same as scrambling as well.
<option name="maxinterceptCount" value="2"/>
-
@hepps Alright, added suggested implementation details to the first post.
-
@redrum Just to clarify the first thing you added to the airbase is already in the code.
<option name="isAirBase" value="true"/>
-
@hepps Yeah, both first lines "canIntercept" and "isAirBase" already exist. Those are just to give context to the 2 new properties (1 on air unit, 1 on airbase unit) for requiring airbase and max count for interception.
-
@redrum To quote Neil Diamond.... "Good times never seemed so good".
-
@hepps Who is Neil Diamond?
Anyways, here is the PR: https://github.com/triplea-game/triplea/pull/4140
This has no impact on existing maps that don't use the new parameters. But allows maps to require airbase for interception just like scrambling. It also allows specifying the max number each airbase can send to intercept (default is infinite).
I tested it by editing TWW to have fighters require airfields to intercept and have a limit of 1. Here is the XML examples:
Airfield
<attachment name="unitAttachment" attachTo="britishAirfield" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="isAirBase" value="true"/> <option name="maxInterceptCount" value="1"/>Fighter
<attachment name="unitAttachment" attachTo="britishFighter" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="canIntercept" value="true"/> <option name="requiresAirbaseToIntercept" value="true"/>
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