Looter/Bandit troop tree and some miscellaneous questions.

Users who are viewing this thread

Daethikus

Squire
So, I have been wanting to make native where the looters have a troop tree. So far I have looter>thief>cutthroat>murderer>brigand, I increased the party limit and max party limit of looters, but have not seen any of the new troops. So I would like to know how to do that.

Thats the main thing. I don't know if its possible, but I want to hire looters/bandits from the tavern (like mercs). Also, I would like a way to not be always hostile to looters/bandits.

Thanks in advance if anyone knows how to do this.


Edit: New question, how do you make firearms (muskets ect) show up in shops?

Is it possible to add a new outlaw faction party? Say, mercenaries that roam around pillaging like bandits? Just a yes or no question.  :grin:

How do you make certain villages give different troops? Like, have one of the Rhodok villages give a different type of recruit, instead of rhodok tribesman.
 
Try looking in the Unofficial Tutorials section first, there were a few (dozens) threads with appropriate titles.

And please use the stickied Q&A thread for questions, unless you are reasonably sure you are raising an issue that deserves an entire thread.
 
Certainly possible.

What I did was change the in game name, stats, and upgrade tree of mercenaries but keep the module system identifier.

So you could change the name of Mercenary Cavalry to Murderer and change his stats.

I don't know how to add mercenaries, maybe just make new troops before mercenaries_end.
But I know that it is possible to add new mercenaries.

To make them show up in parties just put them in the party template.

Hope this helps. Look in unofficial tutorials for more. :grin:


 
cwr said:
Certainly possible.

What I did was change the in game name, stats, and upgrade tree of mercenaries but keep the module system identifier.

So you could change the name of Mercenary Cavalry to Murderer and change his stats.

I don't know how to add mercenaries, maybe just make new troops before mercenaries_end.
But I know that it is possible to add new mercenaries.

To make them show up in parties just put them in the party template.

Hope this helps. Look in unofficial tutorials for more. :grin:

Thanks cwr! Appreciate it!
 
