Getting your AI lords to recruit your custom troops.

Users who are viewing this thread

(store_sub, ":eek:ffset", ":faction_no", "fac_kingdom_1"),

Both of those lines did not take "fac_player_supporters_faction" into account. The offset is off by one (the reason you got "kingdoms_end" in one of the error).

The code should be:
(store_sub, ":eek:ffset", ":faction_no", "fac_player_supporters_faction"),

I don't know if the adjective setting is really necessary. I didn't use it and it looks just fine on all of the report. Besides, you can't change the preset string if you decide to change you kingdom name at some point.

The codes in the second spoiler in your first post are the ones you need to set up for your new faction.
 
If you don't mind, I'd really like the full python code for your tweak to only make a faction only recruit troops of their own faction regardless of the center's original faction. I worked on a workaround for that a few weeks ago and eventually gave up.
 
Here is the full script. I post above just the line that I removed from the script. This modification assume that you have set new culture for player faction (fac_player_supporters_faction <-> culture_7 or whatever the number).

I made some note explaining what I did in the script.
    ("cf_reinforce_party",
    [
      (store_script_param_1, ":party_no"),
     
      (store_faction_of_party, ":party_faction", ":party_no"), # Spd note: this line gets faction of the party being reinforced
      (party_get_slot, ":party_type",":party_no", slot_party_type),

# Spd note: the below section of code basically just get the leader of the party, then get his original faction
# Use the faction get from above which is the one he belongs to now.
#Rebellion changes begin:
#      (try_begin),
#        (eq, ":party_type", spt_kingdom_hero_party),
#        (party_stack_get_troop_id, ":leader", ":party_no"),
#        (troop_get_slot, ":party_faction",  ":leader", slot_troop_original_faction),
#            (this_or_next|is_between, ":party_faction", rebel_factions_begin, rebel_factions_end),
#            (faction_get_slot, ":target_faction", ":party_faction", slot_faction_rebellion_target),
#            (assign, ":party_faction", ":target_faction"),
#            (assign, ":party_faction", "fac_kingdom_1"),
#      (try_end),
#Rebellion changes end

#      (try_begin),
#        (eq, ":party_faction", "fac_player_supporters_faction"),
#        (party_get_slot, ":town_lord", ":party_no", slot_town_lord),
#        (try_begin),
#          (gt, ":town_lord", 0),
#          (troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction),
#        (else_try),
#          (party_get_slot, ":party_faction", ":party_no", slot_center_original_faction),
#        (try_end),
#      (try_end),
     
      (faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a),
      (faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b),
      (faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c),

      (assign, ":party_template", 0),
      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (this_or_next|eq, ":party_type", spt_town),
        (eq, ":party_type", spt_castle),  #CASTLE OR TOWN
        (try_begin),
          (lt, ":rand", 65),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (assign, ":party_template", ":party_template_b"),
        (try_end),
      (else_try),
        (eq, ":party_type", spt_kingdom_hero_party),
        (try_begin),
          (lt, ":rand", 50),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (lt, ":rand", 75),
          (assign, ":party_template", ":party_template_b"),
        (else_try),
          (assign, ":party_template", ":party_template_c"),
        (try_end),
      (else_try),
      (try_end),

      (try_begin),
        (gt, ":party_template", 0),
        (party_add_template, ":party_no", ":party_template"),
      (try_end),
  ]),

If the above donot not work, then add another work around:
Change the below 3 lines
      (faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a),
      (faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b),
      (faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c),

Change to:
      (try_begin),
  (eq, ":party_faction", "fac_player_supporters_faction"),
  (assign, ":party_template_a", "pt_kingdom_7_reinforcements_a"), # If you define player faction template with this ID
  (assign, ":party_template_b", "pt_kingdom_7_reinforcements_b"),
  (assign, ":party_template_c", "pt_kingdom_7_reinforcements_c"),
      (else_try),
  (faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a),
  (faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b),
  (faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c),
  (try_end),
This work around was designed for savegame compatible. Also, in case of whatever reason the new culture setting for fac_player_supporters_faction did not work. For me, directly assigning like this works better if I only need to do it for one faction. However, for expandable and mod compatibility, you will need to make the setting correctly in "game_start".
 
