Handling Customized Techs
-
I need to have some customized techs in a mod, that are available to all players. Is there a way of doing this? Do I need to rename a hard-coded tech and use that as a trigger to add a production rule?
-
Yea I don't think you need to rename a hardcoded one. It's been a few years since I did it but basically copied the two that Veq did for Global 40 explained in POS2.
I made a pile of them for "Global 40 House Rules".
I don't remember exactly what i did but here's xml. Search techname and pick one in the second group to follow. First group is the hardwired but last two custom I think.
-
@beelee I am seeing this code.
<attachment name="triggerAttachment_MobileArtillery" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="trigger" value="conditionAttachmentMobileArtillery"/> <option name="productionRule" value="productionGermans:buyMobile_Artillery"/> <option name="productionRule" value="productionRussians:buyRussian_Mobile_Artillery"/> <option name="productionRule" value="productionJapanese:buyJapanese_Mobile_Artillery"/> <option name="productionRule" value="productionAmericans:buyMobile_Artillery"/> <option name="productionRule" value="productionBritish:buyMobile_Artillery"/> <option name="productionRule" value="productionUK_Pacific:buyMobile_Artillery"/> <option name="productionRule" value="productionItalians:buyMobile_Artillery"/> <option name="productionRule" value="productionANZAC:buyMobile_Artillery"/> <option name="productionRule" value="productionFrench:buyMobile_Artillery"/> <option name="when" value="before:germansPurchase"/> <option name="uses" value="1"/> </attachment>
It looks to me that adding the trigger adds Mobile_Artillery to everyone, not just the player who developed it.
-
yea if I remember right these techs were for all players. To do a specific player only, you need to trigger it.
Again, I don't remember exactly the code but I'm pretty sure it can be done. I will try and find it later tonight.
You want a custom tech only available to certain players not all ? Is that what you are after ?
Edit
Ahh yea looking at the above you can just elimnate the players you don't want to produce it. I didn't look at the condition yet -
@beelee I want to use the same tech list for everyone, without having to create a separate trigger for every tech & player.
-
Oh well the above should work then.
Edit
"Improved_Mech_Inf" is a custom one. You can follow it in the Global 40 mod Veq did. -
@rogercooper said in Handling Customized Techs:
I want to use the same tech list for everyone, without having to create a separate trigger for every tech & player.
You cannot use the same tech list for all players like you can with production.
In <technology> all tech used should be listed in <technologies> sub section. In <playerTech> sub section are the <category> and <tech>. Each player is assigned a <playerTech> so players cannot share the <category><tech> information. <category><tech> can be left empty and triggers used to fill/add to later.
If custom tech are being used each player will need a <techAttachment>. These may also be left empty. Because these are under the <attachment> section "foreach" can be used to assign each player the same <techAttachment>.
<playerAttachment> <shareTechnology> can be used to share researched tech. Each player would require a <playerAttachment> with each subsequent player listed under <shareTechnology>. A player may have only one <playerAttachment> as creating more will overwrite each other.Hope this gives you food for thought.
Cheers...
-
@wc_sumpton Thank for the help from you and beelee. I think that I won't use technology tables at all. Instead I will use triggers to grant technologies (production rules) with "foreach" loops.
The tech system in TripleA suffers from hard-coding, but it would be difficult to fix the program without breaking the existing mods
-
@rogercooper said in Handling Customized Techs:
The tech system in TripleA suffers from hard-coding, but it would be difficult to fix the program without breaking the existing mods
This would incur what one would think "fixing" would need to be done. Maybe "expanding" the present system would be better.
Either way someone would still need to define how the system is "broken".
Still, I didn't understand what was meant by this statement. Sorry.
Cheers...