Mount&Blade Expansion > Mod Graveyard

Recruit from your Prisoners! - Obsolete with new version of M&B

(1/10) > >>

Leprechaun:
I've put a mod that allows you to recruit from your prisoners on the File Repository. Their faction's standing with you ought to affect whether they will follow you or not, but this is relatively untested. Please report any problems. (Apologies if this mod has been released already, but I searched and couldn't find it.)

Updated 29th December 2006. I've re-ported it using python so you'll no longer need to start a new game to use it.

New version is up. v2.0 is for v0.808 of Mount&Blade.

Link: http://www.mbrepository.com/modules/PDdownloads/singlefile.php?cid=10&lid=153

Python source is up. See the next post for details on adding it to your own mod. Remember that I ask to be credited for the work if you use it in your own.
http://www.mbrepository.com/modules/PDdownloads/singlefile.php?cid=4&lid=321


Features

    * Recruit from your prisoners
    * Fixed conversation


With the latest version, if the prisoner refuses to join you, you cannot try again, you must sell him or kill him.

New version:
I've reworked the code to better calculate how likely the prisoner is to join your faction.


Reminder to self - update again with fixed code when you get a spare moment.

Leprechaun:
In module_constants:
Beneath "slot_town_import_rate_2" = 48 add "slot_prisoner_agreed = 1"

In module_dialogues:
Where it says
"[anyone|plyr,"prisoner_chat", [], "Don't try running away or trying something stupid. I will be watching you.", "prisoner_chat_2",[]],
  [anyone,"prisoner_chat_2", [], "No, I swear I won't.", "close_window",[]],"
or whatever, delete the entire lot and paste in:


--- Code: ---  [anyone|plyr,"prisoner_chat", [[store_conversation_troop,reg(2)],[store_troop_faction,reg(3),reg(2)],[store_relation,reg(4),reg(3),"fac_player_faction"]], "Don't try running away or trying something stupid. I will be watching you.", "prisoner_chat_2",
   [[store_random_in_range,reg(5),reg(4),3]]],
  [anyone,"prisoner_chat_2", [], "No, I swear I won't.", "prisoner_chat_3",[]],
  [anyone|plyr,"prisoner_chat_3", [], "Good. You're not stupid like the rest of these scum.", "prisoner_chat_4",[]],
  [anyone|plyr,"prisoner_chat_4", [], "[End the conversation]", "prisoner_chat_5",[]],
  [anyone|plyr,"prisoner_chat_5", [], "I hope you're looking forward to life as a slave, scum.", "close_window",[]],
  [anyone|plyr,"prisoner_chat_4", [], "[Try to recruit the prisoner]", "prisoner_chat_6",[]],
  [anyone|plyr,"prisoner_chat_6", [], "Listen, scum, you have one last chance to redeem yourself before I sell you to the slave-traders.\
  Drop all your previous allegiances and swear to fight for me and obey my every order to the letter, and you'll be paid, fed and equipped.\
   If you don't....well, let's just say that life as a slave will be seemingly unending years of agony, malnutrition and beatings.\
   I'd advise you to think very, very carefully before refusing.", "prisoner_chat_7",[]],
  [anyone,"prisoner_chat_7", [[lt,reg(5),0]], "I'll show you what I think of your offer! (The prisoner spits at your feet) There. Now get lost, I'm not interested.", "prisoner_chat_8",[]],
  [anyone|plyr,"prisoner_chat_8", [], "[Kill the prisoner]", "prisoner_chat_14",[]],
  [anyone|plyr,"prisoner_chat_8", [], "[Sell the prisoner]", "prisoner_chat_10",[]],
  [anyone|plyr,"prisoner_chat_9", [], "(You advance on the prisoner with your weapon drawn)", "prisoner_chat_11",[]],
  [anyone|plyr,"prisoner_chat_4", [], "[Kill the prisoner]", "prisoner_chat_9",[]],
  [anyone|plyr,"prisoner_chat_10", [], "We have found a roaming slave trader. It's time for us to part ways. Goodbye, it was nice not to know you.", "close_window",
   [[store_conversation_troop,reg(2)],[remove_troops_from_prisoners,reg(2),1],[troop_add_gold,"trp_player",20]]],
  [anyone,"prisoner_chat_11", [], "Please, {sir/madam}, don't kill me. I am a defenceless prisoner. Surely you're not that cruel?", "prisoner_chat_12",[]],
  [anyone|plyr,"prisoner_chat_12", [], "[Kill the prisoner]", "prisoner_chat_13",[]],
  [anyone|plyr,"prisoner_chat_13", [], "Yes, idiot. I am that cruel. Prepare to die.", "prisoner_chat_14",[]],
  [anyone|plyr,"prisoner_chat_14", [], "(The prisoner struggles against his shackles, desperate to free himself and escape you, but to no avail. You slit his throat with a knife and watch, satisfied, as his corpse sags to the floor.)", "close_window",
   [[store_conversation_troop,reg(2)],[remove_troops_from_prisoners,reg(2),1]]],
  [anyone|plyr,"prisoner_chat_12", [], "[Let him live]", "prisoner_chat_15",[]],
  [anyone|plyr,"prisoner_chat_15", [], "Very well, I'll let you live. I hope you enjoy life as a slave.", "prisoner_chat_16",[]],
  [anyone,"prisoner_chat_16", [], "Oh, thank you, {sir/madam}.", "close_window",[]],
  [anyone,"prisoner_chat_7", [[ge,reg(5),0]], "Thank you for your mercy, {sir/madam}. I promise to drop all allegiances to serve you in any way I can.","prisoner_chat_17",[]],
  [anyone|plyr,"prisoner_chat_17", [], "Good. Now, I'll make the rules clear to you. There will be no discrimination against other soldiers in my army because they were once on the opposing side or were bandits. They fight for me now, as do you. Their ties with the past are broken. Think you can handle it?", "prisoner_chat_18",[]],
  [anyone,"prisoner_chat_18", [], "Yes, {sir/madam}. I will obey the rules.", "prisoner_chat_19",[]],
  [anyone|plyr, "prisoner_chat_19", [[neg|hero_can_join]],"Oh. There isn't enough room in my party for you. I will be back when I have made room.", "close_window",
   [[store_conversation_troop,reg(0)],[troop_set_slot,reg(0),slot_prisoner_agreed,1]]],
  [anyone|plyr, "prisoner_chat_19", [[hero_can_join]], "Excellent. From now on, you fight alongside these men. Help them when they need it, and they'll do the same for you. Get equipped and fed. We'll head out as soon as you're done.", "close_window",
   [[store_conversation_troop,reg(0)],[troop_join,reg(0)],[remove_troops_from_prisoners,reg(0),1]]],
  [anyone|plyr,"prisoner_chat", [[store_conversation_troop,reg(0)],[troop_get_slot,reg(1),reg(0),slot_prisoner_agreed],[eq,reg(1),1],[hero_can_join]], "All right, I have made room for you to join my party. Welcome aboard.", "close_window",
   [[store_conversation_troop,reg(0)],[troop_join,reg(0)],[remove_troops_from_prisoners,reg(0),1]]],
  [anyone|plyr,"prisoner_chat", [[store_conversation_troop,reg(0)],[troop_get_slot,reg(1),reg(0),slot_prisoner_agreed],[neg|reg(1),1],[hero_can_join]], "I am sorry, I still have no room for you. You'll have to wait a while longer, I'm afraid.", "close_window",[]],

--- End code ---

Jakethief:
Wow, that's actually really awesome. If I ever make a mod I will definitely have this in it.

Leprechaun:
However, I'd advise you to be careful - some part of my code is causing an error, and I haven't ascertained the cause yet. I'm fairly sure it's not this, but I'm not ruling it out. If you get an error when incorporating this code, please give me feedback.


I thought I'd post how it calculates the joining probability while I'm at it.

First it finds the prisoner's faction:
[store_conversation_troop,reg(2)],[store_troop_faction,reg(3),reg(2)]

Then it finds his relation to you:
[store_relation,reg(4),reg(3),"fac_player_faction"]

When you first join a faction your relations improve to three, so I class that as the maximum value to begin with. It then generates a random number between the best likely relations and their actual relations:
[store_random_in_range,reg(5),reg(4),3]

If this number is over or equal to 0, the prisoner will join:
[ge,reg(5),0]
If it's under, he won't:
[lt,reg(5),0]

Obviously, the lower his relations to you, the wider the range for the number to be selected from, so the less chance it has to be above 0, so the less chance he'll join you.

Hellequin:
Um... I'm not sure what (store_random_in_range) would do with an inverted range (store_random_in_range, ":Val", 10, 3), but it's possible that checking overfriendly troops with that script could be the source of your problems.  Try (val_min)ing it down to three before you check?

Navigation

[0] Message Index

[#] Next page

Go to full version