Topper
Regular
Since some people have requested this, I decided to start a new topic to explain how to do it.
What it does
In Warband it is possible to create your own Kingdom. You may want to create custom troops and being able to recruit them from the villages that are part of your Kingdom. This has been tested on version 1.113.
To maintain a common behaviour with the villages of other factions, this tweaks will give you recruits based on the faction that owns the village in that moment (even this feature has been asked by many members in this forum) and not based on the original culture of the village.
The fast method
If you added your custom recruit manually in the module system or with a txt editor, chances are that it has been added at the end the other troops already present in Native. If that is the case, then it is sufficient to do the following.
Open scripts.txt, look for "update_volunteer_troops_in_village" and substitute the next line with this one:
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
Let 72 hours pass and you can enjoy your troops in your villages.
Remember, this only works if your unit is added at the bottom of all other units.
Further details
360287970189640610 is the ID of the unit: it is one more of the last unit in native. Every unit is assigned a unique ID by the game, which is sequential, starting from the first one. The last unit present in Native has ID 360287970189640609. If you added two troops and you want to recruit the second one, use this ID: 360287970189640611. I hope it makes sense.
In case you are interested, the code in the module system is this:
Substitute "trp_topper_recruit" with the name you used for your own troop.
If you want everyone else to be able to recruit the same units from your villages, do the same for "update_npc_volunteer_troops_in_village". If you don't like to use the module system, go to scripts.txt, find "update_npc_volunteer_troops_in_village" and substitute the next line with this one:
To know if your recruit has been added correctly for the tweak above to work, check troops.txt and see if it is after the entry for "trp_relative_of_merchants_end".
If, however, your recruit has not been added at the end, or you don't know how to do it, there are tutorials in the forum that can help you. I'll just briefly explain the steps.
In the module system, open module_troops.py find this:
Copy it and paste it way down in the file, after the entry of the last unit, that is:
Then you modify it as you prefer, example:
You set the attributes, the level, the skils, the item, etc...
You can also design an upgrade tree: add more units and make your recruit upgrade into the second one, the second into the third, and so on... I'll give you an example by adding one more unit (you can add as many as you want).
Take the previous code of the "Topper Recruit", copy it and paste it in the line below, then modify as you prefer. Example:
Then, at the very end of "module_troops.py" you add the following line:
What it does
In Warband it is possible to create your own Kingdom. You may want to create custom troops and being able to recruit them from the villages that are part of your Kingdom. This has been tested on version 1.113.
To maintain a common behaviour with the villages of other factions, this tweaks will give you recruits based on the faction that owns the village in that moment (even this feature has been asked by many members in this forum) and not based on the original culture of the village.
The fast method
If you added your custom recruit manually in the module system or with a txt editor, chances are that it has been added at the end the other troops already present in Native. If that is the case, then it is sufficient to do the following.
Open scripts.txt, look for "update_volunteer_troops_in_village" and substitute the next line with this one:
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
Let 72 hours pass and you can enjoy your troops in your villages.
Remember, this only works if your unit is added at the bottom of all other units.
Further details
360287970189640610 is the ID of the unit: it is one more of the last unit in native. Every unit is assigned a unique ID by the game, which is sequential, starting from the first one. The last unit present in Native has ID 360287970189640609. If you added two troops and you want to recruit the second one, use this ID: 360287970189640611. I hope it makes sense.
In case you are interested, the code in the module system is this:
After line :
Insert:
Code:
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
Code:
# MOD begin
(store_faction_of_party, ":center_faction", ":center_no"),
(try_begin),
(is_between, ":center_faction", "fac_kingdom_1", "fac_kingdoms_end"),
(faction_get_slot, ":volunteer_troop", ":center_faction", slot_faction_tier_1_troop),
(else_try),
(eq, ":center_faction", "fac_player_supporters_faction"),
(assign, ":volunteer_troop", "trp_topper_recruit"),
(try_end),
# MOD end
If you want everyone else to be able to recruit the same units from your villages, do the same for "update_npc_volunteer_troops_in_village". If you don't like to use the module system, go to scripts.txt, find "update_npc_volunteer_troops_in_village" and substitute the next line with this one:
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
To know if your recruit has been added correctly for the tweak above to work, check troops.txt and see if it is after the entry for "trp_relative_of_merchants_end".
If, however, your recruit has not been added at the end, or you don't know how to do it, there are tutorials in the forum that can help you. I'll just briefly explain the steps.
In the module system, open module_troops.py find this:
Code:
["swadian_recruit","Swadian Recruit","Swadian Recruits",tf_guarantee_armor,0,0,fac_kingdom_1,
[itm_scythe,itm_hatchet,itm_pickaxe,itm_club,itm_stones,itm_tab_shield_heater_a,itm_leather_cap,itm_felt_hat,itm_felt_hat,
itm_shirt,itm_coarse_tunic,itm_leather_apron,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(4),wp(60),knows_common,swadian_face_younger_1, swadian_face_middle_2],
Copy it and paste it way down in the file, after the entry of the last unit, that is:
Code:
["relative_of_merchants_end","relative_of_merchants_end","relative_of_merchants_end",tf_hero, 0,0, fac_commoners,[],def_attrib|level(2),wp(20),knows_inventory_management_10,0],
Then you modify it as you prefer, example:
Code:
["topper_recruit","Topper Recruit","Topper Recruits",tf_guarantee_armor,0,0,fac_player_supporters_faction,
[itm_scythe,itm_hatchet,itm_pickaxe,itm_club,itm_stones,itm_tab_shield_heater_a,itm_leather_cap,itm_felt_hat,itm_felt_hat,
itm_shirt,itm_coarse_tunic,itm_leather_apron,itm_nomad_boots,itm_wrapping_boots],
def_attrib|level(4),wp(60),knows_common,swadian_face_younger_1, swadian_face_middle_2],
You set the attributes, the level, the skils, the item, etc...
You can also design an upgrade tree: add more units and make your recruit upgrade into the second one, the second into the third, and so on... I'll give you an example by adding one more unit (you can add as many as you want).
Take the previous code of the "Topper Recruit", copy it and paste it in the line below, then modify as you prefer. Example:
Code:
["topper_badass","Topper Badass","Topper Badasses",tf_guarantee_boots,0,0,fac_player_supporters_faction,
[itm_battle_fork,itm_hide_boots],
str_30|agi_30|level(1),wp(400),knows_common,swadian_face_younger_1, swadian_face_middle_2],
Then, at the very end of "module_troops.py" you add the following line:
Code:
upgrade(troops, "topper_recruit", "topper_badass")