TWW Prevent Scuttling of Toulon Fleet
Use UserActions to give Germany the option to attempt to prevent scuttling of Toulon Fleet
Shows how to use UserActions which activate multiple triggers and number of attempts depend on conditions
<attachment name="conditionAttachmentVichyMat" attachTo="VichyFrance" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="conditions" value="conditionAttachmentMorroccoVichy:conditionAttachmentAlgeriaVichy"/>
<option name="conditionType" value="2"/>
<attachment name="conditionAttachmentVichyProtectorateLost" attachTo="VichyFrance" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="conditions" value="conditionAttachmentVichyMat"/>
<option name="invert" value="true"/>
<attachment name="conditionAttachmentSZ44VichyBattleship" attachTo="Germany" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="directPresenceTerritories" value="44 Sea Zone" count="1"/>
<option name="unitPresence" value="vichyBattleship:vichyBattleship-damaged" count="1"/>
<attachment name="triggerAttachmentSZ44RemoveVichyBattleship" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="removeUnits" value="44 Sea Zone:vichyBattleship"/>
<option name="removeUnits" value="44 Sea Zone:vichyBattleship-damaged"/>
<attachment name="triggerAttachmentSZ44PlaceGermanBattleship" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="chance" value="2:12"/>
<option name="placement" value="44 Sea Zone:germanBattleship"/>
<attachment name="userActionAttachmentGermanySaveVichyBattleship" attachTo="Germany" javaClass="games.strategy.triplea.attachments.UserActionAttachment" type="player">
<option name="conditions" value="conditionAttachmentVichyProtectorateLost:conditionAttachmentSZ44VichyBattleship"/>
<option name="activateTrigger" value="triggerAttachmentSZ44RemoveVichyBattleship:1:false:false:false:false"/>
<option name="activateTrigger" value="triggerAttachmentSZ44PlaceGermanBattleship:1:false:false:false:true"/>
<option name="text" value="GERMANS_SAVE_BATTLESHIP"/>
<option name="costResources" value="1:PUs"/>
<option name="attemptsPerTurn" value="99"/>
This UserAction which deals with the Toulon Fleet battleship uses conditions on the Vichy protectorate being lost and the battleship still existing in SZ44 (damaged or undamaged). The user is presented the user action only when those are true during Germany's UserAction phase and it cost them 1 PU to have a 2/12 chance of saving the battleship. If selected, it fires 2 triggers: 1 to remove the Vichy battleship which always fires and 1 to add a German battleship which uses chance to have a 2/12 chance of success. The UserAction has 99 attemptsPerTurn (essentially unlimited) so is really limited by the condition on there being a Vichy battleship in SZ44 so the option will appear to the user for as many battleships as are in the Toulon Fleet. Similar UserActions are used for each of the other type of ship in the Toulon Fleet.
Depends on how you value territories. Strategic/geographical and morale boosting to a countries people can(usually is) be a determination of value also.
Obviously, from a raw material stand point, midway islands are not worth anything. From a strategic point, quite a bit.
Just depends on how you want to do it. "World in Flames" is supposed to be the best WWII game for realism. Sadly, I've never played it and last I checked, no longer an online option.
@CrazyG Well mostly the good habits are the opposite of the bad ones
But I think the key tends to be that there are a lot of options so you get a good variety of moves/buys turn 1 and the map plays differently every game. You want some randomness as well but not huge 50/50 battles that end up deciding the game the first round. Generally having some interconnected threaters of war helps make it so each player has different options on what to focus on.
Many maps don't actually do this very well and most of the moves are no brainers. NWO/WaW/TRS are examples of really bad initial unit/factory placements as the first 3-4 turns play out almost the same way every time to the point I've seen players take a save at say the start of turn 3 and just play from that again and again.
Probably TWW and Civil War have maybe the most interesting initial setup options as they tend to play out pretty differently every play through and almost every player has a different preferred opening. Once you get to UK1 in TWW, things can have played out pretty differently and the UK has tons of options on what to focus on (pressure France vs pressure Scandinavia vs support Egypt/Med vs support Southeast Asia) as well as what to build.
It is within the jar file at /games/strategy/engine/xml/game.dtd, but you could've also just searched on github https://github.com/triplea-game/triplea/blob/master/game-core/src/main/resources/games/strategy/engine/xml/game.dtd
@beelee well took a while but I see my issue was searching for y instead of "y" Tried space y and y space but yea ...
the line error was the last line in the document so ... anyway just posting the resolution in case someone stumbles across this in the future : )
@CrazyG You could make a trigger for the ship that has the ability to make mines then have those ships automatically produce 1 invisible unit at the end of the NCM turn phase. Then you could make the purchasable mine unit consume the invisible unit. Then simply have all the (unused) invisible units removed from the map at the end of the current players turn.
I think you could even deal with the invisible unit generation be handled by the unit attachment of "canProduceXUnits" instead of a trigger.
But this is all just a suggestion. I have not tested any of this. So I am not sure what complications might arise.
Does the "capitols.txt" file have any function? I moved the capitol for one of the factions in the XML file, but not in the "capitols.txt" file. No errors happen, and the new capitol seems to function correctly.