So I'm not the only one who wants to be able to hire special player faction troops when I change my culture via the chancellor from diplomacy mod. My lords should also hire my new troops when I choose the culture player faction.
I had the idea to put the player_supporters_faction behind kingdom_6 in module_factions, so that it is recognised as another kingdom.
 
That's a bad friggin idea. You'd change a load of scripts which go from npc_kingdoms_begin to npc_kingdoms_end - the player's supporter faction is NOT an NPC kingdom by any means. What you want to do is make the dialog option in the cultural selection extend to the supporter faction instead.
Code:
[anyone|plyr|repeat_for_factions, "dplmc_minister_kingdom_culture_select",
   [
    (store_repeat_object, ":faction_no"),
    (is_between, ":faction_no", npc_kingdoms_begin, npc_kingdoms_end),
    (store_sub, ":offset", ":faction_no", "fac_kingdom_1"),
    (val_add, ":offset", "str_kingdom_1_adjective"),
    (str_store_string, s11, ":offset"),    
     ],
   "{s11}.", "minister_pretalk",
   [
    (store_repeat_object, "$g_player_culture"),
    (try_begin),
      (this_or_next|le, "$g_player_culture", 0),
      (neg|is_between, "$g_player_culture", npc_kingdoms_begin, npc_kingdoms_end),
      (str_store_string, s11, "@Kingdom culture: None"),
    (else_try),
      (store_sub, ":offset", "$g_player_culture", npc_kingdoms_begin),
      (val_add, ":offset", "str_kingdom_1_adjective"),
      (str_store_string, s11, ":offset"),   
      (str_store_string, s11, "@Kingdom culture: {s11}"),
      (faction_get_slot, ":culture", "$g_player_culture", slot_faction_culture),
      (faction_set_slot, "fac_player_supporter_faction", slot_faction_culture, ":culture"),
    (try_end),
    (display_message, "@{s11}"),
    (call_script, "script_initialize_faction_troop_types", "$g_player_culture"),
   ]],
I've actually changed the script so that it's done on a per-faction basis. The code above duplicates the selected faction's culture, assigns it to the player's supporter faction, and then initializes its troops (tier 1-5, guard troops, reinforcements, etc). You should be able to go to the volunteer script and remove the special condition for the player's faction there.
 
LtpLegend: Just wondering if you were successful? Been trying to achieve this myself for some time, but still no good solution, so I was following this thread with super interest. Did you use the edited script from Somebody?
 
Maybe what I have done will benefit you.

Atamawood said:
Well the reason you don't see it is because you have to create a menu that goes to that (sorry I didn't post that little bit!) Now since your using the Module system this shall be easier. I added this

