SP Tutorial Module System Recruit your custom troops in your own Kingdom

Users who are viewing this thread

Alright, time I come forward with my stupid coding problems... :???:

Anyways, what I am looking to do is make the mercenary troops recruitable from my villages (starting with watchmen). I have tried many of the changes both here and elsewhere on the forum, and I still can't get it to work properly. I'm thinking I might be overcomplicating it, so my question is just that - am I? IS there a simpler way to set the merc tech tree as my factions recruitable units?
 
I pasted in the .py and I'm only getting vaegirs in a village I conquered.  What'd I do wrong?

Edit:  I didn't wait a few days.  Works like a charm.
 
i got it all in and hit the options held a village for 2 weeks its nord, tried switching to swadian.. do i have to wait longer? i'm still only able to recruit nords
 
how do you find out what the unique id is for a troop, in my editor its number 933 if that helps?

also what code do I paste in if I DON'T want to use my custom troop but I DO want all factions to recruit their faction troop in all villages they own.

thank you
 
I'm using Morgh's editor and editing text files.

Edit: I think I figured it out since I only added 3 new troops it must just be 36xxxx13.

Now I'm looking at the code you pasted for cf_reinforce is there a variable I have to change in there?

I would be surprised if it did what I want it to without some editing.

EDIT: IT WORKS WAAAAHOOO!!!! Thank You soo much I always wanted this ever since MB came out 6 years ago.
 
if anyone has any idea of what i may of done wrong please let me know.. i edited the .py, and posted the menu options and actual menu in the right place so it appears in game.  also i cut out the stuff in red.. my faction is still not changing.
 
banker247 said:
if anyone has any idea of what i may of done wrong please let me know.. i edited the .py, and posted the menu options and actual menu in the right place so it appears in game.  also i cut out the stuff in red.. my faction is still not changing.

I didn't touch the py. I just realized, found out myself, the game doesnt even look at py files they just make the text files the game reads and since the text files are hard to read unless you know what your looking for alot of ppl prefer py. Point is I just edited my text files and it worked beautifully.

1. Create a new troop in troops.txt or editor. (here is my faction recruit)
In native there are about 929 troops.
The unique ID for the last troop is 360287970189640609 so if you add yours to the end its troop 930 or 360287970189640610 the next would be 36xxx11 then 36xxx12 and so on.
MAKE SURE THEY ARE "player_supporters_faction" and "not player_faction"

trp_imperial_levy Imperial_Levy Imperial_Levy 0 3145728 0 0 14 934 0
  477 0 671 0 169 0 171 0 165 0 317 0 297 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0
  5 5 4 4 5 # This is Str, Agi, Int, Cha, Level
75 75 60 60 60 60 0 # This is weapon proficiency starting with one hand, two hand, pole-arm, archery, crossbow, throwing.
274 131072 0 17 0 0
  1 1315051091194281984 1835136 0 33286021831 7916447985573822463 2031036 0
2. Navigate to scripts.txt in your module folder whether its native or anther mod.
Inside scripts.txt look for (ctrl+f) "update_volunteer_troops_in_village"
Paste the following code OVER the existing code making sure that the blue number below is the unique ID for your faction recruit troop that will come out of your villages.

update_volunteer_troops_in_village -1
43 23 2 1224979098644774912 1 521 3 1224979098644774913 1224979098644774912 26 521 3 1224979098644774914 1224979098644774912 19 522 3 1224979098644774915 1224979098644774914 41 2204 2 1224979098644774916 1224979098644774912 4 0 33 3 1224979098644774916 432345564227567631 432345564227567637 522 3 1224979098644774915 1224979098644774916 41 5 0 31 2 1224979098644774916 432345564227567630 2133 2 1224979098644774915 360287970189640610 3 0 2133 2 1224979098644774917 1 2123 3 1224979098644774918 1224979098644774913 10 6 3 1224979098644774919 0 1224979098644774918 2136 3 1224979098644774920 0 100 2147483678 2 1224979098644774920 10 2136 3 1224979098644774920 0 2 1561 3 1224979098644774921 1224979098644774915 1224979098644774920 4 0 2147483680 2 1224979098644774921 0 1561 3 1224979098644774921 1224979098644774915 0 3 0 32 2 1224979098644774921 0 2105 2 1224979098644774917 1 2133 2 1224979098644774915 1224979098644774921 3 0 2133 2 1224979098644774922 7 4 0 30 2 1224979098644774913 5 2133 2 1224979098644774922 1224979098644774913 2108 2 1224979098644774922 2 2105 2 1224979098644774922 10 5 0 2147483678 2 1224979098644774913 0 2133 2 1224979098644774922 0 3 0 2107 2 1224979098644774922 3 2120 3 1224979098644774923 2 1224979098644774917 2108 2 1224979098644774922 1224979098644774923 2136 3 1224979098644774924 0 1224979098644774922 501 3 1224979098644774912 92 1224979098644774915 501 3 1224979098644774912 93 1224979098644774924
update_npc_volunteer_troops_in_village -1
23 23 2 1224979098644774912 1 521 3 1224979098644774913 1224979098644774912 19 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

NEXT under update_npc_volunteer_troops_in_village
Paste the following, making sure to substitute the blue code with your unquie ID if its not troop 930 as above

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

3. Now navigate to "cf_reinforce_party -1" in scripts.txt
Replace the code under it with this exact code no editing.

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

4. Save all the edits you made load your saved game. Wait or play for 72 in game hours or there abouts. Then try to do two of the following things.

  - Recruit a troop from a village owned by a faction that took it over in war.
  - If you can recruit that factions troops  instead of the original culture troop you know its working.

  - If you have your own kingdom try recruiting from any village you have and you should be able to recruit your custom faction troop just like any other.

I have done exactly what I wrote above and I can recruit any faction troop including my own in any village they or I own regardless of culture. Hope this helps.

EDIT: There is a way to get your lords to recruit your troops too through party_templates but I'm working on it. My skill limits me since this is all new to me.

Attempt at having your lords recruit your troops
So inside party templates I added this to the bottom

pt_player_supporters_faction_a {!}player_supporters_faction_reinforcements_a 0 0 1 0 934 2 6 0 933 4 7 0 -1 -1 -1 -1
pt_player_supporters_faction_b {!}player_supporters_faction_reinforcements_b 0 0 1 0 941 2 6 0 940 4 7 0 -1 -1 -1 -1
pt_player_supporters_faction_c {!}player_supporters_faction_reinforcements_c 0 0 1 0 936 3 6 0 938 2 4 0 -1 -1 -1 -1

In there you see Kingdom_1 etc those are what the npc factions are called. The player faction is called "player_supporters_faction"
So I substituted the kingdom_1 with player_supports_faction.

Next the numbers 934 2 6 0 933 4 7 0 -1 -1 -1 -1 (934 = troop number, 2 = min to recruit, 6 = max to recruit, 933 = next troop to recruit 4 is min 7 is max.
Basically its saying in one recruitment period for the NPC recruit anywhere between 2 to 6 Trained recruits (my custom troop) and 4 to 7 fresh recruits.
this goes on for three lines and you can then tell it to recruit more advanced troops etc. This when looking at it explains to me why the damn NPC always has so many archers lol.

Always add a 0 at the end like the code above and the -1 are place holders. so say in line one you only add one troop to be recruited you would add an extra -1 as a place holder. It would look like this.

pt_player_supporters_faction_c {!}player_supporters_faction_reinforcements_c 0 0 1 0 936 3 6 0 -1 -1 -1 -1 -1

Well who knows if this will work but at least it was informative =)

YOU CAN however edit the kingdom ones to change the way the npc recruits in your game. I actually gave them more foot troops to compensate with archers and more high end troops like Knights because this game is so damn easy even on the hardest setting.
 
EDIT: FYI I made my own Custom faction troops called Imperial Levy with a whole tree. I can already recruit these from any town I own and it works fine. I can also recruit any other factions troop from any village they own as well so its already working. I'm unsure what your code does and I already have a menu to choose my culture type but my "PLAYER FACTION of Imperial" is not a choice" I'am unaware of what choosing what your culture actually does in game. I have made mine Vaiger but my ai lords still recruit their culture troops and I have not made a companion lord yet. SO IN your code for update_volunteer I don't see where it calls on my custom troops as I have in my code posted above see unique ID 360287970189640613 this is my custom troop being called into my code. It can only be recruited when I'am king and when I own territory.

Cool I'll play around with it. One question though because I have been using diplomacy before I even became king in native so I don't know what feature it is but.

I can choose what culture I want my kingdom to be from my chancellor in my home town or castle I own. Is this native? and does this mean my companions if made lord recruit this?

Also AI lords don't actually recruit from towns do they? I figured it was automatically added since they always recruit thier culture troops no matter what faction they belong to no matter what town they go to, to recruit.

Also on your code for menus this will make my culture my own faction? Will this change the guards in my city scenes and castle scenes to my own troops? this will make all my lords recruit my troops?

Last question for some reason all my troops have the same str of 7 and agility of 4 int of 4 and cha of 4 I changed it in the txt file and I can see it in the text file but it will not update in game no matter how long I wait any idea?

2nd EDIT: I like your menu code but how can I add anther option to recruit my custom faction troops? It appears they have unique ids pointing to their troop numbers so maybe if I add anther option and replace those numbers with mine it should work hmm? Maybe you have to create your own player faction in faction.txt? I would like to make a custom player faction and culture so all my lords recruit my custom troops and they appear in my city castle scenes.

3rd Edit: If Im reading it right it looks like you swadian code is pulling in arena fighters and your vaegir code pulling in mercenaries and your Khergit code pulling in swadians. Like its all shifted up wrong.
 
Atamawood.

If I created my own faction troops, and forced lords to recruit their own faction troops, would they by default recruit mine if they were my vassals or is there more required for that.
 
I don't use the module system so none of that helps me for now at least I guess I will go try and learn it again..

I also tried your menu text and it does not work. The option doesn't even appear.

EDIT: Ok im in the module system now and I made this

("Imperial",[],"Imperial.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_imperial_levy"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_imperial_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_imperial_levy_bowman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_imperial_soldier"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_imperial_calvary"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_7_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_7_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_7_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
one thing I see though is its asking for pt_kingdom at the bottom thats a party_template telling the npc how many of each troops to recruit. So now I guess I have to make one for these guys.

So in party_templates module I did this
("kingdom_7_reinforcements_a", "{!}kingdom_7_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_imperial_footman,2,6),(trp_imperial_levy,4,7),(trp_imperial_levy_bowman,2,5)] ),
("kingdom_7_reinforcements_b", "{!}kingdom_7_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_imperial_soldier,2,6),(trp_imperial_soldier,4,7),(trp_imperial_archer,2,5)] ),
("kingdom_7_reinforcements_c", "{!}kingdom_7_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_imperial_calvary,3,:cool:,(trp_imperial_axeman,2,5),(trp_imperial_axeguard,2,3)] ),

sgould I change faction commoners to fac_player_supporters_faction ?

now I think I have to assign player supported to kingdom 7? or change kingdom 7 to player supports not sure

what does {!} mean?

my script code
#Rebellion changes end

#      (try_begin),
#        (eq, ":party_faction", "fac_player_supporters_faction"),
#        (party_get_slot, ":town_lord", ":party_no", slot_town_lord),
#      (try_begin),
        ##diplomacy begin
#          (is_between, "$g_player_culture", npc_kingdoms_begin, npc_kingdoms_end),
#          (assign, ":party_faction", "$g_player_culture"),
         
#          (try_begin), #debug
#            (eq, "$cheat_mode", 1),
#          (str_store_party_name, s11, ":party_no"),
#            (display_message, "@pt in {s11}"),
#          (try_end),
         
#        (else_try),
        ##diplomacy end
#          (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),

as you can see my diplomacy mod interjects I hope I don't get red lines for commenting it out. This feature let you choose what faction culture you wanted. I'm just changing it to the one you used then overriding what they recruit.
 
Hey I've been using Diplomacy mod and he already has a menu to change your culture and your npc lords will recruit that faction. I'm going to try to edit his code to add anther faction (my custom one) so the lords then recruit my troops.


EDIT: moving my question http://forums.taleworlds.com/index.php/topic,117487.msg2833603.html#msg2833603

help me if you can =)
 
Atamawood said:
Well I'll show you how It looks in the module system

This is what I did to cf_reinforce_party -1 which is how the AI lords recruit thier troops since they don't acually recruit them from villages.

This is how it looks

("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),


So what I did was cut out everything in green which then forces the AI lords to recruit only what faction they belong too. Well this works great until you create your own kingdom correct? Thats because the player faction has no set troops (so creating troops for the player faction would do this.

This is the menu code I added to select the player faction troops

("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"),
        ]
      ),
      ]
  ),

So if you created 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 then you and your Lords would recruit them. You may acually have to treat it like a whole new faction.

I'll post the rest of the changes later.

have you tried just this code in scripts instead of deleting it all?
Code:
 (try_begin),
     (eq, ":party_faction", "fac_player_supporters_faction"),
        (assign, ":party_faction", "fac_culture_7"),
      (try_end),
 
Hey I found a script somewhere(sorry i can't give credits)

But it essentially makes it so when you take ove a villiage you recruit your faction base unit there....
I'm still new to the mod system but taake a look at it. So even if I created custom factions, taking over villiages would result in recruiting that faction's unit, right?

# script_update_volunteer_troops_in_village
# INPUT: arg1 = center_no
# OUTPUT: none
("update_volunteer_troops_in_village",
[
(store_script_param, ":center_no", 1),
(party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
(party_get_slot, ":center_culture", ":center_no", slot_center_culture),
#pr start
(try_begin),
(eq,"$player_has_homage",0),
(assign, ":volunteer_troop", "trp_farmer"),
(else_try),
(eq,"$player_has_homage",1),
(faction_get_slot, ":center_culture", "$players_kingdom", slot_faction_culture),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
(else_try),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
(try_end),
#pr end
(assign, ":volunteer_troop_tier", 1),
(store_div, ":tier_upgrades", ":player_relation", 10),
(try_for_range, ":unused", 0, ":tier_upgrades"),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 10),
(store_random_in_range, ":random_no", 0, 2),
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", ":random_no"),
(try_begin),
(le, ":upgrade_troop_no", 0),
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0),
(try_end),
(gt, ":upgrade_troop_no", 0),
(val_add, ":volunteer_troop_tier", 1),
(assign, ":volunteer_troop", ":upgrade_troop_no"),
(try_end),
(assign, ":upper_limit", 7),
(try_begin),
(ge, ":player_relation", 5),
(assign, ":upper_limit", ":player_relation"),
(val_div, ":upper_limit", 2),
(val_add, ":upper_limit", 10),
(else_try),
(lt, ":player_relation", 0),
(assign, ":upper_limit", 0),
(try_end),

(val_mul, ":upper_limit", 3),
(store_add, ":amount_random_divider", 2, ":volunteer_troop_tier"),
(val_div, ":upper_limit", ":amount_random_divider"),

(store_random_in_range, ":amount", 0, ":upper_limit"),
(party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
(party_set_slot, ":center_no", slot_center_volunteer_troop_amount, ":amount"),
]),
 
Like a lot of people, I've been following this thread with great interest. 

But, all the discussion has muddled my brain, I don't feel confident that I know which bits of code to put where. I'm going to suggest something that many people would balk at.

Because there are so many people who would love to have this, each with their own different game files, perhaps one of you who does understand this could take a native 1.125 scripts.py and scripts.txt  (If you can make the python one then making both should be easy) with the finished working code changes and post them for download? I know what a douche I look like for asking such a thing, but I just know a ton of people would be eternally grateful.

Me included.

Drachen
 
LtpLegend said:
banker247 said:
if anyone has any idea of what i may of done wrong please let me know.. i edited the .py, and posted the menu options and actual menu in the right place so it appears in game.  also i cut out the stuff in red.. my faction is still not changing.

I didn't touch the py. I just realized, found out myself, the game doesnt even look at py files they just make the text files the game reads and since the text files are hard to read unless you know what your looking for alot of ppl prefer py. Point is I just edited my text files and it worked beautifully.

1. Create a new troop in troops.txt or editor. (here is my faction recruit)
In native there are about 929 troops.
The unique ID for the last troop is 360287970189640609 so if you add yours to the end its troop 930 or 360287970189640610 the next would be 36xxx11 then 36xxx12 and so on.
MAKE SURE THEY ARE "player_supporters_faction" and "not player_faction"

trp_imperial_levy Imperial_Levy Imperial_Levy 0 3145728 0 0 14 934 0
  477 0 671 0 169 0 171 0 165 0 317 0 297 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0
  5 5 4 4 5 # This is Str, Agi, Int, Cha, Level
75 75 60 60 60 60 0 # This is weapon proficiency starting with one hand, two hand, pole-arm, archery, crossbow, throwing.
274 131072 0 17 0 0
  1 1315051091194281984 1835136 0 33286021831 7916447985573822463 2031036 0
2. Navigate to scripts.txt in your module folder whether its native or anther mod.
Inside scripts.txt look for (ctrl+f) "update_volunteer_troops_in_village"
Paste the following code OVER the existing code making sure that the blue number below is the unique ID for your faction recruit troop that will come out of your villages.

update_volunteer_troops_in_village -1
43 23 2 1224979098644774912 1 521 3 1224979098644774913 1224979098644774912 26 521 3 1224979098644774914 1224979098644774912 19 522 3 1224979098644774915 1224979098644774914 41 2204 2 1224979098644774916 1224979098644774912 4 0 33 3 1224979098644774916 432345564227567631 432345564227567637 522 3 1224979098644774915 1224979098644774916 41 5 0 31 2 1224979098644774916 432345564227567630 2133 2 1224979098644774915 360287970189640610 3 0 2133 2 1224979098644774917 1 2123 3 1224979098644774918 1224979098644774913 10 6 3 1224979098644774919 0 1224979098644774918 2136 3 1224979098644774920 0 100 2147483678 2 1224979098644774920 10 2136 3 1224979098644774920 0 2 1561 3 1224979098644774921 1224979098644774915 1224979098644774920 4 0 2147483680 2 1224979098644774921 0 1561 3 1224979098644774921 1224979098644774915 0 3 0 32 2 1224979098644774921 0 2105 2 1224979098644774917 1 2133 2 1224979098644774915 1224979098644774921 3 0 2133 2 1224979098644774922 7 4 0 30 2 1224979098644774913 5 2133 2 1224979098644774922 1224979098644774913 2108 2 1224979098644774922 2 2105 2 1224979098644774922 10 5 0 2147483678 2 1224979098644774913 0 2133 2 1224979098644774922 0 3 0 2107 2 1224979098644774922 3 2120 3 1224979098644774923 2 1224979098644774917 2108 2 1224979098644774922 1224979098644774923 2136 3 1224979098644774924 0 1224979098644774922 501 3 1224979098644774912 92 1224979098644774915 501 3 1224979098644774912 93 1224979098644774924
update_npc_volunteer_troops_in_village -1
23 23 2 1224979098644774912 1 521 3 1224979098644774913 1224979098644774912 19 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

NEXT under update_npc_volunteer_troops_in_village
Paste the following, making sure to substitute the blue code with your unquie ID if its not troop 930 as above

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

3. Now navigate to "cf_reinforce_party -1" in scripts.txt
Replace the code under it with this exact code no editing.

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

4. Save all the edits you made load your saved game. Wait or play for 72 in game hours or there abouts. Then try to do two of the following things.

  - Recruit a troop from a village owned by a faction that took it over in war.
  - If you can recruit that factions troops  instead of the original culture troop you know its working.

  - If you have your own kingdom try recruiting from any village you have and you should be able to recruit your custom faction troop just like any other.

I have done exactly what I wrote above and I can recruit any faction troop including my own in any village they or I own regardless of culture. Hope this helps.

EDIT: There is a way to get your lords to recruit your troops too through party_templates but I'm working on it. My skill limits me since this is all new to me.

Attempt at having your lords recruit your troops
So inside party templates I added this to the bottom

pt_player_supporters_faction_a {!}player_supporters_faction_reinforcements_a 0 0 1 0 934 2 6 0 933 4 7 0 -1 -1 -1 -1
pt_player_supporters_faction_b {!}player_supporters_faction_reinforcements_b 0 0 1 0 941 2 6 0 940 4 7 0 -1 -1 -1 -1
pt_player_supporters_faction_c {!}player_supporters_faction_reinforcements_c 0 0 1 0 936 3 6 0 938 2 4 0 -1 -1 -1 -1

In there you see Kingdom_1 etc those are what the npc factions are called. The player faction is called "player_supporters_faction"
So I substituted the kingdom_1 with player_supports_faction.

Next the numbers 934 2 6 0 933 4 7 0 -1 -1 -1 -1 (934 = troop number, 2 = min to recruit, 6 = max to recruit, 933 = next troop to recruit 4 is min 7 is max.
Basically its saying in one recruitment period for the NPC recruit anywhere between 2 to 6 Trained recruits (my custom troop) and 4 to 7 fresh recruits.
this goes on for three lines and you can then tell it to recruit more advanced troops etc. This when looking at it explains to me why the damn NPC always has so many archers lol.

Always add a 0 at the end like the code above and the -1 are place holders. so say in line one you only add one troop to be recruited you would add an extra -1 as a place holder. It would look like this.

pt_player_supporters_faction_c {!}player_supporters_faction_reinforcements_c 0 0 1 0 936 3 6 0 -1 -1 -1 -1 -1

Well who knows if this will work but at least it was informative =)

YOU CAN however edit the kingdom ones to change the way the npc recruits in your game. I actually gave them more foot troops to compensate with archers and more high end troops like Knights because this game is so damn easy even on the hardest setting.

Can anyone confirm that this is incompatible with v.26?Cause every time I try it I only get something like "23 something are fiercely devoted to you" or "23 Temp something".The 1st option doesn't give me any unit but it does take my money.The later one give me a naked character like a Companion sort of type thats named Temp volunteer or something even tho I got 23 on the option it only gives me 1 unit.Also I have Diplomacy tho I also tried it on Native but still the same result.

P.S this method work prior to v.26 in Diplomacy and Native.
P.S.S sorry for my bad english lol
 
LtpLegend said:
I don't use the module system so none of that helps me for now at least I guess I will go try and learn it again..

I also tried your menu text and it does not work. The option doesn't even appear.

EDIT: Ok im in the module system now and I made this

("Imperial",[],"Imperial.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_imperial_levy"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_imperial_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_imperial_levy_bowman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_imperial_soldier"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_imperial_calvary"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_7_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_7_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_7_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
one thing I see though is its asking for pt_kingdom at the bottom thats a party_template telling the npc how many of each troops to recruit. So now I guess I have to make one for these guys.

So in party_templates module I did this
("kingdom_7_reinforcements_a", "{!}kingdom_7_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_imperial_footman,2,6),(trp_imperial_levy,4,7),(trp_imperial_levy_bowman,2,5)] ),
("kingdom_7_reinforcements_b", "{!}kingdom_7_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_imperial_soldier,2,6),(trp_imperial_soldier,4,7),(trp_imperial_archer,2,5)] ),
("kingdom_7_reinforcements_c", "{!}kingdom_7_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_imperial_calvary,3,:cool:,(trp_imperial_axeman,2,5),(trp_imperial_axeguard,2,3)] ),

sgould I change faction commoners to fac_player_supporters_faction ?

now I think I have to assign player supported to kingdom 7? or change kingdom 7 to player supports not sure

what does {!} mean?

my script code
#Rebellion changes end

#      (try_begin),
#        (eq, ":party_faction", "fac_player_supporters_faction"),
#        (party_get_slot, ":town_lord", ":party_no", slot_town_lord),
#      (try_begin),
        ##diplomacy begin
#          (is_between, "$g_player_culture", npc_kingdoms_begin, npc_kingdoms_end),
#          (assign, ":party_faction", "$g_player_culture"),
         
#          (try_begin), #debug
#            (eq, "$cheat_mode", 1),
#          (str_store_party_name, s11, ":party_no"),
#            (display_message, "@pt in {s11}"),
#          (try_end),
         
#        (else_try),
        ##diplomacy end
#          (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),

as you can see my diplomacy mod interjects I hope I don't get red lines for commenting it out. This feature let you choose what faction culture you wanted. I'm just changing it to the one you used then overriding what they recruit.

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  .





 
Has anyone figured out how this would work in version 1.126?

I would like very much to have this working.
 
Back
Top Bottom