<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to create random spawning during the game?]]></title><description><![CDATA[<p dir="auto">Hej code wizards &amp; Code Gurus <img src="https://forums.triplea-game.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=fbe62970dd5" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" />  mayeb <a class="plugin-mentions-user plugin-mentions-a" href="/user/cernel" aria-label="Profile: Cernel">@<bdi>Cernel</bdi></a> you might know..?</p>
<p dir="auto">Still working here on a finishing touch of <strong>The Shogun Advanced</strong> and running in to this matter:</p>
<p dir="auto">is there a way I could get <strong>Random Spawning (by "chance")</strong> of a specific type of unit without having to determine each single place<br />
in a seperate trigger <em>( causing in this cause with over 160 terr's to be possible to place in far tooo much code )</em></p>
<p dir="auto">Example:  ```</p>
<pre><code>&lt;attachment name="triggerAttachment_Activate_Farmer_Uprisings" attachTo="Ikko-Ikki" javaClass="TriggerAttachment" type="player"&gt;
&lt;option name="conditions" value="conditionAttachmentUprisingsTurn3"/&gt;
&lt;option name="placement" value="Aki:Farmer" count="1"/&gt;
&lt;option name="placement" value="Aki:Farmer" count="2"/&gt;
&lt;option name="placement" value="Awa:Farmer" count="1"/&gt;
&lt;option name="placement" value="Awa:Farmer" count="2"/&gt;

      &lt;option name="chance" value="1:20"/&gt;
      &lt;option name="when" value="after:minorNonCombatMove"/&gt;
    &lt;/attachment&gt;
</code></pre>
<p dir="auto">so this will give a 1:20 chance for all 4 places get to Farmer uprising simultaneous where I look for a 1:20 chance for each separate one...</p>
<p dir="auto">now the only solution I so far is as stated, getting <strong>EACH terr. its own TRIGGER</strong>... but that creates huge volume of coding..</p>
<p dir="auto">is there another way?   please let me know!   or give me a refer to an example map...<br />
<em>( and I realize after my The Shogun compagnon <a class="plugin-mentions-user plugin-mentions-a" href="/user/thedog" aria-label="Profile: TheDog">@<bdi>TheDog</bdi></a>  had looked at it there is a only tiny chance there will be another way )</em><br />
Arrigato!</p>
<p dir="auto"><img src="/assets/uploads/files/1673707763459-kami-pagode.png" alt="kami-pagode.png" class="img-markdown  img-fluid" /><br />
<img src="/assets/uploads/files/1673707775601-kami-seductivegeisha.png" alt="kami-seductiveGeisha.png" class="img-markdown  img-fluid" /><br />
<img src="/assets/uploads/files/1673707798014-kami-kensei.png" alt="kami-kensei.png" class="img-markdown  img-fluid" /></p>
]]></description><link>https://forums.triplea-game.org/topic/3387/how-to-create-random-spawning-during-the-game</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 01:24:08 GMT</lastBuildDate><atom:link href="https://forums.triplea-game.org/topic/3387.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Jan 2023 14:52:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to create random spawning during the game? on Fri, 27 Jan 2023 03:37:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ebbe" aria-label="Profile: ebbe">@<bdi>ebbe</bdi></a><br />
<img src="https://forums.triplea-game.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f44d.png?v=fbe62970dd5" class="not-responsive emoji emoji-android emoji--+1" style="height:1.4em;width:auto;vertical-align:middle" title=":+1:" alt="👍" /></p>
]]></description><link>https://forums.triplea-game.org/post/57680</link><guid isPermaLink="true">https://forums.triplea-game.org/post/57680</guid><dc:creator><![CDATA[wc_sumpton]]></dc:creator><pubDate>Fri, 27 Jan 2023 03:37:09 GMT</pubDate></item><item><title><![CDATA[Reply to How to create random spawning during the game? on Thu, 26 Jan 2023 15:22:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/wc_sumpton" aria-label="Profile: wc_sumpton">@<bdi>wc_sumpton</bdi></a></p>
<p dir="auto">That was the one!!!! thanks for getting my Nesting -skills slightly improving !!!</p>
]]></description><link>https://forums.triplea-game.org/post/57679</link><guid isPermaLink="true">https://forums.triplea-game.org/post/57679</guid><dc:creator><![CDATA[ebbe]]></dc:creator><pubDate>Thu, 26 Jan 2023 15:22:12 GMT</pubDate></item><item><title><![CDATA[Reply to How to create random spawning during the game? on Thu, 26 Jan 2023 12:05:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ebbe" aria-label="Profile: ebbe">@<bdi>ebbe</bdi></a><br />
You do not have 'AllPlayersMinorLC' in your "foreach" statement.<br />
Try:<br />
foreach="$AllTerr$^$AllPlayersMinor$:$AllPlayersMinorLC$"<br />
and see if you get the results you are looking for.</p>
<p dir="auto">Cheers...</p>
]]></description><link>https://forums.triplea-game.org/post/57678</link><guid isPermaLink="true">https://forums.triplea-game.org/post/57678</guid><dc:creator><![CDATA[wc_sumpton]]></dc:creator><pubDate>Thu, 26 Jan 2023 12:05:26 GMT</pubDate></item><item><title><![CDATA[Reply to How to create random spawning during the game? on Thu, 26 Jan 2023 08:19:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cernel" aria-label="Profile: cernel">@<bdi>cernel</bdi></a>   <a class="plugin-mentions-user plugin-mentions-a" href="/user/thedog" aria-label="Profile: TheDog">@<bdi>TheDog</bdi></a>   <a class="plugin-mentions-user plugin-mentions-a" href="/user/rogercooper" aria-label="Profile: RogerCooper">@<bdi>RogerCooper</bdi></a></p>
<p dir="auto">Trying to crack the final issue here before starting a new ohter project!<br />
So close to a <strong>Nesting solution</strong> here just miss one piece of the solution, after unsuccesfully trying to solve it a whole afternoon:  here my help-call:  anyone sees where it goes wrong?</p>
<p dir="auto">I want every player to have <strong>each Fort_damaged replaced in a Fort</strong> <em>(kind of auto-repair)</em>  <strong>in their own controlled Territory in their before their own Place-delegate</strong>:  It all works fine except for the</p>
<pre><code>&lt;option name="when" value="before:@AllPlayersMinorLC@CombatMove"/&gt;
</code></pre>
<p dir="auto">( =AllPlayersMinor Low Caps )  Both elements &lt;variable name="<strong>AllPlayersMinor" &amp; AllPlayersMinorLC</strong>" are well defined...   so that is fine... but it simply doesn't work then, not even a error notification...   it does work when I replace <strong>AllPlayersMinorLC</strong> with one of the players names; but that takes away the nesting advantage as I still need to repeat this trigger for 15 players each...</p>
<pre><code>    	&lt;attachment foreach="$AllTerr$^$AllPlayersMinor$" name="conditionAttachment_Fort_damaged_@AllPlayersMinor@_@AllTerr@" attachTo="@AllPlayersMinor@" javaClass="RulesAttachment" type="player"&gt;
        &lt;option name="directPresenceTerritories" value="@AllTerr@"/&gt;
        &lt;option name="unitPresence" value="Fort_damaged" count="1"/&gt;
	&lt;/attachment&gt;	
	
		&lt;attachment foreach="$AllTerr$^$AllPlayersMinor$" name="triggerAttachment_Place_Fort_@AllPlayersMinor@_@AllTerr@" attachTo="@AllPlayersMinor@" javaClass="TriggerAttachment" type="player"&gt;
        &lt;option name="conditions" value="conditionAttachment_Fort_damaged_@AllPlayersMinor@_@AllTerr@"/&gt;
	    	&lt;option name="when" value="before:@AllPlayersMinorLC@CombatMove"/&gt;
	    	&lt;option name="placement" value="@AllTerr@:Fort"/&gt;
    &lt;/attachment&gt;

	&lt;attachment foreach="$AllTerr$^$AllPlayersMinor$" name="triggerAttachment_Remove_Fort_damaged_@AllPlayersMinor@_@AllTerr@" attachTo="@AllPlayersMinor@" javaClass="TriggerAttachment" type="player"&gt;
        &lt;option name="conditions" value="conditionAttachment_Fort_damaged_@AllPlayersMinor@_@AllTerr@"/&gt;
	    	&lt;option name="when" value="before:@AllPlayersMinorLC@CombatMove"/&gt;
	    	&lt;option name="removeUnits" value="@AllTerr@:Fort_damaged" count="1"/&gt;
    &lt;/attachment&gt;
</code></pre>
<p dir="auto">hmmm<br />
Anyone who sees a solution?  I'll be very thankfull!</p>
]]></description><link>https://forums.triplea-game.org/post/57669</link><guid isPermaLink="true">https://forums.triplea-game.org/post/57669</guid><dc:creator><![CDATA[ebbe]]></dc:creator><pubDate>Thu, 26 Jan 2023 08:19:36 GMT</pubDate></item><item><title><![CDATA[Reply to How to create random spawning during the game? on Sat, 14 Jan 2023 23:10:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ebbe" aria-label="Profile: ebbe">@<bdi>ebbe</bdi></a> Take a look at my Zombies-World War 2 to see how to implement random uprisings.</p>
]]></description><link>https://forums.triplea-game.org/post/57468</link><guid isPermaLink="true">https://forums.triplea-game.org/post/57468</guid><dc:creator><![CDATA[RogerCooper]]></dc:creator><pubDate>Sat, 14 Jan 2023 23:10:08 GMT</pubDate></item><item><title><![CDATA[Reply to How to create random spawning during the game? on Sat, 14 Jan 2023 19:38:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cernel" aria-label="Profile: cernel">@<bdi>cernel</bdi></a> <img src="https://forums.triplea-game.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f44d.png?v=fbe62970dd5" class="not-responsive emoji emoji-android emoji--+1" style="height:1.4em;width:auto;vertical-align:middle" title=":+1:" alt="👍" /></p>
]]></description><link>https://forums.triplea-game.org/post/57461</link><guid isPermaLink="true">https://forums.triplea-game.org/post/57461</guid><dc:creator><![CDATA[ebbe]]></dc:creator><pubDate>Sat, 14 Jan 2023 19:38:52 GMT</pubDate></item><item><title><![CDATA[Reply to How to create random spawning during the game? on Sat, 14 Jan 2023 18:21:10 GMT]]></title><description><![CDATA[<p dir="auto">Just do a nested "foreach" loop.</p>
<p dir="auto"><a href="https://forums.triplea-game.org/topic/560/categories-and-or-tags/51?_=1673720379348">https://forums.triplea-game.org/topic/560/categories-and-or-tags/51?_=1673720379348</a></p>
]]></description><link>https://forums.triplea-game.org/post/57458</link><guid isPermaLink="true">https://forums.triplea-game.org/post/57458</guid><dc:creator><![CDATA[Cernel]]></dc:creator><pubDate>Sat, 14 Jan 2023 18:21:10 GMT</pubDate></item></channel></rss>