Ok, I need the Rebel Alliance and Galactic Empire always to be at war in my Star Wars mod.... I have attempted to force these factions to always be at war many times in the past without any success, so am looking for other suggestions...
previously I had tried this concept...
added to "game_start" in module_scripts.py
the bottom of "randomly_start_war_peace" in module_scripts.py looks like this so they couldn't randomly declare peace
However, this doesn't seem to work 100% correctly....? does the logic in the code I added to flip the continue flag seem ok?
For the next release of my mod I'm thinking about trying some other concepts....
1) switch the declare war from game_start to once the game is loaded by adding the following to module_triggers.py
2) I'm thinking about adding a trigger every 24 hours to lower the relationship between those two factions? does anybody know what the code for this would be or how much I should lower the relationship every time? Or should I check the current relationship and lower it if it is greater then -0.5 or something like that?
3) I also want to add a trigger every 24 hours that will check if they are not at war and declare one if necessary. I tried adding the following code to module_simple_triggers.py but it gave a popup every 24 hours, so that doesn't work so I'd need to determine if they are currently at war and then only trigger that script if necessary....
4) I was thinking about completely eliminating the logic in the "randomly_start_war_peace" in module_scripts.py since I only have 3 factions and two of them should always be at war. So I could make it really simple and just give a random chance of the 3rd faction declaring war/peace with one of the other two factions.... ? But I'd probably need a way to check if that 3rd faction was already at war with somebody since it doesn't make sense for them to start a 2nd war.... It looks like the top part of the code for this script would be helpful since it calculates the number of ongoing wars. So I could use this type of code to check how many wars they currently had going on and declare one if necessary. But I don't know if I'm going to mess up the AI if I eliminate all the other logic in this script.....
Anyway, my coding skill aren't great and I'm at a loss here on the best way to fix this issue. any suggestions would be appreciated. thanks!
previously I had tried this concept...
added to "game_start" in module_scripts.py
Code:
#SW - uncommented so kingdom1 will always start at war with kingdom2 (added a 1 at the end to fixed script error, since its the war/peace flag)
#(call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_2",1),
the bottom of "randomly_start_war_peace" in module_scripts.py looks like this so they couldn't randomly declare peace
Code:
#------------------------------------------------------------------------------------------------------
#SW - trying to make it so empire and rebel can't declare peace
(try_begin),
(eq, ":cur_kingdom", fac_kingdom_1),
(eq, ":cur_kingdom_2", fac_kingdom_2),
(assign, ":continue", 0),
(try_end),
(try_begin),
(eq, ":cur_kingdom", fac_kingdom_2),
(eq, ":cur_kingdom_2", fac_kingdom_1),
(assign, ":continue", 0),
(try_end),
#------------------------------------------------------------------------------------------------------
(try_end),
(eq, ":continue", 1),
(call_script, "script_diplomacy_start_war_between_kingdoms", ":cur_kingdom", ":cur_kingdom_2", ":initializing_war_peace_cond"),
However, this doesn't seem to work 100% correctly....? does the logic in the code I added to flip the continue flag seem ok?
For the next release of my mod I'm thinking about trying some other concepts....
1) switch the declare war from game_start to once the game is loaded by adding the following to module_triggers.py
Code:
(0.2, 0, ti_once, [(map_free,0)], [
#SW - added so kingdom1 will always start at war with kingdom2 (added a 1 at the end to fixed script error, since its the war/peace flag)
(call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_2",1)
]),
2) I'm thinking about adding a trigger every 24 hours to lower the relationship between those two factions? does anybody know what the code for this would be or how much I should lower the relationship every time? Or should I check the current relationship and lower it if it is greater then -0.5 or something like that?
3) I also want to add a trigger every 24 hours that will check if they are not at war and declare one if necessary. I tried adding the following code to module_simple_triggers.py but it gave a popup every 24 hours, so that doesn't work so I'd need to determine if they are currently at war and then only trigger that script if necessary....
Code:
# #SW - make sure faction1 (empire) and faction2 (rebel) are always at war (popup appears every time unfortunately, even if they are at war)
# (24,
# [
# (call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_1", "fac_kingdom_2",1),
# ])
4) I was thinking about completely eliminating the logic in the "randomly_start_war_peace" in module_scripts.py since I only have 3 factions and two of them should always be at war. So I could make it really simple and just give a random chance of the 3rd faction declaring war/peace with one of the other two factions.... ? But I'd probably need a way to check if that 3rd faction was already at war with somebody since it doesn't make sense for them to start a 2nd war.... It looks like the top part of the code for this script would be helpful since it calculates the number of ongoing wars. So I could use this type of code to check how many wars they currently had going on and declare one if necessary. But I don't know if I'm going to mess up the AI if I eliminate all the other logic in this script.....
Code:
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
## (neq, ":cur_kingdom", "fac_player_supporters_faction"),
(faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
(assign, ":num_ongoing_wars", 0),
(try_for_range, ":other_kingdom", kingdoms_begin, kingdoms_end),
(faction_slot_eq, ":other_kingdom", slot_faction_state, sfs_active),
(store_relation, ":other_relation", ":cur_kingdom", ":other_kingdom"),
(lt, ":other_relation", 0),
(val_add, ":num_ongoing_wars", 1),
(try_end),
Anyway, my coding skill aren't great and I'm at a loss here on the best way to fix this issue. any suggestions would be appreciated. thanks!