OSP Code Campaign Loyalty Check Simple Trigger

Users who are viewing this thread

Lionheart2

Veteran
I have designed a new simple trigger that checks the loyalty of a center. Basically, each week a random center is selected. This center is assigned a value (1 or 2), and if the value equals 2, it is either is reinforced if it belongs to its original faction, or returned to its original faction "without a fight", but the garrison is very small. Feel free to use in any mod.

Paste at the top of module_simple_triggers.py, after the "simple_triggers = [ "

Code:
  (240, #Every 10 days
    [
#    (assign, ":cur_party", -1),
#    (assign, ":orig_faction", -1),
      (store_random_in_range, ":cur_party", walled_centers_begin, walled_centers_end),
      (try_begin),
        (eq, ":cur_party", slot_last_choice),
        (store_random_in_range, ":cur_party", walled_centers_begin, walled_centers_end),
      (try_end),
      (store_faction_of_party, ":cur_faction", ":cur_party"),
      (party_get_slot, ":orig_faction", ":cur_party", slot_center_original_faction),
      (store_random_in_range, ":chance",1,3), # Fifty-fifty chance I believe
#If test passes and original faction still is in control, recieve reinforcements
      (try_begin), 
        (eq, ":chance", 2),
        (eq, ":cur_faction", ":orig_faction"),
        (call_script, "script_cf_reinforce_party", ":cur_party"), #Reinforce Twice
        (call_script, "script_cf_reinforce_party", ":cur_party"),
      (else_try),
        (eq, ":chance", 2),
        (neq, ":cur_faction", ":orig_faction"),
        (neq, ":cur_faction", "fac_player_supporters_faction"),
        (party_clear, ":cur_party"),
        (call_script, "script_give_center_to_faction_aux", ":cur_party", ":orig_faction"),
        (call_script, "script_cf_reinforce_party", ":cur_party"), #Add a miniscule garrison
      (try_end),
      (assign, ":cur_party", slot_last_choice),
#    (party_set_faction,":cur_party", "orig_faction"),
    ]),

I may add a Lord Loyalty Check to this in the future.
 
A couple of thoughts regarding your loyalty trigger.

1) There is no notification for when a center rejoins it's original faction. you could add something like this after (call_script, "script_give_center_to_faction...
(Dunno the exact syntax at the top of my head)
(store_party_string, s1, ":cur_party"),
(store_party_string, s2, ":eek:rig_faction"),
(display_message, "@ {s1} has rebelled and rejoined {s2}"),

2)
There doesn't seem to be a way to prevent a fief from returning to it's original faction. Which means, you could control a walled_center for 1000 days and suddenly it decides to rejoin it's original kingdom. It would be more realistic, to make newly conquered fiefs more likely to return to it's previous faction than "old "walled_centers. Maybe even add a building, which increases loyality over time.
 
Perhaps a party_slot_loyalty that increases over time, rebelling to the previous (not original) owner? It could take attached villages into account so that it decreases when they're raided or if a caravan is attacked.

Still, nice idea. I might add something like this and if i add anything, I'll post it here so you can add it to the OP if you want.
 
jacobhinds said:
Perhaps a party_slot_loyalty that increases over time, rebelling to the previous (not original) owner? It could take attached villages into account so that it decreases when they're raided or if a caravan is attacked.

Still, nice idea. I might add something like this and if i add anything, I'll post it here so you can add it to the OP if you want.

The slot_faction_loyalty is a good idea. I am considering porting this to a script, so it can be called based upon certain events. However, I prefer loyalty to the original faction (but feel free to change the OSP to your desires)
 
Back
Top Bottom