Units That Popping Up Randomly
-
@beelee My mistake to misspell it. The error came up with "foreach"
-
@schulz ahh...so much for an easy fix

-
@schulz
I have the random code working in your xml, here is the extract<!-- this goes before map -->
<variableList>
<variable name="SZGermanySubs">
<element name="SZ 4"/>
<element name="SZ 5"/>
<element name="SZ 6"/>
<element name="SZ 7"/>
</variable>
</variableList><!-- this goes before attachmentList -->
<attachment name="conditionAttachmentEveryTurn" attachTo="Germany" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="rounds" value="1-100"/>
</attachment><attachment foreach="$SZGermanySubs$" name="triggerAttachmentSZGermanySubs@SZGermanySubs@" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachmentEveryTurn"/>
<option name="placement" value="@SZGermanySubs@:destroyer" count="1"/>
<option name="players" value="Germany"/>
<option name="chance" value="1:2"/>
<option name="when" value="before:germanyPurchase"/>
</attachment>You will have to change the bold text, but hopefully its just a copy and paste.
-
@thedog Thank you it worked though if subs pop up before movement phase they can't move. How to make them move and attack?
-
@schulz
In short I dont know.
Maybe use a false delegate, like Politics delegate your not using that, put it before the germanyCombatMove and have the submarines appear before Politics delegate, then they might appear, move and attack?However, appearing, then moving and attacking , to me is not a fair mechanic. You will get the 'fear' factor in the player as they know the subs can appear in several areas, that should be good enough?
The AI of course is fearless.
-
@thedog
I just created fake tech phases before Combat phase it didn't work unfortunately.It is true I would want Central Powers having this unfair advantage but Entente will be compensated by other factors like higher incomes, not being able to use captured factories or took enemy incomes after capturing their capitals.
-
To have the subs move after being placed use 'stepProperty':
<step name="germansCombatMove" delegate="move" player="Germans"> <stepProperty name="resetUnitStateAtStart" value="true"/> </step>Cheers...
-
Thank you it worked. Does it work for only country?
-
It will only affect Germany. Combat stats are reset normally at the end of the players Non-Combatmove. That is why the placed units don't move.
Cheers...
-
How could I make this feature dependent to controlling some territories?
-
Not sure what you are asking. If only certain territories are controlled then the newly placed sub can move? Otherwise Germany can not move these newly placed subs.
As to making the 'stepProperty' trigger dependent, it can not be done.
Cheers...
-
@wc_sumpton I mean these units will be spawned each round only if the owner of these units control certain territories.
-
@Schulz
Gotya'.So if the units are not spawned, the 'stepProperty' would have not effect, even though it is still part of 'germansCombatMove'.
So again my question, 'Why do you want to control when 'stepProperty' fires?'
Slightly confused
Cheers...
-
@schulz You can have multiple conditions. Check Pact of Steel 2.
-
I though having these subs being spawned wouldn't make sense if Germany defeated or controls no coastal territory.
I don't know how to deal with "<stepProperty name="resetUnitStateAtStart" value="true"/>" even if these units stop being spawning temporarily.
-
I think I understand what you are saying. You do not need to "turn off" '<stepProperty name="resetUnitStateAtStart" value="true"/>'. All this does is reset/clear Unit states, which is also done at the end of Non-Combat Movement by default.
The only change to game play will only appear when units are spawned, this will allow then to move during the same turn that they appear. If the units do not spawn, that's ok, there should be no effect.
'<stepProperty name="resetUnitStateAtStart" ' value can not be changed with triggers. But from what I understand by what you are describing that should be okay.
Cheers...
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