Morocco crisis - a (failed) attempt to combine conditions
Posted: Sat Sep 14, 2013 12:41 am
OK, guys (and girls too if any is reading me) After adapting Chinese, Persian and Egyptian colonial events I tried to simulate Morocco crisis by combining alliance (and support) and unit comparison conditions - idea is to create a registry of unit count (which i know to use now) ONLY if certain conditions are met - presently either alliances or supports - so I considered Algesiras conferences, and tried to create conditionally registers - 2 pitfalls :
- diplomatic conditions may apply to event (and cancel his occurence) rather than prteventing to fill a registry if my scripting is wroing
- not creating a registry, which I use later could crash tge game [color="#FF0000"]// any explaination and hints appreciated[/color]
after, in my actions, I try (again) to set a colonial level if French win (if germany win the gathering allies match, level of penetration imlproves, Germany wins morale and Morocco alliance (passes in german sphere of influence ) as was supposed counter French takeover and protect Morocco independance (not for Morocco you bet, mostly to annoy and weaken French rival)
so 2 events created , one if count (if works) favourable to french (should be given all alliances that were added), francewin should occur - german win was written too, count is just reverse, so I wanted to see what happens : here is the French favourable outcome event :
SelectFaction = $FRA
SelectRegion = $Ile de France
StartEvent = evt_nam_FRA_Algesiras1906_Francewin|1|2|NULL|NULL|$Ile de France|NULL [color="#FF0000"]// image, text and sound later[/color]
Conditions
MinDate = 1906/01/01
MaxDate = 1919/12/31
Probability = 100 [color="#FF0000"]// to change later[/color]
SelectFaction = $FRA
EvalIsAtPeaceWith = GER [color="#FF0000"]// if not, they have other business to care, clearly[/color]
SelectFaction = $FRA
RegInit = 1
SelectSubUnits = Area $Continents_Europe;FactionTags FRA;Domains $Land
RegInit = 2
SelectSubUnits = FactionTags AUS;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#00FFFF"]// so 1 = French Army, and 2 = French navy, conditionally, army is useful to evaluate direct pressure on border - spare pride of a powerful foe, navy because you can't keep colonies if you can't send troops there, which Bismarck fully understood[/color]
SelectFaction = $GBR
EvalDiploItem = FRA;$diDefensiveTreaty [color="#FF0000"]// does it condition the reginit or the event - I want British fleet enter the count on the French side - only if France is allied with Britain, which won't usually be the case but is as I tested Entente cordiale event - in future France should have a British support by Egyptia event, and an Italian one by Lybia event[/color]
RegInit = 3
SelectSubUnits = FactionTags GBR;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#FF0000"]// with 3 I count the Royal navy, only as it exert an effect on naval and colonial matters[/color]
SelectFaction = $GBR
EvalDiploItem = FRA;$diShowSupport [color="#FF0000"]// written like that, is it Britain supporting France or the reverse[/color]
SelectFaction = $GBR [color="#B22222"]// I wonder if duplicating faction here is without effect or disjoint condition of support (non existant anyway) from creation of reginit 4[/color]
RegInit = 4
SelectSubUnits = FactionTags GBR;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#FF0000"]// Reginit 4 is Royal Navy, too, same number, but appears only if Britain supports France - I consider that a motivated supporting ally count more - to balance importance of double strength due to support and alliance (potentially) I count the main protagonist twice, Army AND Navy [/color]
SelectFaction = [color="#FF0000"]$FRA[/color]
EvalDiploItem = [color="#FF0000"]RUS[/color];$diDefensiveTreaty
SelectFaction = [color="#FF0000"]$GBR[/color]
RegInit = 5
SelectSubUnits = Area $Continents_Europe;[color="#FF0000"]FactionTags RUS[/color];Domains $Land
[color="#006400"]// Reginit 5 is supposed to be Russian army (huge and powerful in my game, superior to any other) which imports by pressure on german borders if Russia is allied with France (you can bet I did that) - [color="#FF0000"]but seems I messed up things, let survive a line with Great britain (which serves no purpose, just copied, pasted changed .. and forgot)[/color][/color]
SelectFaction = $RUS
EvalDiploItem = FRA;$diShowSupport
RegInit = 6
SelectSubUnits = Area $Continents_Europe;FactionTags RUS;Domains $Land
[color="#FF0000"]// ditto 6 is still russian Army, I wish to count it ONLY if I support France (which I am not doing presently, but alliance is in effect my other alliance, with germany, is irrelevant here, I'm supposed to exert a silent "freindly" pressure on Germany)[/color]
SelectFaction = $ITA
EvalDiploItem = FRA;$diShowSupport [color="#FF0000"]// I hope it means Italy supports France and not the reverse, someone may confirm it to me ?[/color]
RegInit = 7
SelectSubUnits = FactionTags GBR;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#008000"]// ditto for Italian Navy 7, due to Triplice no alliance, but Italy had in 1902 an agreement with France, free hands in Morocco against free hands in Lybia, and supported France at Algesiras - will create the event, presently she hasn't - and to be honest neither had a big Navy to speak of[/color]
SelectFaction = $USA
RegInit = 8
SelectSubUnits = FactionTags GBR;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#0000FF"]// 8 is US NAVY, following Mahan principles bias here, no condition, as US liked republica, Democratic France, and disliked (especially Theodore roosevelt german militarism - and Russian Autocracy - a structural stabce - so even without support of Frnech claims, they sided with France, moral stance, France seen as victim of german agressor looking for a war, or pure hostility to Rmpire , no alliance of course, hey ! do Monroe doctrine , and isolationnism rings a bell to you ? now, size of US navy is limited, to the least
[/color]
SelectFaction = $GER
RegInit = 9
SelectSubUnits = Area $Continents_Europe;FactionTags GER;Domains $Land
RegInit = 10
SelectSubUnits = FactionTags GER;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#000000"]// now german side, counting Army and Tirpitz Kriegsmarine[/color]
SelectFaction = $GER
[color="#000000"]EvalDiploItem = AUS;$diDefensiveTreaty // counting Austrian army (incidentally, in my game, crushed by Russia, they still have enough to invade Serbia, but not much more, in spite of huge german army, with France and Russia, balance of power do not favour German side - and yes, Austria DOES HAVE a defensive treaty with the kaiser, of course[/color]
SelectFaction = $AUS
RegInit = 11
SelectSubUnits = Area $Continents_Europe;FactionTags AUS;Domains $Land
SelectFaction = $AUS
EvalDiploItem = GER;$diShowSupport
RegInit = 12
SelectSubUnits = Area $Continents_Europe;FactionTags AUS;Domains $Land [color="#000000"]// 11 and 12 Austrian army, count here to counter Russia (ahem), 11 should exist, if my writing works, 12 shouldn't be counted as Austria do not support germany[/color]
RegInit = 13
RegSum = Registry 1 2 3 4 5 6 7 8
RegInit = 14
RegSum = Registry 9 10 11 12
RegEval = 13;>;14
RegDeactivate = NULL
/[color="#FF0000"]/ 13 is sum of French support 1 2 French Army navy 3 4 (should not exist) allied /supporting royal navy 5 (miswritten) 6 (non existant) allied supporting russian army 7 nonexistant supporting Italian navy and 8 US navy - > I should add here 1 2 3 (5?) 8 and let aside (but will it, or other values) 4 5 (miswritten) ? 6 and 7
[/color]
Actions
// DescEvent = evt_desc_FRA_Algesiras1906_Francewin description later
SelectFaction = $SPA
SelectRegion = $El Rif
ChgColonialPen = 50
SelectRegion = $Tangiers
ChangeRgnOwner = MOR // Tangiers go to Spain
ChgColonialPen = 50
SelectFaction = $FRA
ChgObjective = $Rabat;8
AddDiploItem = MOR;$diDefensiveTreaty;CURRENT
AddDiploItem = MOR;$diMutualSupply;CURRENT
ChgFacRelationships = MOR;50
ChgFacRelationships = SPA;10
ChgFacRelationships = GBR;10
ChgFacRelationships = RUS;5
ChgFacRelationships = USA;10
ChgFacRelationships = ITA;5
ChgFacRelationships = GER;-5
// alliance and supply (to ensure it works) to Morocco, actually is is military control and crossing Rights even in a cappital - changes of relations, change of national morale
SelectFaction = $FRA
ChangeFacMorale = 10
SelectFaction = $GER
ChangeFacMorale = -5
SelectFaction = $FRA
SelectRegion = $Meknes
ChgColonialPen = 50
AddRgnDecisionAct = $rgdCustoms;CURRENT // changing colonial status usually don't work, and SOI changes made a mess in all existing SOI, so i avoid, de jure independant Morocco is de facto a colony, France controls his custome, I can refine, add Spain, control railway ...
SelectRegion = $Rabat
ChangeRgnOwner = MOR
ChgColonialPen = 50
SelectRegion = $Safi
ChangeRgnOwner = MOR
ChgColonialPen = 50
SelectRegion = $Marrakesh
ChangeRgnOwner = MOR
ChgColonialPen = 50
SelectRegion = $Agadir
ChangeRgnOwner = MOR
ChgColonialPen = 50
SelectRegion = $Zagora
ChangeRgnOwner = MOR
ChgColonialPen = 50
[color="#FF0000"]
// transfer of Areas control, then I test effects of protectorate, but event did not fire , why ??? [/color]
SelectFaction = $FRA
SetColStatusArea = $Colony_Morocco;$colProtectorate // I fear the worse
EndEvent
- diplomatic conditions may apply to event (and cancel his occurence) rather than prteventing to fill a registry if my scripting is wroing
- not creating a registry, which I use later could crash tge game [color="#FF0000"]// any explaination and hints appreciated[/color]
after, in my actions, I try (again) to set a colonial level if French win (if germany win the gathering allies match, level of penetration imlproves, Germany wins morale and Morocco alliance (passes in german sphere of influence ) as was supposed counter French takeover and protect Morocco independance (not for Morocco you bet, mostly to annoy and weaken French rival)
so 2 events created , one if count (if works) favourable to french (should be given all alliances that were added), francewin should occur - german win was written too, count is just reverse, so I wanted to see what happens : here is the French favourable outcome event :
SelectFaction = $FRA
SelectRegion = $Ile de France
StartEvent = evt_nam_FRA_Algesiras1906_Francewin|1|2|NULL|NULL|$Ile de France|NULL [color="#FF0000"]// image, text and sound later[/color]
Conditions
MinDate = 1906/01/01
MaxDate = 1919/12/31
Probability = 100 [color="#FF0000"]// to change later[/color]
SelectFaction = $FRA
EvalIsAtPeaceWith = GER [color="#FF0000"]// if not, they have other business to care, clearly[/color]
SelectFaction = $FRA
RegInit = 1
SelectSubUnits = Area $Continents_Europe;FactionTags FRA;Domains $Land
RegInit = 2
SelectSubUnits = FactionTags AUS;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#00FFFF"]// so 1 = French Army, and 2 = French navy, conditionally, army is useful to evaluate direct pressure on border - spare pride of a powerful foe, navy because you can't keep colonies if you can't send troops there, which Bismarck fully understood[/color]
SelectFaction = $GBR
EvalDiploItem = FRA;$diDefensiveTreaty [color="#FF0000"]// does it condition the reginit or the event - I want British fleet enter the count on the French side - only if France is allied with Britain, which won't usually be the case but is as I tested Entente cordiale event - in future France should have a British support by Egyptia event, and an Italian one by Lybia event[/color]
RegInit = 3
SelectSubUnits = FactionTags GBR;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#FF0000"]// with 3 I count the Royal navy, only as it exert an effect on naval and colonial matters[/color]
SelectFaction = $GBR
EvalDiploItem = FRA;$diShowSupport [color="#FF0000"]// written like that, is it Britain supporting France or the reverse[/color]
SelectFaction = $GBR [color="#B22222"]// I wonder if duplicating faction here is without effect or disjoint condition of support (non existant anyway) from creation of reginit 4[/color]
RegInit = 4
SelectSubUnits = FactionTags GBR;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#FF0000"]// Reginit 4 is Royal Navy, too, same number, but appears only if Britain supports France - I consider that a motivated supporting ally count more - to balance importance of double strength due to support and alliance (potentially) I count the main protagonist twice, Army AND Navy [/color]
SelectFaction = [color="#FF0000"]$FRA[/color]
EvalDiploItem = [color="#FF0000"]RUS[/color];$diDefensiveTreaty
SelectFaction = [color="#FF0000"]$GBR[/color]
RegInit = 5
SelectSubUnits = Area $Continents_Europe;[color="#FF0000"]FactionTags RUS[/color];Domains $Land
[color="#006400"]// Reginit 5 is supposed to be Russian army (huge and powerful in my game, superior to any other) which imports by pressure on german borders if Russia is allied with France (you can bet I did that) - [color="#FF0000"]but seems I messed up things, let survive a line with Great britain (which serves no purpose, just copied, pasted changed .. and forgot)[/color][/color]
SelectFaction = $RUS
EvalDiploItem = FRA;$diShowSupport
RegInit = 6
SelectSubUnits = Area $Continents_Europe;FactionTags RUS;Domains $Land
[color="#FF0000"]// ditto 6 is still russian Army, I wish to count it ONLY if I support France (which I am not doing presently, but alliance is in effect my other alliance, with germany, is irrelevant here, I'm supposed to exert a silent "freindly" pressure on Germany)[/color]
SelectFaction = $ITA
EvalDiploItem = FRA;$diShowSupport [color="#FF0000"]// I hope it means Italy supports France and not the reverse, someone may confirm it to me ?[/color]
RegInit = 7
SelectSubUnits = FactionTags GBR;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#008000"]// ditto for Italian Navy 7, due to Triplice no alliance, but Italy had in 1902 an agreement with France, free hands in Morocco against free hands in Lybia, and supported France at Algesiras - will create the event, presently she hasn't - and to be honest neither had a big Navy to speak of[/color]
SelectFaction = $USA
RegInit = 8
SelectSubUnits = FactionTags GBR;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#0000FF"]// 8 is US NAVY, following Mahan principles bias here, no condition, as US liked republica, Democratic France, and disliked (especially Theodore roosevelt german militarism - and Russian Autocracy - a structural stabce - so even without support of Frnech claims, they sided with France, moral stance, France seen as victim of german agressor looking for a war, or pure hostility to Rmpire , no alliance of course, hey ! do Monroe doctrine , and isolationnism rings a bell to you ? now, size of US navy is limited, to the least
[/color]
SelectFaction = $GER
RegInit = 9
SelectSubUnits = Area $Continents_Europe;FactionTags GER;Domains $Land
RegInit = 10
SelectSubUnits = FactionTags GER;Families $famHvyWarship $famLightWarship $famRaiderShip $famHvyCoastalShip $famLitCoastalShip $famCarrierShip $famSubmarine
[color="#000000"]// now german side, counting Army and Tirpitz Kriegsmarine[/color]
SelectFaction = $GER
[color="#000000"]EvalDiploItem = AUS;$diDefensiveTreaty // counting Austrian army (incidentally, in my game, crushed by Russia, they still have enough to invade Serbia, but not much more, in spite of huge german army, with France and Russia, balance of power do not favour German side - and yes, Austria DOES HAVE a defensive treaty with the kaiser, of course[/color]
SelectFaction = $AUS
RegInit = 11
SelectSubUnits = Area $Continents_Europe;FactionTags AUS;Domains $Land
SelectFaction = $AUS
EvalDiploItem = GER;$diShowSupport
RegInit = 12
SelectSubUnits = Area $Continents_Europe;FactionTags AUS;Domains $Land [color="#000000"]// 11 and 12 Austrian army, count here to counter Russia (ahem), 11 should exist, if my writing works, 12 shouldn't be counted as Austria do not support germany[/color]
RegInit = 13
RegSum = Registry 1 2 3 4 5 6 7 8
RegInit = 14
RegSum = Registry 9 10 11 12
RegEval = 13;>;14
RegDeactivate = NULL
/[color="#FF0000"]/ 13 is sum of French support 1 2 French Army navy 3 4 (should not exist) allied /supporting royal navy 5 (miswritten) 6 (non existant) allied supporting russian army 7 nonexistant supporting Italian navy and 8 US navy - > I should add here 1 2 3 (5?) 8 and let aside (but will it, or other values) 4 5 (miswritten) ? 6 and 7
[/color]
Actions
// DescEvent = evt_desc_FRA_Algesiras1906_Francewin description later
SelectFaction = $SPA
SelectRegion = $El Rif
ChgColonialPen = 50
SelectRegion = $Tangiers
ChangeRgnOwner = MOR // Tangiers go to Spain
ChgColonialPen = 50
SelectFaction = $FRA
ChgObjective = $Rabat;8
AddDiploItem = MOR;$diDefensiveTreaty;CURRENT
AddDiploItem = MOR;$diMutualSupply;CURRENT
ChgFacRelationships = MOR;50
ChgFacRelationships = SPA;10
ChgFacRelationships = GBR;10
ChgFacRelationships = RUS;5
ChgFacRelationships = USA;10
ChgFacRelationships = ITA;5
ChgFacRelationships = GER;-5
// alliance and supply (to ensure it works) to Morocco, actually is is military control and crossing Rights even in a cappital - changes of relations, change of national morale
SelectFaction = $FRA
ChangeFacMorale = 10
SelectFaction = $GER
ChangeFacMorale = -5
SelectFaction = $FRA
SelectRegion = $Meknes
ChgColonialPen = 50
AddRgnDecisionAct = $rgdCustoms;CURRENT // changing colonial status usually don't work, and SOI changes made a mess in all existing SOI, so i avoid, de jure independant Morocco is de facto a colony, France controls his custome, I can refine, add Spain, control railway ...
SelectRegion = $Rabat
ChangeRgnOwner = MOR
ChgColonialPen = 50
SelectRegion = $Safi
ChangeRgnOwner = MOR
ChgColonialPen = 50
SelectRegion = $Marrakesh
ChangeRgnOwner = MOR
ChgColonialPen = 50
SelectRegion = $Agadir
ChangeRgnOwner = MOR
ChgColonialPen = 50
SelectRegion = $Zagora
ChangeRgnOwner = MOR
ChgColonialPen = 50
[color="#FF0000"]
// transfer of Areas control, then I test effects of protectorate, but event did not fire , why ??? [/color]
SelectFaction = $FRA
SetColStatusArea = $Colony_Morocco;$colProtectorate // I fear the worse
EndEvent