Starting diplomatic settings.

Users who are viewing this thread

Cozur

Grandmaster Knight
Is there a way to change the starting diplomatic settings? I know you can decide whether a faction is going to be at peace or at war with another one in the module_faction, but I was wondering if there is a way to set defensive alliances right from the start?
 
Cozur said:
Is there a way to change the starting diplomatic settings? I know you can decide whether a faction is going to be at peace or at war with another one in the module_faction, but I was wondering if there is a way to set defensive alliances right from the start?

Yes.  In module_scripts.py, find the script named game_start, and add code like this to the end of it:

Code:
#Make kingdom 1 and kingdom 2 start the game in a defensive alliance.
#Note that this code only works properly at the very start of the game.
(set_relation, "fac_kingdom_1", "fac_kingdom_2", 50),
(store_sub, ":treaty_slot", fac_kingdom_2, kingdoms_begin),
(val_add, ":treaty_slot", slot_faction_truce_days_with_factions_begin),
(faction_set_slot, "fac_kingdom_1", ":treaty_slot", dplmc_treaty_defense_days_initial),#Because stronger treaties degrade to weaker ones over time, instead of storing treaty type separately the number of days remaining in the treaty is used to determine what kind of treaty it is.
(val_sub, ":treaty_slot", "fac_kingdom_2"),
(val_add, ":treaty_slot", "fac_kingdom_1"),
(faction_set_slot, "fac_kingdom_2", ":treaty_slot", dplmc_treaty_defense_days_initial),

Alternately, you could do this:

Code:
#Make kingdom 1 and kingdom 2 enter a defensive alliance.
#The third parameter should be 0 if you're doing this as part of the initial setup
#in script_game_start, but must be 1 if you're doing this at any other time.
(call_script, "dplmc_start_defensive_between_kingdoms", "fac_kingdom_1", "fac_kingdom_2", 0),
 
Back
Top Bottom