Auto spawning units
-
I want to make units spawn automatically each turn, but I cannot figure out how to make it happen. Can anyone help?
What I really want is to create a "submarine pen" unit that Germany can build. Based upon the number of submarine pens in play, subs would appear in the middle of the Atlantic at the start of the German turn (so they can instantly attack). I think I can count the sub pens, but I cannot figure out how to create a sub.
Thanks, -
@dabber Take a look at Big World 3: Final Solution. It has a wolfpack unit that essentially does what you are looking for. You will have some additional work involved since I assume the Sub pens will not being going in the ocean... so you will have to devise the triggers for where you want the subs to spawn.... but the basics of what you need are there.
-
I don't see Big World 3: Final Solution anywhere. I see Big World 2 and Big World Variations, but no wolfpacks in any of those game files. What am I missing?
-
@dabber
He means Big World 2. Big World 3 is still in development, thus unavailable in map depot. Both handle sub spawn the same. -
@dabber Ooops. My bad.
-
If anyone is interested, this is where I ended up so far (adding to New World Order at the moment).
I'd like to make it add up the territories and place subs based on the total, instead of doing individual events for each territory (below, Bremen and Rostock), but my attempts at that didn't work. Suggestions?
General game option:
<property name="German submarine pens" value="true" editable="true"> <boolean/> </property>
Rules:
<attachment name="GameProperty_Submarine_pens" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="gameProperty" value="German submarine pens"/> </attachment>
<attachment name="Bremen_submarine_pen" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directOwnershipTerritories" value="Bremen" count="1"/> </attachment> <attachment name="Bremen_Spawn_Subs" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="Bremen_submarine_pen"/> <option name="conditions" value="GameProperty_Submarine_pens"/> <option name="conditionType" value="AND"/> <option name="placement" value="sz11:Submarine"/> <option name="when" value="before:germanCombatMove"/> </attachment> <attachment name="Rostock_submarine_pen" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directOwnershipTerritories" value="Rostock" count="1"/> </attachment> <attachment name="Rostock_Spawn_Subs" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="Rostock_submarine_pen"/> <option name="conditions" value="GameProperty_Submarine_pens"/> <option name="conditionType" value="AND"/> <option name="placement" value="sz11:Submarine"/> <option name="when" value="before:germanCombatMove"/> </attachment>
-
@dabber Looks good. Out of curiosity what map base are you planning on using?
-
Looks functional, just one point you should be aware of, the spawned subs may not be able to move on the same turn that you placed them, if I recall correctly.
To count territories, you would have to make a condition for each desired number count. And if needed, then you can use those conditions to create meta conditions that follow your intended logic.
Click on image to get better view. I don't know how you guys are uploading with scroll bar and clear.
-
@general_zod
I discovered the unable to move problem this morning. I think I have to place them at the end of the previous phase, not the beginning of this one, but I haven't tried that yet.In terms of post formatting, I created mine by putting a line of three single tilde marks before and after the block. This `
three of `
-
cool :) Here it is again. But less territories. On following turn the sub will be ok to move. <attachment name="conditionAttachment_Two_Of_Six_Territories_Owned_By_British_Is_True" attachTo="British" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directOwnershipTerritories" value="Fukien:French Indo-China Thailand:Western United States:Peruvian Central:Kiangsu:Evenki National Okrug" count="2"/> <option name="players" value="British"/> </attachment> <attachment name="conditionAttachment_Three_Of_Six_Territories_Owned_By_British_Is_True" attachTo="British" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directOwnershipTerritories" value="Fukien:French Indo-China Thailand:Western United States:Peruvian Central:Kiangsu:Evenki National Okrug" count="3"/> <option name="players" value="British"/> </attachment> `
-
In order to make the subs able to attack, I had to place them after the American non combat move (<option name="when" value="after:americanNonCombatMove"/>). I could not place them attached to americanPlace or americanEndTurn because that created an immobile sub the first turn.