Navigation

    TripleA Logo

    TripleA Forum

    • Register
    • Login
    • Search
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags

    foreach syntax

    Map Making
    2
    3
    262
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RogerCooper
      RogerCooper last edited by

      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.

      C 1 Reply Last reply Reply Quote 0
      • C
        Cernel Moderators @RogerCooper last edited by

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

        RogerCooper 1 Reply Last reply Reply Quote 0
        • RogerCooper
          RogerCooper @Cernel last edited by

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

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums