foreach syntax



  • Do I have the correct syntax here for this foreach loop? Nothing seems to happen. Triggers with same condition outside the loop work.

    <attachment foreach="$LandArea$^$TriggerPlayer$" 
    name="triggerAttachmentZombies@TriggerPlayer@Zombie@LandArea@" attachTo="Zombies" javaClass="TriggerAttachment" type="player">
      <option name="conditions" value="conditionAttachmentEveryTurn"/>
      <option name="placement" value="@LandArea@:zombie" count="1"/>
    	<option name="players" value="Zombies"/>
    	<option name="chance" value="1:1"/>
    	<option name="when" value="before:@triggerplayer@Purchase"/>
    	</attachment>
    ...
    The variables are defined as
    
    

    <variableList>
    <variable name="TriggerPlayer">
    <element name="Russians"/>
    <element name="Germans"/>
    <element name="British"/>
    <element name="Japanese"/>
    <element name="Americans"/>
    </variable>
    <variable name="LandArea">
    <element name="Afghanistan"/>
    etc.


  • Moderators Admin

    @RogerCooper You have "triggerplayer" not defined (I assume you meant "TriggerPlayer").



  • @Cernel Thank you. The capitalization issues without error messages are hard to catch.


Log in to reply
 

42300
2047
2288
Who's Online
Visitors Today