Technology - how to make countrys start with techs already researched
-
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?
-
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...
-
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>