PDA

View Full Version : Tutorial (Kingdoms): Merging two factions mid-campaign



Epistolary Richard
09-02-2007, 15:02
The second part of the Kalmar Union script is the merging of the Danish & Norwegian factions or, more accurately, the acquisition of the Norwegian faction by the Danish.

This first one allows you to change a faction's icon in the middle of a campaign as part of the campaign script.


Merging two factions (having one faction acquire another) part-way through a campaign

The command is (as used in the Kalmar Union script):



;turn over norways assets to denmark
give_everything_to_faction norway denmark false


The first faction is the target faction, the second faction is the acquiring faction. Not sure what the true/false parameter is.


And so, here is a test script I used:



monitor_event FactionTurnStart FactionType teutonic_order
and I_TurnNumber = 1


give_everything_to_faction mongols teutonic_order false


terminate_monitor

end_monitor




Turn 1 - Teutons start with original territory
https://img214.imageshack.us/img214/4431/teutonsacquiremongols1da8.th.jpg (https://img214.imageshack.us/my.php?image=teutonsacquiremongols1da8.jpg)


Turn 2 - Teutons acquire Mongol territory - Mongol family members become Teuton generals
https://img214.imageshack.us/img214/6152/teutonsacquiremongols2jz5.th.jpg (https://img214.imageshack.us/my.php?image=teutonsacquiremongols2jz5.jpg)



What use might it be?

A few different thoughts on this. The first is that medieval kings gained territory in more ways that outright conquest, this command could be used to represent the merging of crowns, perhaps through inheritance, perhaps through being offered (as the crown of the Sicily was by the pope), through purchase or indeed any other criteria that could be scripted. The other is that this could be an alternative to the repetative process of having to annihilate factions down to their last stronghold. If a faction has been beaten back to a single territory if it has its faction leader killed, then maybe they might be prepared to surrender to their aggressors - or alternatively they might try to merge with another neighbouring faction in the knowledge that their aggressors may back off.

Rhyfelwyr
09-02-2007, 16:56
Could this feature be implemented into the Grand Camapaign?

Epistolary Richard
09-02-2007, 19:18
I've not tested it, but the other scripting commands introduced in Kingdoms have not been able to be used in the Grand Campaign.

alpaca
09-02-2007, 20:06
I've not tested it, but the other scripting commands introduced in Kingdoms have not been able to be used in the Grand Campaign.
My guess is that at this time they need the Kingdoms exe to be executed.

Lusted
09-02-2007, 22:29
That seems to be correct, and with the retrofit mod already out it means that modders can use that as a basis.

JoristhePagan
05-14-2009, 13:45
Can you script that if a princess maries a faction leader and he dies without children the entire faction will be transfered to the on that owned the princess? I know that would be a lot of work, just want to know if it's possible.

Makanyane
05-15-2009, 21:04
it's quite unlikely that faction leader wouldn't have children...

but you could give faction leader of faction 'c' trait 'a' (I think)
and give any children of that father with fathertrait 'a' another trait 'b'

and then set condition in script that if no-one living has trait 'b' all of faction 'c'
is given to faction 'd'

am not entirely sure if the link to princess is recordable - you'd need to work out
if marriage of princess from faction 'd' can be used in first place to trigger giving trait 'a' to leader of faction 'c'


if you've only got two factions the example would be as above - if you've got a lot of factions the whole thing would expand exponentially, with you needing to code each case; eg. that princess from faction 'f' marries leader of faction 'g', or faction 'd' etc... and every other permutation!

JoristhePagan
05-17-2009, 13:36
I knew that, scripting is mainly a lot of work.

Makanyane
05-17-2009, 18:55
Yup :yes:


it's quite unlikely that faction leader wouldn't have children...


I was actually a bit wrong on that, if you meant true, born as baby, children. If he hasn't got children who haven't come of age yet coded for him in descr_strat, and faction expands so game starts wanting to give it more generals, he's likely to end up with adopted generals filling the slots, especially if its an AI controlled faction.


the other thing to look at would be to use an ancillary derived from the inherited traits, which is passed to real son and heirs.... you can quite easily code monitors to use

and not FactionwideAncillaryExists Im_a_heir_anc true
checking for faction not having a trait is messier as there isn't a FactionwideTraitExists command, though you could probably get round it with counters