Need a little help with Triggers, etc.



  • I've been playing the tutorial; as I actually like it more than the original game itself. Anyway, I'm trying to change my copy of it; so it's more of a campaign type game than a tutorial; but I'm new to all this (or new again; as I had toyed with it a year or so ago).

    So, what I'm trying to accomplish is this: I want to change the unlocking of the (Purchase ability of the) Artillery Unit from late in the game (Just before attacking Russia) to way earlier in the game (after Germany's first combat move).

    Thus any information anyone can provide on how to change the trigger(s) what be extremely helpful. Thank You and if there's a Wiki (or whatever) dealing with Modding: please point me in that direction as well.


  • Admin

    @stohrm Most of the modding boils down to understanding and changing the game XML. The best reference is actually the POS2 XML which provides definitions and examples of most of the available features: https://github.com/triplea-maps/the_pact_of_steel/blob/master/map/games/pact_of_steel_2.xml

    The best thing to do is either unzip an existing map and start changing stuff to try it out. Or use the in-game map creator to create a new map. Those are probably the best 2 ways to learn.

    For your specific example you'd need to change this condition which I believe unlocks buying artillery for the various nations:

    <attachment name="conditionAttachment130" attachTo="Neutral_Nations" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
    	<option name="directPresenceTerritories" value="Bolivia" count="1"/>
    	<option name="unitPresence" value="infantry" count="1"/>
    </attachment>
    

    You'd need to change that to reference a different event instead of an infantry being present in Bolivia as that condition triggers these:

    <attachment name="triggerAttachment130b" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
    	<option name="conditions" value="conditionAttachment130"/>
    	<option name="uses" value="1"/>
    	<option name="when" value="after:britishEndTurn"/>
    	<option name="productionRule" value="production_Germans:buyArtillery"/>
    </attachment>
    
    <attachment name="triggerAttachment130c" attachTo="Italians" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
    	<option name="conditions" value="conditionAttachment130"/>
    	<option name="uses" value="1"/>
    	<option name="when" value="after:britishEndTurn"/>
    	<option name="productionRule" value="production_Italians:buyArtillery"/>
    </attachment>
    


  • @redrum Thanks

    I do recall (now) that Pact of Steel 2's xml has a lot of excellent comments and explanations.

    I tried using the Map Creator (part 2); but I get errors when trying to load the xml and such. I'm probably not pointing to the right map file or whatever; but I'll figure that out too (eventually).

    The coding will come to me once I grasp the concept of how the conditions and triggers work. Like you said, it'll (probably) take a lot of trial and error (before I get it right).

    But again, Thank You. At least I have more to work with now.



  • @stohrm Map Creator part 2... just forget that. It was buggy and glitchy even when it was supposed to work.