[Q] How to script wars?

Users who are viewing this thread

Demonwolf

Knight
Ok so I've been making a mod from Floris, and I just found out that Diplomacy mod (which Floris uses) uses different scripts for wars. So how would you script wars between factions?

Thanks,
Demonwolf
 
In general, wars are governed by Native scripts that start with the word "diplomacy". Specifically the script that begins a war is: "script_diplomacy_start_war_between_kingdoms".

To script when/where/how that happens, you'd need to edit when/where/how it can be called for given factions, either by changing the calls to that script or adding checks at the beginning of the script to exclude factions during a certain time period or what have you.

The Diplomacy mod scripts that add the other levels of diplomatic relations (trade agreements, etc) are named similarly to the Native scripts, though they begin with "dplmc" rather than "diplomacy"

EDIT - addendum: the scripts that decide whether or not to call the starting of wars, etc, are the various AI checklists, for instance: "script_npc_decision_checklist_peace_or_war", "script_npc_decision_checklist_faction_ai", "script_npc_decision_checklist_faction_ai_alt"

 
Caba`drin said:
In general, wars are governed by Native scripts that start with the word "diplomacy". Specifically the script that begins a war is: "script_diplomacy_start_war_between_kingdoms".

To script when/where/how that happens, you'd need to edit when/where/how it can be called for given factions, either by changing the calls to that script or adding checks at the beginning of the script to exclude factions during a certain time period or what have you.

The Diplomacy mod scripts that add the other levels of diplomatic relations (trade agreements, etc) are named similarly to the Native scripts, though they begin with "dplmc" rather than "diplomacy"

EDIT - addendum: the scripts that decide whether or not to call the starting of wars, etc, are the various AI checklists, for instance: "script_npc_decision_checklist_peace_or_war", "script_npc_decision_checklist_faction_ai", "script_npc_decision_checklist_faction_ai_alt"

:shock:

I don't understand a thing, sorry  :mrgreen:

Where in the code let's you start wars as soon as you start game? Like how Swadians must fight either Nords or Rhodoks?
 
These early wars are initialized by beginning "territorial disputes"--essentially telling factions that they used to own certain centers--in module_scripts, the script "game_start", by the following code:
Code:
	  	  
	  #set territorial disputes/outstanding border issues 
	  (party_set_slot, "p_castle_10", slot_center_ex_faction, "fac_kingdom_2"), #vaegirs claim nord-held alburq
	  (party_set_slot, "p_castle_13", slot_center_ex_faction, "fac_kingdom_4"), #nords claim swadian-held kelredan
	  (party_set_slot, "p_castle_15", slot_center_ex_faction, "fac_kingdom_1"), #swadians claim rhodok-held ergelon
	  (party_set_slot, "p_castle_46", slot_center_ex_faction, "fac_kingdom_5"), #rhodoks claim sarranid-held weyyah
	  (party_set_slot, "p_castle_40", slot_center_ex_faction, "fac_kingdom_6"), #sarranids claim khergit-held uhhun
	  (party_set_slot, "p_town_11",   slot_center_ex_faction, "fac_kingdom_3"), #Khergits claim vaegir-held curaw
	  
	  #Swadians, being in the middle, will have additional claims on two of their neighhbors
	  (party_set_slot, "p_castle_15", slot_center_ex_faction, "fac_kingdom_1"), #swadians claim vaegir-held tilbault
	  (party_set_slot, "p_castle_22", slot_center_ex_faction, "fac_kingdom_1"), #swadians claim khergit-held unuzdaq	  

	  #this should come after assignment of territorial grievances
      (try_for_range, ":unused", 0, 70),
        (try_begin),
          (eq, "$cheat_mode", 1),
          (display_message, "@{!}DEBUG -- initial war/peace check begins"),
        (try_end),
        (call_script, "script_randomly_start_war_peace_new", 0),
      (try_end),	  	  	 
After the disputes are set, the script fires 70 times, each time with a chance to turn one of the territorial disputes into a real war.
 
Caba`drin said:
These early wars are initialized by beginning "territorial disputes"--essentially telling factions that they used to own certain centers--in module_scripts, the script "game_start", by the following code:
Code:
	  	  
	  #set territorial disputes/outstanding border issues 
	  (party_set_slot, "p_castle_10", slot_center_ex_faction, "fac_kingdom_2"), #vaegirs claim nord-held alburq
	  (party_set_slot, "p_castle_13", slot_center_ex_faction, "fac_kingdom_4"), #nords claim swadian-held kelredan
	  (party_set_slot, "p_castle_15", slot_center_ex_faction, "fac_kingdom_1"), #swadians claim rhodok-held ergelon
	  (party_set_slot, "p_castle_46", slot_center_ex_faction, "fac_kingdom_5"), #rhodoks claim sarranid-held weyyah
	  (party_set_slot, "p_castle_40", slot_center_ex_faction, "fac_kingdom_6"), #sarranids claim khergit-held uhhun
	  (party_set_slot, "p_town_11",   slot_center_ex_faction, "fac_kingdom_3"), #Khergits claim vaegir-held curaw
	  
	  #Swadians, being in the middle, will have additional claims on two of their neighhbors
	  (party_set_slot, "p_castle_15", slot_center_ex_faction, "fac_kingdom_1"), #swadians claim vaegir-held tilbault
	  (party_set_slot, "p_castle_22", slot_center_ex_faction, "fac_kingdom_1"), #swadians claim khergit-held unuzdaq	  

	  #this should come after assignment of territorial grievances
      (try_for_range, ":unused", 0, 70),
        (try_begin),
          (eq, "$cheat_mode", 1),
          (display_message, "@{!}DEBUG -- initial war/peace check begins"),
        (try_end),
        (call_script, "script_randomly_start_war_peace_new", 0),
      (try_end),	  	  	 
After the disputes are set, the script fires 70 times, each time with a chance to turn one of the territorial disputes into a real war.

Thanks mate  :grin:
 
Back
Top Bottom