("camp_action_change_troops",0,
  "Which faction?",
  "none",
  [],
    [
      ("Swadian",[],"Swadian.",
      [(faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_1_troop, "trp_swadian_recruit"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_2_troop, "trp_swadian_militia"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_3_troop, "trp_swadian_footman"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_4_troop, "trp_swadian_infantry"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_5_troop, "trp_swadian_knight"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_1_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_1_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_1_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("Vaegir",[],"Vaegir.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_vaegir_recruit"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_vaegir_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_vaegir_veteran"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_vaegir_infantry"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_vaegir_knight"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_2_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_2_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_2_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("Khergit",[],"Khergit.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_khergit_tribesman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_khergit_skirmisher"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_khergit_horseman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_khergit_horse_archer"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_khergit_veteran_horse_archer"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_3_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_3_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_3_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("Nord",[],"Nord.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_nord_recruit"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_nord_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_nord_trained_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_nord_warrior"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_nord_veteran"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_4_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_4_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_4_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("Rhodok",[],"Rhodok.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_rhodok_tribesman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_rhodok_spearman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_rhodok_trained_spearman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_rhodok_veteran_spearman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_rhodok_sergeant"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_5_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_5_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_5_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("Sarranid",[],"Sarranid.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_sarranid_recruit"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_sarranid_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_sarranid_archer"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_sarranid_horseman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_sarranid_mamluke"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_6_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_6_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_6_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("cancel",[],"Cancel.",
      [(jump_to_menu, "mnu_camp"),
        ]
      ),
      ]
  ),

To the bottom of game_menus along with this

("action_change_troops",[(eq, "$players_kingdom_name_set", 1),],"Change your kingdom's default troops.",
      [(jump_to_menu, "mnu_camp_action_change_troops"),
        ]
      ),

Which I acually added with the rest of the camp actions but you could add it anywhere.

Now assuming you have an unmodded version of the module system (which I'm sure you don't) you have to add these to module_scripts and I'm sure you can mess around with them a bit to get them to work with your modded stuff.

So under module_scripts go to the update_volunteer_troops_in_village and the update_npc_volunteer_troops_in_village scripts and replace:
(party_get_slot, ":center_culture", ":center_no", slot_center_culture),
with
(store_faction_of_party, ":center_culture", ":center_no"),

And the last little part I'll post again,

("cf_reinforce_party",
    [
      (store_script_param_1, ":party_no"),
     
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_get_slot, ":party_type",":party_no", slot_party_type),

#Rebellion changes begin:
      (try_begin),
        (eq, ":party_type", spt_kingdom_hero_party),
        (party_stack_get_troop_id, ":leader", ":party_no"),
        (troop_get_slot, ":party_faction",  ":leader", slot_troop_original_faction),
      (try_end),

#Rebellion changes end

    (try_begin),
        (eq, ":party_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":town_lord", ":party_no", slot_town_lord),
        (try_begin),
          (gt, ":town_lord", 0),
          (troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction),
        (else_try),
          (party_get_slot, ":party_faction", ":party_no", slot_center_original_faction),
        (try_end),
      (try_end),

Just cut out that stuff in the red and your done! yay

Now for everyone just tuning in,
What this does is forces factions to recruit their own troops, it also changes the culture of troops you recruit based on what faction owns it. (Example: Swadians capture a Nordic town, you then recruit Swadians from the once Nordic villages.)
Also the big menu part comes ONLY into play when you make your become a King for your own country. What it does is add a menu to the camp actions which allows for you to set the "culture" you AND your vassals recruit, whether you want Nord troops or Sarranids, or perhaps Rhodoks one day and Vaegirs the next.

For you creating your own troop trees and what not, I'm sure there is a way to make one of these,

("Sarranid",[],"Sarranid.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_sarranid_recruit"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_sarranid_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_sarranid_archer"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_sarranid_horseman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_sarranid_mamluke"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_6_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_6_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_6_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),

For the troops you created and then have both you and your vassals recruit these men from the villages YOU own.

Note: These menus DO NOT appear if YOU are currently not a King of your own country.

So follow those steps and thats what they do, sorry the steps I've posted was never quite clear in the past. I hope this sums it up and it really is a great little tweak imo.


New: These codes are the same thing as the stuff above but only how they appear in the .txt files with the numbers. So this will help you all that don't use the module system which I still recommend you getting into if your going to do any modding.

So first of all locate "cf_reinforce_party -1" in scripts.txt and replace the entire line with

34 21 1 1224979098644774912 2204 2 1224979098644774913 1224979098644774912 521 3 1224979098644774914 1224979098644774912 0 522 3 1224979098644774915 1224979098644774913 77 522 3 1224979098644774916 1224979098644774913 78 522 3 1224979098644774917 1224979098644774913 79 2133 2 1224979098644774918 0 2136 3 1224979098644774919 0 100 4 0 1073741855 2 1224979098644774914 3 31 2 1224979098644774914 2 4 0 2147483678 2 1224979098644774919 65 2133 2 1224979098644774918 1224979098644774915 5 0 2133 2 1224979098644774918 1224979098644774916 3 0 5 0 31 2 1224979098644774914 13 4 0 2147483678 2 1224979098644774919 50 2133 2 1224979098644774918 1224979098644774915 5 0 2147483678 2 1224979098644774919 75 2133 2 1224979098644774918 1224979098644774916 5 0 2133 2 1224979098644774918 1224979098644774917 3 0 5 0 3 0 4 0 32 2 1224979098644774918 0 1675 2 1224979098644774912 1224979098644774918 3 0

Then find "update_volunteer_troops_in_village -1" in scripts.txt and replace the entire line with

35 23 2 1224979098644774912 1 521 3 1224979098644774913 1224979098644774912 26 2204 2 1224979098644774914 1224979098644774912 522 3 1224979098644774915 1224979098644774914 41 2133 2 1224979098644774916 1 2123 3 1224979098644774917 1224979098644774913 10 6 3 1224979098644774918 0 1224979098644774917 2136 3 1224979098644774919 0 100 2147483678 2 1224979098644774919 10 2136 3 1224979098644774919 0 2 1561 3 1224979098644774920 1224979098644774915 1224979098644774919 4 0 2147483680 2 1224979098644774920 0 1561 3 1224979098644774920 1224979098644774915 0 3 0 32 2 1224979098644774920 0 2105 2 1224979098644774916 1 2133 2 1224979098644774915 1224979098644774920 3 0 2133 2 1224979098644774921 12 4 0 30 2 1224979098644774913 5 2133 2 1224979098644774921 1224979098644774913 2108 2 1224979098644774921 2 2105 2 1224979098644774921 10 5 0 2147483678 2 1224979098644774913 0 2133 2 1224979098644774921 0 3 0 2107 2 1224979098644774921 3 2120 3 1224979098644774922 2 1224979098644774916 2108 2 1224979098644774921 1224979098644774922 2136 3 1224979098644774923 0 1224979098644774921 501 3 1224979098644774912 92 1224979098644774915 501 3 1224979098644774912 93 1224979098644774923

Then right below that at "update_npc_volunteer_troops_in_village -1" replace the entire line with

23 23 2 1224979098644774912 1 2204 2 1224979098644774913 1224979098644774912 522 3 1224979098644774914 1224979098644774913 41 2133 2 1224979098644774915 1 6 3 1224979098644774916 0 5 2136 3 1224979098644774917 0 100 2147483678 2 1224979098644774917 10 2136 3 1224979098644774917 0 2 1561 3 1224979098644774918 1224979098644774914 1224979098644774917 4 0 2147483680 2 1224979098644774918 0 1561 3 1224979098644774918 1224979098644774914 0 3 0 32 2 1224979098644774918 0 2105 2 1224979098644774915 1 2133 2 1224979098644774914 1224979098644774918 3 0 2133 2 1224979098644774919 12 2120 3 1224979098644774920 2 1224979098644774915 2108 2 1224979098644774919 1224979098644774920 2136 3 1224979098644774921 0 1224979098644774919 501 3 1224979098644774912 90 1224979098644774914 501 3 1224979098644774912 91 1224979098644774921

Now exit scripts.txt and find menus.txt.

Here you need to add two things. You can add them at the bottom or perhaps with the other camp menu stuff or what ever you want to do.

Here is the camp_action, I added it with the other camp_actions

mno_action_change_troops  1 31 2 144115188075856605 1  Change_your_kingdom's_default_troops.  1 2060 1 864691128455135449  .

and the last part where it selects the faction

menu_camp_action_change_troops 0 Which_faction? none 0 7
mno_Swadian  0  Swadian.  9 502 3 432345564227567630 41 360287970189639715 502 3 432345564227567630 42 360287970189639716 502 3 432345564227567630 43 360287970189639717 502 3 432345564227567630 44 360287970189639718 502 3 432345564227567630 45 360287970189639724 502 3 432345564227567630 77 576460752303423524 502 3 432345564227567630 78 576460752303423525 502 3 432345564227567630 79 576460752303423526 2060 1 864691128455135255  .  mno_Vaegir  0  Vaegir.  9 502 3 432345564227567630 41 360287970189639729 502 3 432345564227567630 42 360287970189639730 502 3 432345564227567630 43 360287970189639734 502 3 432345564227567630 44 360287970189639735 502 3 432345564227567630 45 360287970189639738 502 3 432345564227567630 77 576460752303423527 502 3 432345564227567630 78 576460752303423528 502 3 432345564227567630 79 576460752303423529 2060 1 864691128455135255  .  mno_Khergit  0  Khergit.  9 502 3 432345564227567630 41 360287970189639743 502 3 432345564227567630 42 360287970189639744 502 3 432345564227567630 43 360287970189639745 502 3 432345564227567630 44 360287970189639746 502 3 432345564227567630 45 360287970189639747 502 3 432345564227567630 77 576460752303423530 502 3 432345564227567630 78 576460752303423531 502 3 432345564227567630 79 576460752303423532 2060 1 864691128455135255  .  mno_Nord  0  Nord.  9 502 3 432345564227567630 41 360287970189639753 502 3 432345564227567630 42 360287970189639754 502 3 432345564227567630 43 360287970189639755 502 3 432345564227567630 44 360287970189639756 502 3 432345564227567630 45 360287970189639757 502 3 432345564227567630 77 576460752303423533 502 3 432345564227567630 78 576460752303423534 502 3 432345564227567630 79 576460752303423535 2060 1 864691128455135255  .  mno_Rhodok  0  Rhodok.  9 502 3 432345564227567630 41 360287970189639766 502 3 432345564227567630 42 360287970189639767 502 3 432345564227567630 43 360287970189639768 502 3 432345564227567630 44 360287970189639769 502 3 432345564227567630 45 360287970189639770 502 3 432345564227567630 77 576460752303423536 502 3 432345564227567630 78 576460752303423537 502 3 432345564227567630 79 576460752303423538 2060 1 864691128455135255  .  mno_Sarranid  0  Sarranid.  9 502 3 432345564227567630 41 360287970189639779 502 3 432345564227567630 42 360287970189639780 502 3 432345564227567630 43 360287970189639785 502 3 432345564227567630 44 360287970189639787 502 3 432345564227567630 45 360287970189639788 502 3 432345564227567630 77 576460752303423539 502 3 432345564227567630 78 576460752303423540 502 3 432345564227567630 79 576460752303423541 2060 1 864691128455135255  .  mno_cancel  0  Cancel.  1 2060 1 864691128455135255  .
 
Yes, your work was super! Followed it in Toppers thread. Used it to enable custom troops so I could hire them. But when I enabled the menu for culture selection, and used it in-game my kingdom becomes hostile towards me. If I try to enter one of my towns i automatically get the 'talk to castle troop siege conversation - we can hold these walls until we die of old age'. So i figured I would have a go at .py editing. Unless my bug is because I've done something wrong and there's a silly thing i did that I shouldn't have. Have you experienced or heard of this?
 
No I've never seen that one before haha. So I take it you just did .txt editing with the numbers? I've never tried to use just those before however some have and said it worked fine. I know one time I did something and in the camp menu I could increase and decrease fog and something else haha.
 
it`s work for me, as SPD_Phoenix  write a code, but you don`t need define new kingdom_7 ,just culture_7
in module_factions.py
("culture_1",  "{!}culture_1", 0, 0.9, [], []),
  ("culture_2",  "{!}culture_2", 0, 0.9, [], []),
  ("culture_3",  "{!}culture_3", 0, 0.9, [], []),
  ("culture_4",  "{!}culture_4", 0, 0.9, [], []),
  ("culture_5",  "{!}culture_5", 0, 0.9, [], []),
  ("culture_6",  "{!}culture_6", 0, 0.9, [], []),
  ("culture_7",  "{!}culture_7", 0, 0.9, [], []),

in module_scripts.py
      (faction_set_slot, "fac_culture_6", slot_faction_tier_1_troop, "trp_sarranid_recruit"),
      (faction_set_slot, "fac_culture_6", slot_faction_tier_2_troop, "trp_sarranid_footman"),
      (faction_set_slot, "fac_culture_6", slot_faction_tier_3_troop, "trp_sarranid_archer"),
      (faction_set_slot, "fac_culture_6", slot_faction_tier_4_troop, "trp_sarranid_horseman"),
      (faction_set_slot, "fac_culture_6", slot_faction_tier_5_troop, "trp_sarranid_mamluke"),

  (faction_set_slot, "fac_culture_7", slot_faction_tier_1_troop, "trp_my_recruit"),
      (faction_set_slot, "fac_culture_7", slot_faction_tier_2_troop, "trp_my_ranger"),
      (faction_set_slot, "fac_culture_7", slot_faction_tier_3_troop, "trp_my_horseman"),
      (faction_set_slot, "fac_culture_7", slot_faction_tier_4_troop, "trp_my_elite_archer"),
      (faction_set_slot, "fac_culture_7", slot_faction_tier_5_troop, "trp_my_elite_cavalry"),

in module_scripts.py
      (faction_set_slot, "fac_culture_6", slot_faction_town_walker_male_troop, "trp_sarranid_townsman"),
      (faction_set_slot, "fac_culture_6", slot_faction_town_walker_female_troop, "trp_sarranid_townswoman"),
      (faction_set_slot, "fac_culture_6", slot_faction_village_walker_male_troop, "trp_sarranid_townsman"),
      (faction_set_slot, "fac_culture_6", slot_faction_village_walker_female_troop, "trp_sarranid_townswoman"),
      (faction_set_slot, "fac_culture_6", slot_faction_town_spy_male_troop, "trp_spy_walker_1"),
      (faction_set_slot, "fac_culture_6", slot_faction_town_spy_female_troop, "trp_spy_walker_2"),

      (faction_set_slot, "fac_culture_7", slot_faction_town_walker_male_troop, "trp_town_walker_1"),
      (faction_set_slot, "fac_culture_7", slot_faction_town_walker_female_troop, "trp_town_walker_2"),
      (faction_set_slot, "fac_culture_7", slot_faction_village_walker_male_troop, "trp_village_walker_1"),
      (faction_set_slot, "fac_culture_7", slot_faction_village_walker_female_troop, "trp_village_walker_2"),
      (faction_set_slot, "fac_culture_7", slot_faction_town_spy_male_troop, "trp_spy_walker_1"),
      (faction_set_slot, "fac_culture_7", slot_faction_town_spy_female_troop, "trp_spy_walker_2"),
in module_scripts.py
      (else_try),
          (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_6"),
     
          (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_sarranid_deserter"),
          (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_sarranid_castle_guard"),
          (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_sarranid_messenger"),
          (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_sarranid_prison_guard"),
          (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_sarranid_castle_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_a, "pt_kingdom_6_reinforcements_a"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_b, "pt_kingdom_6_reinforcements_b"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_c, "pt_kingdom_6_reinforcements_c"),
 
        (else_try),
          (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_7"),
     
          (faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_my_deserter"),
          (faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_my_elite_cavalry"),
          (faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_my_messenger"),
          (faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_my_prison_guard"),
          (faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_my_castle_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_a, "pt_player_supporters_faction_reinforcements_a"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_b, "pt_player_supporters_faction_reinforcements_b"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_c, "pt_player_supporters_faction_reinforcements_c"),

in module_scripts.py comments all in blue
  ("cf_reinforce_party",
    [
      (store_script_param_1, ":party_no"),
     
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_get_slot, ":party_type",":party_no", slot_party_type),

#Rebellion changes begin:
# tooff comm this ->
#      (try_begin),
#        (eq, ":party_type", spt_kingdom_hero_party),
#        (party_stack_get_troop_id, ":leader", ":party_no"),
#        (troop_get_slot, ":party_faction",  ":leader", slot_troop_original_faction),
#      (try_end),
#Rebellion changes end

#      (try_begin),
#        (eq, ":party_faction", "fac_player_supporters_faction"),
#        (party_get_slot, ":town_lord", ":party_no", slot_town_lord),
#        (try_begin),
#          (gt, ":town_lord", 0),
#          (troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction),
#        (else_try),
#          (party_get_slot, ":party_faction", ":party_no", slot_center_original_faction),
#        (try_end),
#      (try_end),

     
      (faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a),
      (faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b),
      (faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c),

in module_scripts.py for recruiting own troops in vilages for you and your lords
use the SPD_Phoenix  code writed before
++ script "update_volunteer_troops_in_village"
and
++ script "update_npc_volunteer_troops_in_village"

and you need to create your own troops in module_troops.py

and thats all !

warband v.1.127
 
Back
Top Bottom