TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Technology - how to make countrys start with techs already researched

    Scheduled Pinned Locked Moved Map Making
    3 Posts 2 Posters 1.0k Views 2 Watching
    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.
    • cameronC Offline
      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?

      wc_sumptonW 1 Reply Last reply Reply Quote 0
      • wc_sumptonW Offline
        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
        • cameronC Offline
          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

          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
          • 1 / 1
          • First post
            Last post
          Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums