User avatar
Christophe.Barot
Posts: 1135
Joined: Fri Jan 26, 2007 10:55 pm
Location: Paris (France)

Adapting policy to balance of power, test of balance - check and help needed

Sat Sep 07, 2013 9:25 am

OK, I went to missions to try to find samples of checks - in a further stage I will try (if possible, and works) to combine them, for example action of Great britain IF german army superior to french one AND french + russian fleet inferior to german + austrian one AND french + russian fleet inferior to british one, that's the idea

presently it doesn't work and game crashes? where am I wrong ?



// test to see if German Army superior to french one


SelectFaction = $GER [color="#FF0000"]// should be CMN for all to see the event, no ?[/color]
SelectRegion = $Brandenburg
StartEvent = Event_nam_CMN_Entente cordiale|1|2|NULL|NULL|$Brandenburg|NULL

Conditions
MinDate = 1904/01/04 // [color="#FF0000"]dates are to adapt to your own game[/color]
MaxDate = 1920/12/31
SelectFaction = $GER
EvalDiploItem = FRA;$diAllianceTreaty;NOT [color="#FF0000"]// I tried to check as a supplementary condition, but I perhaps forgot the selectfaction, was in event, but not conditions - I guess there is not already an event in france or britain about entente cordiale, I checked, should be but didn't find it - If there is one and I missed it, could explain, I set also images text and sound (was a french win sound) to NULL as it could interfere can someone test or analyse it ?[/color]

RegInit = 1
SelectSubUnits = Area $Continents_Europe;FactionTags GER;Domains $Land

SelectFaction = $FRA
RegInit = 2
SelectSubUnits = Area $Continents_Europe;FactionTags FRA;Domains $Land

RegEval = 1;>;2 [color="#FF0000"]// I inspired myself from the missions set at beginning of game, for conditions, but am not familiar with registers - this one is the most simple I could find - condition is fulfilled by far and large[/color] - how germany never formed and later why germany-still prussia actually never attacked France would remain a full mystery for me, ...wouldn't it be of course my defensive treaty with France and fact that if Prussian troops outnumber French ones by a 2:1 margin, I outnumber them (Prussians) by a 2:1 margin too - so guess system takes it into account,
Actually I also have a DEFENSIVE treaty in germany and a sizable chunk of my troops in in Turkey trying to subdue them i despair (in spite of TWO wars with me and subsequent crushing defeat almost annihilating, they won't end Balkan war, still lagging) - and the remaining either in garrison duty (watch for socialists/but west europeans would envy my social stability- or ouighurs, according to case) or in Austria (duly crushed as sarajevo event fired fine, but they won't the let hook out of Serbia, even when I destroy their army and occupy Austria from Tyrol to carpathians - so I made peace, what else) isn't taken into account, AI think simple - I hardly see anybody programming such cascade checks


RegDeactivate = NULL //I guess I need

Actions

SelectFaction = $GBR
AddDiploItem = FRA;$diAllianceTreaty;CURRENT
ChgFacRelationships = FRA;10
SelectFaction = $FRA
ChangeFacMorale = 10
SelectFaction = $GER
ChangeFacMorale = -5 // we consider that to restore balance, Bristish want german take them into the equation, of course - of course, French will be grateful and relations will improve - this boosts French morale and agressivity, while decrease german ones (as it is defensive and german have enemies enough and "nephew Willy" no hostility british, I consider they played it smooth, swallowed it, and limited reactions worsening)


EndEvent

// test to see if German+Austrian Navy superior to French+Russian one

SelectFaction = $FRA // should be CMN, no ?
SelectRegion = $Bretagne
evt_nam_CMN_Rule_Britannia_Never_Britons_will_be_[color="#FF0000"]SLAVS[/color]|1|2|NULL|NULL|$Bretagne|$Snd_GBR_AnthemWin // the anthem just for fun - of course text and image can be written in due time, if someone can test this one, adapting timeline

Conditions
MinDate = 1850/01/01
MaxDate = 1919/12/31 // did I tell you I was in 1919
[color="#FF0000"]
// Should I select a faction here ? sytematical ?[/color]

RegInit = 1
SelectSubUnits = FactionTags FRA;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine

SelectFaction = $GER
RegInit = 2
SelectSubUnits = FactionTags GER;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine

SelectFaction = $RUS
RegInit = 3
SelectSubUnits = FactionTags RUS;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine

SelectFaction = $AUS
RegInit = 4
SelectSubUnits = FactionTags AUS;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine

RegInit = 5
RegSum = Registry 1 3
RegInit = 6
RegSum = Registry 2 4
RegEval = 5;>;6
RegDeactivate = NULL [color="#FF0000"]// based it on naval missions, is syntax correct ?[/color]

Actions

SelectFaction = $GBR

AddDiploItem = GER;[color="#FF0000"]$diShowSupport[/color];CURRENT [color="#FF0000"]// is it correct spelling of order to place a diplomatic, also commitment less marked, splendid isolation accurate British style[/color]
ChgFacRelationships = FRA;-5
ChgFacRelationships = GER;5 // which are the numbers which would allow to check - this plus support, if event fired
SelectFaction = $FRA
ChangeFacMorale = -5 // British are displeased about Franco-Russian (yes, alliances are to be checked too, but one step at once)
SelectFaction = $GER
ChangeFacMorale = 1 // here a slight boost to encourage non naval competitors - in my game, comparison between Franco-Russian and Central powers naval threat is grotesque :rofl: - Russians built a powerful navy - nobody else did, germans and japanese have no fleet (so perhaps I don't overnumber Prussian army that much actually), and I guess a war with Britain - concentrated battleships against worlwide spread-out British frigates - would surprise british admiralty about results - is it Russian economic and military build up which deviates policy, or need AI a bit more naval tuning and a more attaractive replacement system of obsolete ships ?

EndEvent

[color="#FF0000"]if somebody can test and correct my script, many thanks, comparison is cornerstone of motivated AI strategic decisions[/color]
[color="#FF0000"]- (ordnance) Your Lordship, sorry to awake you, but The french are at our door !

- Alarm, alarm, how did you let this happen and not awake me ! repel them, counterattack at once !

- err, your Lordship, ahem... French are our allies, Marshal de St Arnaud is expected to attend to a conference with you !

- ahem, well, .... very well ..let them in !

(charge of the light brigade movie)
[/color]

User avatar
loki100
AGEod Guard of Honor
Posts: 2004
Joined: Sun Aug 14, 2011 4:15 pm
Location: Glasgow
Contact: Website Twitter

Tue Sep 10, 2013 7:33 pm

Hi

I'll adapt and test to see if I can make it work. In my current game i want a mechanism to make the British AI respond to its loss of a major war by seeking an alliance with Germany - but I didn't want to just impose it. So something like this should create the underlying dynamic I'm looking for

R
AJE The Hero, The Traitor and The Barbarian
PoN Manufacturing Italy; A clear bright sun
RoP The Mightiest Empires Fall
WIA Burning down the Houses; Wars in America; The Tea Wars

User avatar
Christophe.Barot
Posts: 1135
Joined: Fri Jan 26, 2007 10:55 pm
Location: Paris (France)

Fri Sep 13, 2013 1:19 pm

can we keep in touch ?
Im trying several approaches for conditional diplomatic moves, and trying to combine them (very very difficult, we don't have the "or" which is terrible, I tried to compare strength, worked, you can have a comparison of french and german army, and a condition, or of french+russian and german+austrian navies, works too

what I'd like is some possibilities to work with a conditional combination (like add italian fleet only of allied, or only if allied or support), for comparison ... very difficult, didn't manage it

AddDiploItem = FRA;$diAllianceTreaty;CURRENT won't work btw, it's $diDefensiveTreaty if I remember well (don't have file to check right at the moment), with correct alias, it works (tested another, more simple, condition)

cheers

Christophe
[color="#FF0000"]- (ordnance) Your Lordship, sorry to awake you, but The french are at our door !

- Alarm, alarm, how did you let this happen and not awake me ! repel them, counterattack at once !

- err, your Lordship, ahem... French are our allies, Marshal de St Arnaud is expected to attend to a conference with you !

- ahem, well, .... very well ..let them in !

(charge of the light brigade movie)
[/color]

Return to “PON Mods”

Who is online

Users browsing this forum: No registered users and 1 guest