Changing troop composition of Deserter parties

Users who are viewing this thread

My mod, Bloody Ould Sixth, (which is doing well thank you), doesn't need "deserter" parties as such. Instead I want that party type to be composed of a few other troops that I define.

e.g., instead of "Deserters," the party spawns are called "Unsavory Individuals," and instead of being full of runaway troops from the regular factions, I want them to be full of specific troops in either mixed or pure company.

How do I make it happen? I've been toying with the old Troop Editor and it seems to fit my purpose. I see there are specific troop types for deserters for each faction, but these don't seem to actually be used in deserter parties (I changed their names but the newly renamed troops don't show in deserter parties on the map). Specifying troops to belong to the deserter faction also does nothing. Random pure companies of regular faction troops are still the only thing that show up in deserter parties. Crud.
 
(try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_deserters"),
      (lt,":num_parties",15),
      (set_spawn_radius, 4),
      (try_for_range, ":troop_no", active_npcs_begin, active_npcs_end),
    (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (store_random_in_range, ":random_no", 0, 100),
        (lt, ":random_no", 5),
        (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
        (store_troop_faction, ":troop_faction", ":troop_no"),
        (neq, ":troop_faction","fac_player_supporters_faction"),
        (gt, ":party_no", 0),
        (neg|party_is_in_any_town, ":party_no"),
##        (party_get_attached_to, ":attached_party_no", ":party_no"),
##        (lt, ":attached_party_no", 0),#in wilderness
        (spawn_around_party, ":party_no", "pt_deserters"),
        (assign, ":new_party", reg0),
        (store_troop_faction, ":faction_no", ":troop_no"),
        (faction_get_slot, ":tier_1_troop", ":faction_no", slot_faction_tier_1_troop),
        (store_character_level, ":level", "trp_player"),
        (store_mul, ":max_number_to_add", ":level", 2),
        (val_add, ":max_number_to_add", 11),
        (store_random_in_range, ":number_to_add", 10, ":max_number_to_add"),
        (party_add_members, ":new_party", ":tier_1_troop", ":number_to_add"),
        (store_random_in_range, ":random_no", 1, 4),
        (try_for_range, ":unused", 0, ":random_no"),
          (party_upgrade_with_xp, ":new_party", 1000000, 0),
        (try_end),

Theres the script that spawns deserter parties, and as far as i can tell you would have to make a new troop type (with a troop tree if you want the deserter parties to not always use the same troop) and then edit the script to read something like this.

(try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_deserters"),
      (lt,":num_parties",15),
      (set_spawn_radius, 4),
      (try_for_range, ":troop_no", active_npcs_begin, active_npcs_end),
    (troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
        (store_random_in_range, ":random_no", 0, 100),
        (lt, ":random_no", 5),
        (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
        (store_troop_faction, ":troop_faction", ":troop_no"),
        (neq, ":troop_faction","fac_player_supporters_faction"),
        (gt, ":party_no", 0),
        (neg|party_is_in_any_town, ":party_no"),
##        (party_get_attached_to, ":attached_party_no", ":party_no"),
##        (lt, ":attached_party_no", 0),#in wilderness
        (spawn_around_party, ":party_no", "pt_deserters"),
        (assign, ":new_party", reg0),
##    (store_troop_faction, ":faction_no", ":troop_no"),
##    (faction_get_slot, ":tier_1_troop", ":faction_no", slot_faction_tier_1_troop),
        (store_character_level, ":level", "trp_player"),
        (store_mul, ":max_number_to_add", ":level", 2),
        (val_add, ":max_number_to_add", 11),
        (store_random_in_range, ":number_to_add", 10, ":max_number_to_add"),
        (party_add_members, ":new_party", "trp_farmer", ":number_to_add"),
        (store_random_in_range, ":random_no", 1, 4),
        (try_for_range, ":unused", 0, ":random_no"),
          (party_upgrade_with_xp, ":new_party", 1000000, 0),
        (try_end),

I have used farmers in this script but you could change that to any troop you want, also with this script they will spawn just like deserters do, i.e around lord parties in the wilderness; if you wanted them to just be another party on the map i would comment out the whole deserter script and add something like this below it

    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_unsavoury_individuals"),
      (lt,":num_parties",15),
      (store_random_in_range,":spawn_point",villages_begin,villages_end),       
      (set_spawn_radius, 25),
      (spawn_around_party, ":spawn_point", "pt_unsavoury_individuals"),
      (assign, ":new_party", reg0),
      (store_character_level, ":level", "trp_player"),
      (store_mul, ":max_number_to_add", ":level", 2),
      (val_add, ":max_number_to_add", 11),
      (store_random_in_range, ":number_to_add", 10, ":max_number_to_add"),
      (party_add_members, ":new_party", "trp_farmer", ":number_to_add"),
      (store_random_in_range, ":chance", 0 ,100),
      (try_begin),
        (lt, ":chance", 50),
        (val_div, ":number_to_add", 2),
        (party_add_members, ":new_party", "trp_peasant_woman", ":number_to_add"),
      (try_end),
      (try_begin),
        (lt, ":chance", 25),
        (val_div, ":number_to_add", 2),
        (party_add_members, ":new_party", "trp_looter", ":number_to_add"),
      (try_end),
    (try_end),

This will check if there are less than 15 unsavoury individual parties and then spawn more parties around random villages with each party having a 50% chance of containing just farmers, a 25% chance of containg farmers and peasant woman, and a 25% chance of containing farmers, peasant women and looters.

I'm just a beginner at scripting though so I'm sure someone more experienced could clean that script up or improve the troop allocation system.

You will need to have the module system and to have copied the deserter party template and renamed it 'unsavoury individuals' for this to work.

EDIT: I've briefly tested this and it seems to work alright for me
 
Back
Top Bottom