Although the replacing mercenaries idea works, I personally think it's not the greatest solution. To get an idea of what you need to do, I'd search in the module_scripts.py for...
Code:
(call_script, "script_update_mercenary_units_of_towns")
It shows the various possible encounters within a tavern. Then if you continue to...
Code:
("update_mercenary_units_of_towns"
This portion seems to deal with the random amount of mercs you'd be able to hire and the unit range. After in module_dialogs.py you'll find...
Code:
#Tavern Talk (with troops)
which deals with the basic dialog for hiring them. With that information together, I'm sure you could probably recreate the same scripting to allow bandit units appear in the taverns for hire. I myself will probably end up looking into this in the near future, and if I have some good results, I'll post them to help others.

Edit: I decided to jump into this idea as it would serve useful along with what I'm doing atm. I've managed to make various bandit units appear in taverns without having to alter the mercenaries at all, but for some reason the mercenaries aren't showing up anymore since adding the bandits. The issue seems to lay in module_constants.py

In order for the troops to appear in the taverns I need to add the following which uses the exact same numbers as the mercenary slots, changing the number to anything else prevents them from appearing, so whichever unit is listed first using the numbers seems to appear.

Code:
slot_center_bandit_troop_type = 90
slot_center_bandit_troop_amount = 91
slot_center_mercenary_troop_type = 90
slot_center_mercenary_troop_amount = 91

I'll continue to try and figure it out, but if anyone has an easy resolution in mind, go ahead and help me out, lol. Otherwise I'll post my full script changes for all tomorrow, in case anyone wishes to use it and play with it.
 
Why dont you simple move looters between mercenary cavalry and mercenaries end tuples?

  ["mercenary_cavalry","Mercenary Cavalry","Mercenary Cavalry",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners,
  [itm_heavy_lance,itm_bastard_sword_a,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_cuir_bouilli,itm_banded_armor,itm_hide_boots,itm_kettle_hat,itm_mail_coif,itm_flat_topped_helmet,itm_helmet_with_neckguard,itm_warhorse,itm_hunter],
  def_attrib|level(25),wp(130),knows_common|knows_riding_5|knows_ironflesh_4|knows_shield_5|knows_power_strike_4,mercenary_face_1, mercenary_face_2],
############################################
  ["looter","Looter","Looters",0,0,0,fac_outlaws,
  [itm_hatchet,itm_club,itm_butchering_knife,itm_falchion,itm_rawhide_coat,itm_stones,itm_nomad_armor,itm_nomad_armor,itm_woolen_cap,itm_woolen_cap,itm_nomad_boots,itm_wrapping_boots],
  def_attrib|level(4),wp(20),knows_common,bandit_face1, bandit_face2],

#############################################
  ["mercenaries_end","mercenaries_end","mercenaries_end",0,no_scene,reserved,fac_commoners,
  [],
  def_attrib|level(4),wp(60),knows_common,mercenary_face_1, mercenary_face_2],
Everything troop that you put before "mercenaries end" will appear in taverns as mercenary units.
 
Adding the units into the mercenary range would work without an issue, but then you'd never encounter both mercs and bandits at the same time in a town, which I'm trying to allow, as I'll also be adding manhunters, slavers and possibly more into taverns as well after, so with such a large scope of units in the range, running into what you need will be difficult.

Finally complete.

In module_constants above
Code:
slot_center_npc_volunteer_troop_type   = 90

I added
Code:
slot_center_bandit_troop_type  = 92
slot_center_bandit_troop_amount= 93
Just make sure the slot is different from that of others in the tavern to avoid conflict.

And below
Code:
mercenary_troops_begin = "trp_watchman"
mercenary_troops_end = "trp_mercenaries_end"

I added
Code:
bandit_troops_begin = "trp_looter"
bandit_troops_end = "trp_black_khergit_horseman"
This gives a beginning and end for units to be referenced for spawning in the tavern. Feel free to change to your liking.

Then in module_simple_triggers, below
Code:
(call_script, "script_update_mercenary_units_of_towns"),

In the # Adding mercenary troops to the towns section I added
Code:
(call_script, "script_update_bandit_units_of_towns"),

Then moving into module_scripts below
Code:
(call_script, "script_update_mercenary_units_of_towns"),

I added
Code:
(call_script, "script_update_bandit_units_of_towns"),

then below
Code:
  #script_update_mercenary_units_of_towns
  # INPUT: none
  # OUTPUT: none
  ("update_mercenary_units_of_towns",
    [(try_for_range, ":town_no", towns_begin, towns_end),
      (store_random_in_range, ":troop_no", mercenary_troops_begin, mercenary_troops_end),
      (party_set_slot, ":town_no", slot_center_mercenary_troop_type, ":troop_no"),
      (store_random_in_range, ":amount", 3, 8),
      (party_set_slot, ":town_no", slot_center_mercenary_troop_amount, ":amount"),
    (try_end),
     ]),

I added
Code:
  ("update_bandit_units_of_towns",
    [(try_for_range, ":town_no", towns_begin, towns_end),
      (store_random_in_range, ":troop_no", bandit_troops_begin, bandit_troops_end),
      (party_set_slot, ":town_no", slot_center_bandit_troop_type, ":troop_no"),
      (store_random_in_range, ":amount", 3, 8),
      (party_set_slot, ":town_no", slot_center_bandit_troop_amount, ":amount"),
    (try_end),
     ]),

In module_game_menus
Code:
             (party_get_slot, ":mercenary_troop", "$current_town", slot_center_mercenary_troop_type),
             (party_get_slot, ":mercenary_amount", "$current_town", slot_center_mercenary_troop_amount),
             (try_begin),
	       (gt, ":mercenary_troop", 0),
               (gt, ":mercenary_amount", 0),
               (set_visitor, ":cur_entry", ":mercenary_troop"),
               (val_add, ":cur_entry", 1),
             (try_end),

Below I put
Code:
             (party_get_slot, ":bandit_troop", "$current_town", slot_center_bandit_troop_type),
             (party_get_slot, ":bandit_amount", "$current_town", slot_center_bandit_troop_amount),
             (try_begin),
			   (gt, ":bandit_troop", 0),
               (gt, ":bandit_amount", 0),
               (set_visitor, ":cur_entry", ":bandit_troop"),
               (val_add, ":cur_entry", 1),
             (try_end),

and in module_dialog I replace
Code:
(neg|is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
with
Code:
(is_between, "$g_talk_troop", "trp_watchman", "trp_mercenaries_end"),
This way it will only associate this script to units in between those listed within the troops.

Find this section of the mercenary dialog and add the red segment. 
  [anyone, "start", [
  (eq, "$talk_context", tc_tavern_talk),
  (is_between, "$g_talk_troop", "trp_watchman", "trp_mercenaries_end"),
  ],
  "Any orders, {sir/madam}?", "mercenary_after_recruited", []],

  [anyone|plyr, "mercenary_after_recruited", [],
  "Make your preparations. We'll be moving at dawn.", "mercenary_after_recruited_2", []],
  [anyone|plyr, "mercenary_after_recruited", [],
  "Take your time. We'll be staying in this town for a while.", "mercenary_after_recruited_2", []],
Because it's an anyone start, it will run for any reference placed after this right away, preventing anything you add from working correctly. Adding the is between prevents that.

Then below the entire mercenary dialog... I added a copy of the merc dialog for the bandits.
Code:
[anyone, "start", [
                     (eq, "$talk_context", tc_tavern_talk),
					 (neg|troop_is_hero, "$g_talk_troop"),
                     (is_between, "$g_talk_troop", "trp_looter", "trp_black_khergit_horseman"),
                     (party_get_slot, ":bandit_troop", "$g_encountered_party", slot_center_bandit_troop_type),
                     (party_get_slot, ":bandit_amount", "$g_encountered_party", slot_center_bandit_troop_amount),
                     (gt, ":bandit_amount", 0),
                     (store_sub, reg3, ":bandit_amount", 1),
                     (store_sub, reg4, reg3, 1),
                     (call_script, "script_game_get_join_cost", ":bandit_troop"),
                     (assign, ":join_cost", reg0),
                     (store_mul, reg5, ":bandit_amount", reg0),
                     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
                     (val_min, ":bandit_amount", ":free_capacity"),
                     (store_troop_gold, ":cur_gold", "trp_player"),
                     (try_begin),
                       (gt, ":join_cost", 0),
                       (val_div, ":cur_gold", ":join_cost"),
                       (val_min, ":bandit_amount", ":cur_gold"),
                     (try_end),
                     (assign, "$temp", ":bandit_amount"),
                     ],
   "Do you have a need for mercenaries, {sir/madam}?\
 {reg3?Me and {reg4?{reg3} of my mates:one of my mates} are:I am} looking for a master.\
 We'll join you for {reg5} denars.", "bandit_tavern_talk", []],

  [anyone, "start", [
  (eq, "$talk_context", tc_tavern_talk),
  (is_between, "$g_talk_troop", "trp_looter", "trp_black_khergit_horseman"),
  ],
   "Any orders, {sir/madam}?", "bandit_after_recruited", []],

  [anyone|plyr, "bandit_after_recruited", [],
   "Make your preparations. We'll be moving at dawn.", "bandit_after_recruited_2", []],
  [anyone|plyr, "bandit_after_recruited", [],
   "Take your time. We'll be staying in this town for a while.", "bandit_after_recruited_2", []],

  [anyone, "bandit_after_recruited_2", [], "Yes {sir/madam}. We'll be ready when you tell us to leave.", "close_window", []],

  [anyone|plyr, "bandit_tavern_talk", [(party_get_slot, ":bandit_amount", "$g_encountered_party", slot_center_bandit_troop_amount),
                                          (eq, ":bandit_amount", "$temp"),
                                          (party_get_slot, ":bandit_troop", "$g_encountered_party", slot_center_bandit_troop_type),
                                          (call_script, "script_game_get_join_cost", ":bandit_troop"),
                                          (store_mul, reg5, "$temp", reg0),                                          
                                          ],
   "All right. I will hire all of you. Here is {reg5} denars.", "bandit_tavern_talk_hire", []],

  [anyone|plyr, "bandit_tavern_talk", [(party_get_slot, ":bandit_amount", "$g_encountered_party", slot_center_bandit_troop_amount),
                                          (lt, "$temp", ":bandit_amount"),
                                          (gt, "$temp", 0),
                                          (assign, reg6, "$temp"),
                                          (party_get_slot, ":bandit_troop", "$g_encountered_party", slot_center_bandit_troop_type),
                                          (call_script, "script_game_get_join_cost", ":bandit_troop"),
                                          (store_mul, reg5, "$temp", reg0),
                                          ],
   "All right. But I can only hire {reg6} of you. Here is {reg5} denars.", "bandit_tavern_talk_hire", []],


  [anyone, "bandit_tavern_talk_hire", [(store_random_in_range, ":rand", 0, 4),
                                          (try_begin),
                                            (eq, ":rand", 0),
                                            (gt, "$temp", 1),
                                            (str_store_string, s17,
                                             "@You chose well, {sir/madam}. My lads know how to keep their word and earn their pay."),
                                          (else_try),
                                            (eq, ":rand", 1), 
                                            (str_store_string, s17,
                                             "@Well done, {sir/madam}. Keep the money and wine coming our way, and there's no foe in Calradia you need fear."),
                                          (else_try),
                                            (eq, ":rand", 2), 
                                            (str_store_string, s17,
                                             "@We are at your service, {sir/madam}. Point us in the direction of those who need hurting, and we'll do the rest."),
                                          (else_try),
                                            (str_store_string, s17,
                                             "str_you_will_not_be_disappointed_sirmadam_you_will_not_find_better_warriors_in_all_calradia"),
                                          (try_end),],
   "{s17}", "close_window", [
                                          (party_get_slot, ":bandit_troop", "$g_encountered_party", slot_center_bandit_troop_type),
                                          (call_script, "script_game_get_join_cost", ":bandit_troop"),
                                          (store_mul, ":total_cost", "$temp", reg0),
                                          (troop_remove_gold, "trp_player", ":total_cost"),
                                          (party_add_members, "p_main_party", ":bandit_troop", "$temp"),
                                          (party_set_slot, "$g_encountered_party", slot_center_bandit_troop_amount, 0),
                                          ]],

  [anyone|plyr, "bandit_tavern_talk", [(eq, "$temp", 0),
                                          (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
                                          (ge, ":free_capacity", 1)],
   "That sounds good. But I can't afford to hire any more men right now.", "tavern_bandit_cant_lead", []],
  
  [anyone, "tavern_bandit_cant_lead", [], "That's a pity. Well, {reg3?we will:I will} be lingering around here for a while,\
 if you need to hire anyone.", "close_window", []],
  
  [anyone|plyr, "bandit_tavern_talk", [(eq, "$temp", 0),
                                          (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
                                          (eq, ":free_capacity", 0)],
   "That sounds good. But I can't lead any more men right now.", "tavern_bandit_cant_lead", []],


  [anyone|plyr, "bandit_tavern_talk", [],
   "Sorry. I don't need any other men right now.", "close_window", []],

Most recent Edit:
Finally it's all fixed. Works perfect for me, if anyone has an issue with this, let me know in case I made some sort of typo. As for the dialog, you'll have to write you own custom one using the check functions like above to prevent conflicts. I'm too lazy to personalize mine right now.

Now with that you should be able to create even more npcs to add into the tavern, if you want recruitable units, new npcs for quests, whatever, just reference the material, and stuff relating to say farmers in taverns and so on to accomplish new tasks.
 
Sorry for double post, been editing the one above, just bumping now to inform any who may have been checking that I got it working 100%. Mercenaries and Bandits will now both appear in the tavern without any conflict from one another.  Enjoy.
 
Yes! I may or may not use that, but it is a good script none the less! :grin: So I just learned how to do that, so thank you. :grin:
 
Daethikus said:
New question, how do you make firearms (muskets ect) show up in shops?

Sorry I didn't notice the new questions on this thread earlier- anyway, add the flag itp_merchandise.
 
Daethikus said:
Is it possible to add a new outlaw faction party? Say, mercenaries that roam around pillaging like bandits? Just a yes or no question.  :grin:

How do you make certain villages give different troops? Like, have one of the Rhodok villages give a different type of recruit, instead of rhodok tribesman.

You can make a new party just make a new party template, spawn point, etc. http://forums.taleworlds.com/index.php/topic,53192.0.html there's a tutorial.

I know it's outdated, but I've used it for warband and it worked fine for me.

if you want them to attack villages, then it's way more complicated, so tell me how to do it when you figure it out. :wink:



This is a tutorial so you can recruit different units from towns as opposed to villages: http://forums.taleworlds.com/index.php/topic,202029.0.html that tutorial is up to date (I think)

I know you want it to be a different village, not castles and towns, but that's the best I could find, and my coding skills aren't good enough to figure that out.




hope this helps.
 
Back
Top Bottom