Subcategories

Recent Posts

  • @wc_sumpton There is no Non_Aligned turn step. Non_Aligned is a nominal player that is collection of territories and units that don't anything except defend. They have no steps. This is probably why your suggestions were not working.

    I can't leave them as neutral because

    You can only change control of territory if it has actual player assigned to it. I needed to allow the Soviet_Union to attack Non_Aligned territories but not the others

    I was surprised that foreach="$MajorPower$^$NeutralArea$:$NeutralSetup$" worked. The variable system was well coded..

    read more
  • W

    @rogercooper

    First off, I applauded the fantastic skill demonstrated. Next, I would like to humbly apologize.

    During the discussion under topic Transferring Unit Control when asked "Ireland changes ownership, but the unit remains Non_Aligned" the proper reply should have been "The units in Ireland will only change at Non_Aligned endTurn step. Using 'changeUnitOwners' with a value 'Soviet_Union' for Ireland means that any Non_Aligned infantry unit in Ireland will change to Soviet_Union control during Non_Aligned endTurn step, irregardless of territory ownership."
    I did not understand then the difference between 'changeUnitOwners' and 'captureUnitOnEnteringBy'.

    What happens if one of Non_Aligned units change either by setup or combat. IMHO 'captureUnitOnEnteringBy' would work much better.

    Again, I am sorry for any confusion or problems I may have caused. And again, the coding presented shows great skill.

    Cheers...

    read more
  • @rogercooper I want to post my complete solution as it has some tricks people might want to use. I was surprised that you can use both a cartesian join "^" and a standard join ":" in the same foreach structure.

    Another neat trick is that you can use Export/Export game.xml file to resolve all the for eaches. Useful if you want to check that the result is correct or if you need to customize some entries.

    <variableList> <variable name="MajorPower"> <element name="Britain"/> <element name="Soviet_Union"/> <element name="United_States"/> <element name="Western_Europe"/> </variable> <variable name="NeutralArea"> <element name="Afghanistan"/> <element name="Borneo/Celebes"/> <element name="Ethiopia"/> <element name="Finland"/> <element name="Iran"/> <element name="Ireland"/> <element name="Java"/> <element name="Rio de Oro"/> <element name="Spain"/> <element name="Sumatra"/> <element name="Sweden"/> <element name="Switzerland"/> <element name="Thailand"/> <element name="Tibet"/> </variable> <variable name="NeutralSetup"> <element name="infantry"/> <element name="infantry"/> <element name="infantry:infantry"/> <element name="infantry:infantry:infantry"/> <element name="infantry:armor:fighter"/> <element name="infantry"/> <element name="infantry"/> <element name="infantry"/> <element name="infantry:infantry:infantry:infantry:armor:fighter"/> <element name="infantry"/> <element name="infantry:infantry:infantry:armor:fighter"/> <element name="infantry:infantry:infantry:fighter"/> <element name="infantry:infantry"/> <element name="infantry:infantry"/> </variable> </variableList>

    and

    <attachment name="conditionAttachmentEveryTurn" attachTo="United_States" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="rounds" value="1-100"/> </attachment> <attachment foreach="$NeutralArea$" name="conditionAttachment@NeutralArea@Non_Aligned" attachTo="Non_Aligned" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directOwnershipTerritories" value="@NeutralArea@" count="1"/> </attachment> <attachment foreach="$NeutralArea$" name="triggerAttachment@NeutralArea@RemoveUnits" attachTo="Non_Aligned" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="players" value="Non_Aligned"/> <option name="uses" value="1"/> <option name="removeUnits" value="@NeutralArea@:All" count="5"/> </attachment> <attachment foreach="$MajorPower$^$NeutralArea$:$NeutralSetup$" name="triggerAttachment@MajorPower@@NeutralArea@" attachTo="@MajorPower@" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentEveryTurn"/> <option name="conditions" value="conditionAttachment@NeutralArea@Non_Aligned"/> <option name="players" value="@MajorPower@"/> <option name="chance" value="1:80"/> <option name="chanceIncrementOnFailure" value="1"/> <option name="when" value="before:@MajorPower@Purchase"/> <option name="placement" value="@NeutralArea@:@NeutralSetup@" /> <option name="changeOwnership" value="@NeutralArea@:Non_Aligned:@MajorPower@:false"/> <option name="activateTrigger" value="triggerAttachment@NeutralArea@RemoveUnits:1:false:false:false:false"/> <option name="uses" value="1"/> </attachment>

    read more
  • Just tried 2.7.15426 it works, its been fixed. 🙂 all good.

    Below is the log for 2.7.15393 - fails
    611 15:17:53.465 [main] INFO o.t.game.client.HeadedGameRunner - Launching game, version: 2.7.15393
    1024 15:17:53.878 [Thread-2] DEBUG g.s.e.data.gameparser.GameParser - Parsing game XML: C:\Users\RYZEN\triplea\downloadedMaps\the_grand_war\map\games\the_grand_war.xml
    7699 15:18:00.553 [Thread-5] ERROR g.s.e.f.s.launcher.LocalLauncher - Failed to start game
    java.nio.file.InvalidPathException: Illegal char <<> at index 5: misc/<!-- arjerg.png
    at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
    at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
    at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
    at java.base/java.nio.file.Path.of(Path.java:148)
    at games.strategy.triplea.ResourceLoader.createPathToImageString(ResourceLoader.java:164)
    at games.strategy.triplea.ResourceLoader.loadBufferedImage(ResourceLoader.java:182)
    at games.strategy.triplea.ResourceLoader.loadImage(ResourceLoader.java:158)
    at games.strategy.triplea.ui.mapdata.MapData.lambda$loadDecorations$2(MapData.java:261)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
    at games.strategy.triplea.ui.mapdata.MapData.loadDecorations(MapData.java:263)
    at games.strategy.triplea.ui.mapdata.MapData.<init>(MapData.java:179)
    at games.strategy.triplea.ui.UiContext.<init>(UiContext.java:139)
    at games.strategy.triplea.ui.TripleAFrame.create(TripleAFrame.java:488)
    at games.strategy.engine.framework.startup.mc.HeadedLaunchAction.startGame(HeadedLaunchAction.java:87)
    at games.strategy.triplea.TripleA.startGame(TripleA.java:62)
    at games.strategy.engine.framework.startup.launcher.LocalLauncher.loadGame(LocalLauncher.java:78)
    at games.strategy.engine.framework.startup.launcher.LocalLauncher.launch(LocalLauncher.java:59)
    at games.strategy.engine.framework.startup.ui.panels.main.MainPanelBuilder.lambda$launch$3(MainPanelBuilder.java:65)
    at java.base/java.lang.Thread.run(Thread.java:1583)
    7896 15:18:00.750 [Thread-7] DEBUG g.s.e.data.gameparser.GameParser - Parsing game XML: C:\Users\RYZEN\triplea\downloadedMaps\the_grand_war\map\games\the_grand_war.xml

    read more