How to set the level limit when recruiting prisoners?

Users who are viewing this thread

In some mods like Prophesy of Pendor, prisoners over a certain level(level 40 in Prophesy of Pendor) cannot be recruited.

How to set this level limit in mods or native? Would be great if can be done only by editing the text files, but using a bit of module system is fine as well.

Thank you very much.
 
Do the changes in module_game_menus as follows

  ("camp_recruit_prisoners",0,
  "You offer your prisoners freedom if they agree to join you as soldiers. {s18}",
  "none",
  [(assign, ":num_regular_prisoner_slots", 0),
    (party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
    (try_for_range, ":cur_stack", 0, ":num_stacks"),
      (party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
      (neg|troop_is_hero, ":cur_troop_id"),
  (store_character_level, ":level", ":cur_troop_id"),
  (le, ":level", 20),

      (val_add, ":num_regular_prisoner_slots", 1),
    (try_end),
    (try_begin),
      (eq, ":num_regular_prisoner_slots", 0),
      (jump_to_menu, "mnu_camp_no_prisoners"),
    (else_try),
      (eq, "$g_prisoner_recruit_troop_id", 0),
      (store_current_hours, "$g_prisoner_recruit_last_time"),
      (store_random_in_range, ":rand", 0, 100),
      (store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"),
      (store_sub, ":reject_chance", 15, ":persuasion_level"),
      (val_mul, ":reject_chance", 4),
      (try_begin),
        (lt, ":rand", ":reject_chance"),
        (assign, "$g_prisoner_recruit_troop_id", -7),
      (else_try),
        (assign, ":num_regular_prisoner_slots", 0),
        (party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
        (try_for_range, ":cur_stack", 0, ":num_stacks"),
          (party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
          (neg|troop_is_hero, ":cur_troop_id"),  
      (store_character_level, ":level", ":cur_troop_id"),
      (le, ":level", 20),

          (val_add, ":num_regular_prisoner_slots", 1),
        (try_end),
        (store_random_in_range, ":random_prisoner_slot", 0, ":num_regular_prisoner_slots"),
        (try_for_range, ":cur_stack", 0, ":num_stacks"),
          (party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
          (neg|troop_is_hero, ":cur_troop_id"),  
  (store_character_level, ":level", ":cur_troop_id"),
  (le, ":level", 20),

          (val_sub, ":random_prisoner_slot", 1),
          (lt, ":random_prisoner_slot", 0),
          (assign, ":num_stacks", 0),
          (assign, "$g_prisoner_recruit_troop_id", ":cur_troop_id"),
          (party_prisoner_stack_get_size, "$g_prisoner_recruit_size", "p_main_party", ":cur_stack"),
        (try_end),
      (try_end),

      (try_begin),
        (gt, "$g_prisoner_recruit_troop_id", 0),
        (party_get_free_companions_capacity, ":capacity", "p_main_party"),
        (val_min, "$g_prisoner_recruit_size", ":capacity"),
        (assign, reg1, "$g_prisoner_recruit_size"),
        (gt, "$g_prisoner_recruit_size", 0),
        (try_begin),
          (gt, "$g_prisoner_recruit_size", 1),
          (assign, reg2, 1),
        (else_try),
          (assign, reg2, 0),
        (try_end),
        (str_store_troop_name_by_count, s1, "$g_prisoner_recruit_troop_id", "$g_prisoner_recruit_size"),
        (str_store_string, s18, "@{reg1} {s1} {reg2?accept:accepts} the offer."),
      (else_try),
        (str_store_string, s18, "@No one accepts the offer."),
      (try_end),
    (try_end),
    ],

change 20 in red to level you want.
 
Zerilius said:
Do the changes in module_game_menus as follows

  ("camp_recruit_prisoners",0,
  "You offer your prisoners freedom if they agree to join you as soldiers. {s18}",
  "none",
  [(assign, ":num_regular_prisoner_slots", 0),
    (party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
    (try_for_range, ":cur_stack", 0, ":num_stacks"),
      (party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
      (neg|troop_is_hero, ":cur_troop_id"),
  (store_character_level, ":level", ":cur_troop_id"),
  (le, ":level", 20),

      (val_add, ":num_regular_prisoner_slots", 1),
    (try_end),
    (try_begin),
      (eq, ":num_regular_prisoner_slots", 0),
      (jump_to_menu, "mnu_camp_no_prisoners"),
    (else_try),
      (eq, "$g_prisoner_recruit_troop_id", 0),
      (store_current_hours, "$g_prisoner_recruit_last_time"),
      (store_random_in_range, ":rand", 0, 100),
      (store_skill_level, ":persuasion_level", "skl_persuasion", "trp_player"),
      (store_sub, ":reject_chance", 15, ":persuasion_level"),
      (val_mul, ":reject_chance", 4),
      (try_begin),
        (lt, ":rand", ":reject_chance"),
        (assign, "$g_prisoner_recruit_troop_id", -7),
      (else_try),
        (assign, ":num_regular_prisoner_slots", 0),
        (party_get_num_prisoner_stacks, ":num_stacks", "p_main_party"),
        (try_for_range, ":cur_stack", 0, ":num_stacks"),
          (party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
          (neg|troop_is_hero, ":cur_troop_id"),  
      (store_character_level, ":level", ":cur_troop_id"),
      (le, ":level", 20),

          (val_add, ":num_regular_prisoner_slots", 1),
        (try_end),
        (store_random_in_range, ":random_prisoner_slot", 0, ":num_regular_prisoner_slots"),
        (try_for_range, ":cur_stack", 0, ":num_stacks"),
          (party_prisoner_stack_get_troop_id, ":cur_troop_id", "p_main_party", ":cur_stack"),
          (neg|troop_is_hero, ":cur_troop_id"),  
  (store_character_level, ":level", ":cur_troop_id"),
  (le, ":level", 20),

          (val_sub, ":random_prisoner_slot", 1),
          (lt, ":random_prisoner_slot", 0),
          (assign, ":num_stacks", 0),
          (assign, "$g_prisoner_recruit_troop_id", ":cur_troop_id"),
          (party_prisoner_stack_get_size, "$g_prisoner_recruit_size", "p_main_party", ":cur_stack"),
        (try_end),
      (try_end),

      (try_begin),
        (gt, "$g_prisoner_recruit_troop_id", 0),
        (party_get_free_companions_capacity, ":capacity", "p_main_party"),
        (val_min, "$g_prisoner_recruit_size", ":capacity"),
        (assign, reg1, "$g_prisoner_recruit_size"),
        (gt, "$g_prisoner_recruit_size", 0),
        (try_begin),
          (gt, "$g_prisoner_recruit_size", 1),
          (assign, reg2, 1),
        (else_try),
          (assign, reg2, 0),
        (try_end),
        (str_store_troop_name_by_count, s1, "$g_prisoner_recruit_troop_id", "$g_prisoner_recruit_size"),
        (str_store_string, s18, "@{reg1} {s1} {reg2?accept:accepts} the offer."),
      (else_try),
        (str_store_string, s18, "@No one accepts the offer."),
      (try_end),
    (try_end),
    ],

change 20 in red to level you want.

Thank you. I'll try it out as soon as I'm back home.

There's another question I want to ask. Is it possible to add the lords' personalities in their character page?
 
You need to use the module system for all these changes.
To answer your first question, modify the following
Code:
      (str_store_troop_name, s54, ":troop_no"),
      (try_begin),
        (eq, ":troop_no", "trp_player"),
        (this_or_next|eq, "$player_has_homage", 1),
        (eq, "$players_kingdom", "fac_player_supporters_faction"),
        (assign, ":troop_faction", "$players_kingdom"),
      (else_try), #modify this
        (store_troop_faction, ":troop_faction", ":troop_no"),
	(is_between, ":troop_no", lords_begin, lords_end),
        (troop_get_slot, ":reputation", ":troop_no", slot_lord_reputation_type),
        (val_add, ":reputation", "str_personality_archetypes"),
        (str_store_string, s49, ":reputation"),
        (str_store_string, s54, "@{s54} the {s49}"),
      (try_end),
      (str_clear, s49),
If you really need to modify it for PoP or something, look for "2171 2 x y" (opcode for store_character_level with 2 parameters, destination and character), which should be followed by a comparison operation in the form "z 2 x c", where z is an opcode (see header_operations), x is the destination for store_character_level, and c is a constant against which it is compared (the order of the two may switch).
 
Look for 2147483678 2 1224979098644774918 41 under menu_camp_recruit_prisoners in menus.txt and change the 41 to increase the recruit limit. In order to actually rescue/take prisoner troops of that level, go to scripts.txt and change 2147483678 2 1224979098644774917 41 under party_add_party_prisoners.
 
Somebody said:
Look for 2147483678 2 1224979098644774918 41 under menu_camp_recruit_prisoners in menus.txt and change the 41 to increase the recruit limit. In order to actually rescue/take prisoner troops of that level, go to scripts.txt and change 2147483678 2 1224979098644774917 41 under party_add_party_prisoners.

THANK YOU VERY MUCH.
It's working like a charm, it is awesome. :grin:
 
is there a way to enable the recruiting of noldor prisoner too? in prophesy of pendor, I mean... they disabled a specific unit from recruitement.
 
Crax i know i am maybe(sure) late but i want to let others know too. Yes there is a way to recruit them and you can use this editor http://forums.taleworlds.com/index.php/topic,117997.msg2848840.html#msg2848840 it is easy to use and has a good tutorial, i know this cause i suc*k at all modding. Cheers
 
Back
Top Bottom