Triggers that change territory PU value back and forth

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Triggers that change territory PU value back and forth

Frostion
I need some help with triggers that do not seem to work as I want them to.

The situation is that my map has some territories (like “Berlin”) that gives a huge amount of PUs to Germany, but I want the same territory to produce much less if taken by an enemy, like USSR. So I am trying to make a set of triggers that lowers the PU of the territory if Germany loses it, and raise it again when Germany gets control of it again.

Right now I have made the below set of triggers and conditions, and they work as far as lowering the PU just after the territory is lost.
But it does not seem to raise the PU again after ownership has returned / the territory is again Germany’s? Why does it not work?

Also, is this the cleanest triggers? Or could this be done in another manner?
 

        <attachment name="condition-Berlin-owned-by-Germany" attachTo="Germany" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
            <option name="directOwnershipTerritories" value="1:Berlin"/>
            <option name="rounds" value="1-+"/>
        </attachment>

        <attachment name="condition-Berlin-not-owned-by-Germany" attachTo="Germany" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
            <option name="directOwnershipTerritories" value="1:Berlin"/>
            <option name="rounds" value="1-+"/>
            <option name="invert" value="true"/>
        </attachment>

        <attachment name="triggerAttachment_Germany_now_control_Berlin" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
            <option name="conditions" value="condition-Berlin-owned-by-Germany"/>
            <option name="territories" value="Berlin"/>
            <option name="territoryProperty" value="production" count="45"/>
            <option name="when" value="before:GermanyEndTurn"/>
            <option name="when" value="before:SlovakiaEndTurn"/>       
            <option name="when" value="before:HungaryEndTurn"/>       
            <option name="when" value="before:RomaniaEndTurn"/>       
            <option name="when" value="before:BulgariaEndTurn"/>       
            <option name="when" value="before:CroatiaEndTurn"/>       
            <option name="when" value="before:FinlandEndTurn"/>       
            <option name="when" value="before:ItalyEndTurn"/>       
            <option name="when" value="before:IraqEndTurn"/>       
            <option name="when" value="before:IranEndTurn"/>       
            <option name="when" value="before:JapanEndTurn"/>       
            <option name="when" value="before:ThailandEndTurn"/>
        </attachment>

        <attachment name="triggerAttachment_Germany_now_control_Berlin" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
            <option name="conditions" value="condition-Berlin-not-owned-by-Germany"/>
            <option name="territories" value="Berlin"/>
            <option name="territoryProperty" value="production" count="9"/>
            <option name="when" value="before:USSREndTurn"/>
            <option name="when" value="before:FranceEndTurn"/>       
            <option name="when" value="before:French-ColoniesEndTurn"/>       
            <option name="when" value="before:BritainEndTurn"/>       
            <option name="when" value="before:British-ColoniesEndTurn"/>       
            <option name="when" value="before:South-AfricaEndTurn"/>       
            <option name="when" value="before:British-IndiaEndTurn"/>       
            <option name="when" value="before:ANZACEndTurn"/>       
            <option name="when" value="before:KNILEndTurn"/>       
            <option name="when" value="before:ChinaEndTurn"/>       
            <option name="when" value="before:USAEndTurn"/>       
            <option name="when" value="before:BrazilEndTurn"/>
        </attachment>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Triggers that change territory PU value back and forth

Cernel
The two TriggerAttachments have the same name; be sure such attachments are always differently named, or only one will be effective.
This is actually something that should be improved, from an engine standpoint, since when multiple have the same name, the engine won't tell you of this problem, but just exclude all but one (thus you may notice it only when you see that some is not working).
I'd suggest you open an issue about this, as the current behaviour really buries such mistakes.
History plays dice
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Triggers that change territory PU value back and forth

Frostion
This post was updated on .
Thanks... that was embarrassing LOL :) Stupid mistake.
And yes, it would be nice if there was an error report when there are conflicting names.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: davidvcsandersen@hotmail.com

redrum
Administrator
Yeah, eventually I'd like to get to a point where we validate as much of the XML upfront as possible. Technically this requires a few changes as the current XML structure is very 'loose'.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Triggers that change territory PU value back and forth

GhostWriter
This post was updated on .
In reply to this post by Cernel
RE: This is actually something that should be improved, from an engine standpoint, ...

would it be more efficient, from an engine standpoint, if we were to implement National Objectives AND then change the value of the province to the (enemy) minimum with the difference in value being applied to the National Objective (for the 'owning' player) ?

also, can the National Objectives be used in any (WW2 - aka A & A) game, including all/any versions thereof? in any TripleA game?

EDIT to ADD:

lastly, is this another method to implement Frostions original objective?
Loading...