Navigation

    TripleA Logo

    TripleA Forum

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

    Technology - how to make countrys start with techs already researched

    Map Making
    2
    3
    389
    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.
    • cameron
      cameron last edited by

      How do i make countrys start with techs already researched?

      What i tried (for each 'country'):

      	<attachment name="techAttachment" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player">
      		<option name="science" value="true"/>
      	</attachment>
      

      what i got:
      Could not parse:file:///C:/Users/fmcs2/triplea/downloadedMaps/steampunk_fmcs/map/games/Steampunk_fmcs.xml, Missing property definition for option 'science' in attachment 'techAttachment' games.strategy.engine.data.gameparser.GameParseException: Missing property definition for option 'science' in attachment 'techAttachment'

      Is the problem that the map i'm modding (Steampunk Advanced) uses non-standard techs?

      W 1 Reply Last reply Reply Quote 0
      • W
        wc_sumpton @cameron last edited by wc_sumpton

        @cameron

        You are only showing a very limited part of the xml, so I am assuming that the <technology> section is incorrect. All techs that are to be used must be listed.

        <technology>
           <!-- All techs need to be listed -->
           <technologies>
              ...
              <techname name="science"/>
              ...
           </technologies>
           <playerTech name="Gernamy">
              <category name="German Technology">
                 <tech name="science"/>
              </catagory">
           <playerTech/>
        </technology>
        

        'science' is not a pre-defined tech, so "techAttachment" will not work, what you'll need to activate 'science' for Germany with a "triggerAttachment".

           <!-- I use an "Always True" condition to insure triggers fire -->
           <attachment name="conditionAttachmentAlwaysTrue"  attachTo="Germany" javaClass="RulesAttachment" type="player">
              <option name="switch" value="true"/>
           </attachment>
           <!-- Now the trigger -->
           <attachment name="triggerAttachmentScienceForGermany" attachTo="Germany" javaClass="TriggerAttachment" type="player">
              <option name="conditions" value="conditionAttachmentAlwaysTrue"/>
              <option name="tech" value="science"/>
              <option name="uses" value="1"/> <!-- only need to happen once -->
              <!-- Here's the tricky part, "when" do you want this tech to happen? -->
              <!-- Choose a step that happen very early, but also insure that it is a step that "happens". -->
              <!-- So don't assign it to "Bid" step as they may not fire if the is no Bid. -->
              <!-- I use combat move, but it could be any step, even another players step. -->
              <option name="when" value="before:GermanyCombatMove"/>
           </attachment/>
        

        Hope this is helpful!

        Cheers...

        1 Reply Last reply Reply Quote 3
        • cameron
          cameron last edited by cameron

          excellent. that worked perfectly (once i corrected the slight typo at the end (that final '/')).
          thank you kindly. : )

          		<attachment name="conditionAttachmentAlwaysTrue" attachTo="Germany" javaClass="RulesAttachment" type="player">
          			<option name="switch" value="true"/>
          		</attachment>
          		<attachment name="triggerAttachmentScienceForGermany" attachTo="Germany" javaClass="TriggerAttachment" type="player">
          			<option name="conditions" value="conditionAttachmentAlwaysTrue"/>
          			<option name="tech" value="Science"/>
          			<option name="uses" value="1"/>
          			<option name="when" value="before:GermanyTech"/>
          		</attachment>
          
          1 Reply Last reply Reply Quote 3
          • 1 / 1
          • First post
            Last post
          Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums