technology question



  • I am trying to have a tech that changes "createsUnitsList". So far as i can see, it can't do it directly? If not, I am wondering if i can use triggers to do it somehow? My hope is that I can use the tech as a condition?

    And in case I am missing them, I am also hoping to use techs to modify units supporting other units and possibly a units HP.

    Thanks!


  • Moderators

    @ff03k64 You tried with "techAbilityAttachment" ?Idk about createsUnitsList" I would think you could but ... 🙂



  • It wasn't in the POS list, but I guess i could just try it.


  • Moderators

    @ff03k64 yea so something like this

    <attachment name="techAbilityAttachment" attachTo="SphereOfInfluence_ChangerMustActivate" javaClass="games.strategy.triplea.attachments.TechAbilityAttachment" type="technology">
    <option name="defenseBonus" value="0:bomber"/>
    </attachment>

    but different too obviously 🙂



  • @ff03k64

    At present, the only why to do this is with triggers.

    <!-- A technology condition to check -->
    <attachment name="conditionAttachmentUnitsListTech" attachTo="Player" javaClass="RulesAttachment" type="player">
       <option name="techs" value="IncreaseUnitsList" count="1"/>
    </attachment>
    
    <!-- Then the trigger -->
    <attachment name="triggerAttachmentUnitsListTech" attachTo="Player" javaClass="TriggerAttachment" type="player">
       <option name="trigger" value="conditionAttachmentUnitsListTech"/>
       <option name="unitType" value="unitCreator"/>
       <option name="unitAttachmentName" value="UnitAttachment"/>
       <option name="unitProperty" value="createsUnitsList" count="-reser-2:aCreatedUnit"/>
        <option name="uses" value="1"/>
        <option name="when" value="after:playerTechActivation"/>
    </attachment>
    

    The downside is that any Player the uses 'unitCreator' now has the ability to create 2 createdUnits per turn.

    @beelee

    techAbilityAttachment is limited to what is listed in POS2. Unless of course you dig into the engine code. I can do hitPoints, transportCapacity, and almost combatOffenseEffect / combatDefenseEffect for territoryEffect.

    So much fun!

    Cheers...



  • @wc_sumpton said in technology question:

    techAbilityAttachment is limited to what is listed in POS2. Unless of course you dig into the engine code. I can do hitPoints, transportCapacity, and almost combatOffenseEffect / combatDefenseEffect for territoryEffect.

    I hope you are going to get those into the game so the rest of us mere mortals can use them!



  • @ff03k64

    Hacks. I'm really making a mess of things. I just learning how the engine works.

    It's a fun hobby. But we'll see.

    Cheers...



  • Do you know how I can have techs be directly purchasable? And how I can affect the price to be different resources than just PUs?



  • @ff03k64

    Check out 'Age of Tribes' by @Frostion. All the Tech/Upgrades are purchasable in this great map!!

    Cheers...



  • I am getting this error.

    Aug 28, 2020 9:11:48 AM games.strategy.engine.framework.ui.DefaultGameChooserEntry getCompleteGameData
    SEVERE: Could not parse:jar:file:/C:/Users/ckimb/triplea/downloadedMaps/XCOM-master.zip!/XCOM-master/map/games/xcom.xml
    games.strategy.engine.data.GameParseException: map name: 'jar:file:/C:/Users/ckimb/triplea/downloadedMaps/XCOM-master.zip!/XCOM-master/map/games/xcom.xml', game name: 'XCOM', Unexpected Exception while setting values for attachment: TriggerAttachment attached to: PlayerId named:XCOM with name: triggerAttachmentMedicPromotion
    	at games.strategy.engine.data.GameParser.newGameParseException(GameParser.java:118)
    	at games.strategy.engine.data.GameParser.setOptions(GameParser.java:1386)
    	at games.strategy.engine.data.GameParser.parseAttachment(GameParser.java:1322)
    	at games.strategy.engine.data.GameParser.parseAttachments(GameParser.java:1236)
    	at games.strategy.engine.data.GameParser.parseMapDetails(GameParser.java:212)
    	at games.strategy.engine.data.GameParser.parse(GameParser.java:106)
    	at games.strategy.engine.data.GameParser.parse(GameParser.java:98)
    	at games.strategy.engine.data.GameParser.parse(GameParser.java:84)
    	at games.strategy.engine.framework.ui.DefaultGameChooserEntry.getCompleteGameData(DefaultGameChooserEntry.java:63)
    	at games.strategy.engine.framework.ui.DefaultGameChooserEntry.fullyParseGameData(DefaultGameChooserEntry.java:47)
    	at games.strategy.engine.framework.startup.ui.panels.main.game.selector.GameSelectorModel.selectByName(GameSelectorModel.java:225)
    	at games.strategy.engine.framework.startup.ui.panels.main.game.selector.GameSelectorModel.loadDefaultGameSameThread(GameSelectorModel.java:198)
    	at games.strategy.engine.framework.GameRunner.loadGameIfSpecified(GameRunner.java:98)
    	at games.strategy.engine.framework.GameRunner.showMainFrame(GameRunner.java:83)
    	at java.base/java.lang.Thread.run(Thread.java:834)
    Caused by: games.strategy.engine.data.MutableProperty$InvalidValueException: failed to set string property value to 'unitAttachment'
    	at games.strategy.engine.data.MutableProperty.setStringValue(MutableProperty.java:62)
    	at games.strategy.engine.data.MutableProperty.setValue(MutableProperty.java:85)
    	at games.strategy.engine.data.GameParser.setOptions(GameParser.java:1382)
    	... 13 more
    Caused by: games.strategy.engine.data.GameParseException: unitAttachmentName must have 2 entries, the type of attachment and the name of the attachment.   for: TriggerAttachment attached to: PlayerId named:XCOM with name: triggerAttachmentMedicPromotion
    	at games.strategy.triplea.attachments.TriggerAttachment.setUnitAttachmentName(TriggerAttachment.java:725)
    	at games.strategy.engine.data.MutableProperty.setStringValue(MutableProperty.java:58)
    	... 15 more
    
    

    With this code for my trigger.

    			
    			<attachment name="conditionAttachmentMedicPromotion" attachTo="XCOM" javaClass="RulesAttachment" type="player">
    				<option name="techs" value="medic_promotion" count="1"/>
    			</attachment>
    			
    			<attachment name="triggerAttachmentMedicPromotion" attachTo="XCOM" javaClass="TriggerAttachment" type="player">
    				<option name="trigger" value="conditionAttachmentMedicPromotion"/>
    				<option name="unitType" value="medic"/>
    				<option name="unitAttachmentName" value="unitAttachment"/>
    				<option name="unitProperty" value="createsUnitsList" count="-reser-2:bandage"/>
    				<option name="uses" value="1"/>
    				<option name="when" value="after:playerTechActivation"/>
    			</attachment>
    			```
    I really can't figure out how the "unitAttachmentName" line is supposed to work.

  • Moderators

    I think you need this :

    <option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>

    instead of this:

    <option name="unitAttachmentName" value="unitAttachment"/>

    here's an example

    <attachment name="triggerAttachmentTransportCost8Changer" attachTo="Changer" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
    <option name="trigger" value="conditionAttachmentTransportCost8Changer"/>
    <option name="unitType" value="transport"/>
    <option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
    <option name="unitProperty" value="attack" count="0"/>
    <option name="unitProperty" value="defense" count="1"/>
    <option name="unitProperty" value="isCombatTransport" count="true"/>
    <option name="when" value="after:changerCombatMove"/>
    <option name="uses" value="1"/>
    </attachment>



  • After fiddling with it, does it even need that line?


  • Moderators

    @ff03k64 idk never tried it without it



  • @ff03k64

    The value needs to have a capital 'U' value="UnitAttachment". It is the same value as in the javaClass = value.

    Cheers... (With a capital 'C')



  • edit: nevermind, figured it out. needed xcomTechActivation, not playerTechActivation

    @wc_sumpton

    			<attachment name="conditionAttachmentMedicPromotion" attachTo="XCOM" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
    				<option name="techs" value="medic_promotion" count="1"/>
    			</attachment>
    			
    			<attachment name="triggerAttachmentMedicPromotion" attachTo="XCOM" javaClass="TriggerAttachment" type="player">
    				<option name="trigger" value="conditionAttachmentMedicPromotion"/>
    				<option name="unitType" value="medic"/>
    				<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
    				<option name="unitProperty" value="createsUnitsList" count="-reset-2:bandage"/>
    				<option name="when" value="after:playerTechActivation"/>
    			</attachment>
    

    No longer throwing errors. So far as I can tell it isn't doing anything though.



  • @wc_sumpton said in technology question:

    @ff03k64

    Check out 'Age of Tribes' by @Frostion. All the Tech/Upgrades are purchasable in this great map!!

    Cheers...

    After perusing this for a bit, it looks like he does the tech purchasing by buying a unit, and then if you have that unit, you are allowed to build the associated tech? So it isn't really using the games tech system? Does that sound right?



  • @ff03k64

       <option name="unitAttachmentName" value="UnitAttachment"/> <!-- No count value -->
       <option name="when" value="after:XCOMTechActivation"?> <!-- Needs the name of the Owning Player's (XCOM) Tech Activation sequence -->
       <option name ="uses" value ="1"/> <!-- added to prevent the trigger from firing over and over again.
    

    The 'when' option determines during what sequence the trigger will fire. Also add a "uses=1" option to prevent the trigger from firing over and over.

    Cheers...



  • @ff03k64

    That is how 'Age of Tribes' handles purchasing of tech. Yes

    Cheers...



  • @wc_sumpton said in technology question:

    @ff03k64

    That is how 'Age of Tribes' handles purchasing of tech. Yes

    Cheers...

    That's unfortunate, I guess if i do some of my techs that way, i probably want to do all my techs that way then?

    Does that make sense?



  • @ff03k64

    No. You can purchase, and you can develop with the Tech Roll. You can do different Techs, or you can do the same Tech. Just use trigger to remove developed Technologies from the purchase window. And activate a purchase Tech, so the game can remove it from the development roll.

    Cheers...


Log in to reply