factions at war help

Users who are viewing this thread

shalictar

I made to two factions start at war with eachother. but im not sure if how to keep them at war,

would I just add something like this in the script_randomly_start_war_peace text?

(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),
 
Basically that would be how you do it.  You could simplify your code a little by changing
Code:
(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),           
Just merge the two try blocks
Code:
(try_begin),
      (eq, ":cur_kingdom", fac_kingdom_1),
      (eq, ":cur_kingdom_2", fac_kingdom_2),
                          (assign, ":continue", 0),
      (else_try),
         (eq, ":cur_kingdom", fac_kingdom_2),
         (eq, ":cur_kingdom_2", fac_kingdom_1),
                  (assign, ":continue", 0),
      (try_end),           
 
It says this now
ERROR: usage of unassigned variables: :cur_kingdom
ERROR: usage of unassigned variables: :cur_kingdom_2
ERROR: usage of unassigned variables: :cur_kingdom
ERROR: usage of unassigned variables: :cur_kingdom_2
WARNING: Local variable never used continue

what should I do?

EDIT: would it be something like this?
(try_end),
        (eq, ":continue", 1),
              (call_script, "script_diplomacy_start_war_between_kingdoms", ":cur_kingdom", ":cur_kingdom_2", ":initializing_war_peace_cond"),
 
Ok well here is the first part of the make peace script in python.  This is what I have to prevent two factions from making peace.
("diplomacy_start_peace_between_kingdoms", #sets relations between two kingdoms
    [
      (store_script_param, ":kingdom_a", 1),
      (store_script_param, ":kingdom_b", 2),
      (store_script_param, ":initializing_war_peace_cond", 3),

      (store_relation, ":relation", ":kingdom_a", ":kingdom_b"),
      (val_max, ":relation", 0),
      (set_relation, ":kingdom_a", ":kingdom_b", ":relation"),
      (call_script, "script_exchange_prisoners_between_factions", ":kingdom_a", ":kingdom_b"),

      (try_begin),
        (eq, "$players_kingdom", ":kingdom_a"),
        (store_relation, ":relation", "fac_player_supporters_faction", ":kingdom_b"),
        (val_max, ":relation", 0),
        (call_script, "script_set_player_relation_with_faction", ":kingdom_b", ":relation"),
        (call_script, "script_event_kingdom_make_peace_with_kingdom", ":kingdom_b", "fac_player_supporters_faction"),
      (else_try),
        (eq, "$players_kingdom", ":kingdom_b"),
        (store_relation, ":relation", "fac_player_supporters_faction", ":kingdom_a"),
        (val_max, ":relation", 0),
        (call_script, "script_set_player_relation_with_faction", ":kingdom_a", ":relation"),
        (call_script, "script_event_kingdom_make_peace_with_kingdom", ":kingdom_a", "fac_player_supporters_faction"),
      (try_end),

      (try_begin),#added
          (eq, ":kingdom_a", "fac_kingdom_1"), #KKM added kingdom 1 vs 2
          (eq, ":kingdom_b", "fac_kingdom_2"), #added
          (assign, ":initializing_war_peace_cond", 0),
      (else_try),#added
          (eq, ":kingdom_a", "fac_kingdom_2"), #added kingdom 2 vs 1
          (eq, ":kingdom_b", "fac_kingdom_1"), #added
          (assign, ":initializing_war_peace_cond", 0),#added should make peace below impossible if I understand this correctly
 
Back
Top Bottom