laszers
Veteran
Hello everyone, and as the topic say's this will show you how to make troops available for recruitment from castles and towns.
This is a very discussed topic, and many people think it requires a lot of coding and modding skills. But all it really requires is the module system.
Before I start this tutorial, I would like to say all credit to Dunde for helping me with the codes, and Ritter Dummbatz for the encouragement for making the tutorial.
The only mod I know this works with is PBOD, any others i cannot say for sure (works fine for native, obviously).
I am using ms 1.134
make sure you backup all modified game files.
first off is scripts
place this code
below or above this
just search it
scripts 2;
place this code
below or above this
search it
make sure you put these two in the order listed above, as it could cause complications other wise.
next is simple triggers.
simple triggers
past this over the existing, script_update_mercenary_units_of_towns
next is one of the most confusing.
module Game menu's 1;
put below "go to lords hall" in castle_castle menu, just search it.
module game Menu's 2;
place this at the end of module game menus before the last ]
if you have any problems let me know in a post. i will soon be adding how to recruit separate troop trees through castles and towns.
if the tutorial was unclear please tell me so i can improve upon it.
MAKE SURE TO WAIT THREE DAYS IN GAME, MENU WILL NOT SHOW UP OTHERWISE
please post if this helped you.
--------------------------------------------------------------------------------------------------------------------------------
Here is the separate troop trees part of the tutorial
This tutorial allows you to implement a code that lets you recruit troops from both castles and towns, however you can recruit nobles from castles, and regulars from towns.
first off is scripts
you will copy and paste the first script code right below itself, you must rename the script so it may look like this,
put this script right below the one you put in the first tutorial
For the next one you have to edit a tiny bit more.
Paste this one just as you did the first, right below the one you put in the first tutorial.
Now for module game menus, we are going to change it so each tree is specifically recruited from castle or town.
place this over the original, in the first tutorial. this will make it so nobles are only recruited from castles.
this code will allow for regulars to be recruited from towns.
Note: Notice that in each of these codes for nobles and normal's it has at the beginning castle begin and castle end, but for normal's it has town begin and town end, this determines weather or not they are recruited souly from towns, or castles.
This code is if you want troops recruited from towns only.
you can place this code below the noble.
Now for the last game menus.
Remember to wait 3 days, unless you follow ritter's comment.
if you want to recruit different troops from villages as well, then simply change the tier for each script and game menu under villages.
You do not have to change simple triggers.
This is a very discussed topic, and many people think it requires a lot of coding and modding skills. But all it really requires is the module system.
Before I start this tutorial, I would like to say all credit to Dunde for helping me with the codes, and Ritter Dummbatz for the encouragement for making the tutorial.
The only mod I know this works with is PBOD, any others i cannot say for sure (works fine for native, obviously).
I am using ms 1.134
make sure you backup all modified game files.
first off is scripts
place this code
#script_cf_town_castle_recruit_volunteers_cond
# INPUT: none
# OUTPUT: none
("cf_town_castle_recruit_volunteers_cond",
[(store_faction_of_party, ":town_faction", "$current_town"),
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(store_relation, ":town_faction_relation", ":town_faction", "fac_player_faction"),
(ge, ":center_relation", 0),
(this_or_next|ge, ":center_relation", 5),
(this_or_next|eq, ":town_faction", "$players_kingdom"),
(this_or_next|ge, ":town_faction_relation", 0),
(this_or_next|eq, ":town_faction", "$supported_pretender_old_faction"),
( eq, "$players_kingdom", 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(ge, ":free_capacity", 1),
]),
# INPUT: none
# OUTPUT: none
("cf_town_castle_recruit_volunteers_cond",
[(store_faction_of_party, ":town_faction", "$current_town"),
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(store_relation, ":town_faction_relation", ":town_faction", "fac_player_faction"),
(ge, ":center_relation", 0),
(this_or_next|ge, ":center_relation", 5),
(this_or_next|eq, ":town_faction", "$players_kingdom"),
(this_or_next|ge, ":town_faction_relation", 0),
(this_or_next|eq, ":town_faction", "$supported_pretender_old_faction"),
( eq, "$players_kingdom", 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(ge, ":free_capacity", 1),
]),
below or above this
#script_cf_village_recruit_volunteers_cond
# INPUT: none
# OUTPUT: none
("cf_village_recruit_volunteers_cond",
[
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_checking_volunteer_availability_script"),
(try_end),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(store_faction_of_party, ":village_faction", "$current_town"),
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(store_relation, ":village_faction_relation", ":village_faction", "fac_player_faction"),
(ge, ":center_relation", 0),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_center_relation_at_least_zero"),
(try_end),
(this_or_next|ge, ":center_relation", 5),
(this_or_next|eq, ":village_faction", "$players_kingdom"),
(this_or_next|ge, ":village_faction_relation", 0),
(this_or_next|eq, ":village_faction", "$supported_pretender_old_faction"),
(eq, "$players_kingdom", 0),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_relationfaction_conditions_met"),
(try_end),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_troops_available"),
(try_end),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(ge, ":free_capacity", 1),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_party_has_capacity"),
(try_end),
]),
# INPUT: none
# OUTPUT: none
("cf_village_recruit_volunteers_cond",
[
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_checking_volunteer_availability_script"),
(try_end),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
(neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
(neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
(store_faction_of_party, ":village_faction", "$current_town"),
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(store_relation, ":village_faction_relation", ":village_faction", "fac_player_faction"),
(ge, ":center_relation", 0),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_center_relation_at_least_zero"),
(try_end),
(this_or_next|ge, ":center_relation", 5),
(this_or_next|eq, ":village_faction", "$players_kingdom"),
(this_or_next|ge, ":village_faction_relation", 0),
(this_or_next|eq, ":village_faction", "$supported_pretender_old_faction"),
(eq, "$players_kingdom", 0),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_relationfaction_conditions_met"),
(try_end),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_troops_available"),
(try_end),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(ge, ":free_capacity", 1),
(try_begin),
(eq, "$cheat_mode", 1),
(display_message, "str_party_has_capacity"),
(try_end),
]),
scripts 2;
place this code
#script_town_castle_recruit_nobles_recruit
# INPUT: none
# OUTPUT: none
("town_castle_recruit_nobles_recruit",
[(store_faction_of_party, ":cur_faction", "$current_town"),
(faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_5_troop),
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":volunteer_amount", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 200),#200 denars per man
(val_min, ":volunteer_amount", ":gold_capacity"),
(party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(store_mul, ":cost", ":volunteer_amount", 200),#200 denars per man
(troop_remove_gold, "trp_player", ":cost"),
]),
# INPUT: none
# OUTPUT: none
("town_castle_recruit_nobles_recruit",
[(store_faction_of_party, ":cur_faction", "$current_town"),
(faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_5_troop),
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":volunteer_amount", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 200),#200 denars per man
(val_min, ":volunteer_amount", ":gold_capacity"),
(party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(store_mul, ":cost", ":volunteer_amount", 200),#200 denars per man
(troop_remove_gold, "trp_player", ":cost"),
]),
below or above this
#script_village_recruit_volunteers_recruit
# INPUT: none
# OUTPUT: none
("village_recruit_volunteers_recruit",
[(store_faction_of_party, ":cur_faction", "$current_town"),
(faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_2_troop),
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":volunteer_amount", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 10),#10 denars per man
(val_min, ":volunteer_amount", ":gold_capacity"),
(party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(store_mul, ":cost", ":volunteer_amount", 10),#10 denars per man
(troop_remove_gold, "trp_player", ":cost"),
]),
# INPUT: none
# OUTPUT: none
("village_recruit_volunteers_recruit",
[(store_faction_of_party, ":cur_faction", "$current_town"),
(faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_2_troop),
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":volunteer_amount", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 10),#10 denars per man
(val_min, ":volunteer_amount", ":gold_capacity"),
(party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(store_mul, ":cost", ":volunteer_amount", 10),#10 denars per man
(troop_remove_gold, "trp_player", ":cost"),
]),
search it
make sure you put these two in the order listed above, as it could cause complications other wise.
next is simple triggers.
simple triggers
# Adding mercenary troops to the towns
(72,
[
(call_script, "script_update_mercenary_units_of_towns"),
#NPC changes begin
# removes (call_script, "script_update_companion_candidates_in_taverns"),
#NPC changes end
(call_script, "script_update_ransom_brokers"),
(call_script, "script_update_tavern_travellers"),
(call_script, "script_update_tavern_minstrels"),
(call_script, "script_update_booksellers"),
(call_script, "script_update_villages_infested_by_bandits"),
(try_for_range, ":village_no", centers_begin, centers_end),
(call_script, "script_update_volunteer_troops_in_village", ":village_no"),
(call_script, "script_update_npc_volunteer_troops_in_village", ":village_no"),
(try_end),
]),
(72,
[
(call_script, "script_update_mercenary_units_of_towns"),
#NPC changes begin
# removes (call_script, "script_update_companion_candidates_in_taverns"),
#NPC changes end
(call_script, "script_update_ransom_brokers"),
(call_script, "script_update_tavern_travellers"),
(call_script, "script_update_tavern_minstrels"),
(call_script, "script_update_booksellers"),
(call_script, "script_update_villages_infested_by_bandits"),
(try_for_range, ":village_no", centers_begin, centers_end),
(call_script, "script_update_volunteer_troops_in_village", ":village_no"),
(call_script, "script_update_npc_volunteer_troops_in_village", ":village_no"),
(try_end),
]),
past this over the existing, script_update_mercenary_units_of_towns
next is one of the most confusing.
module Game menu's 1;
("recruit_nobles",[(call_script, "script_cf_town_castle_recruit_volunteers_cond"),]
,"Recruit Nobles.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu, "mnu_recruit_nobles"),
(try_end),
]),
,"Recruit Nobles.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu, "mnu_recruit_nobles"),
(try_end),
]),
("castle_castle",
[
(party_slot_eq,"$current_town",slot_party_type, spt_castle),
(eq, "$sneaked_into_town", 0),
(str_clear, s1),
(try_begin),
(store_faction_of_party, ":center_faction", "$current_town"),
(faction_slot_eq, ":center_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, ":center_faction", slot_faction_ai_object, "$current_town"),
(str_store_string, s1, "str__join_the_feast"),
(try_end),
],"Go to the Lord's hall{s1}.",
[
(try_begin),
(this_or_next|eq, "$all_doors_locked", 1),
(eq, "$sneaked_into_town", 1),
(display_message,"str_door_locked",0xFFFFAAAA),
(else_try),
(this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 50),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 125),
(neq, "$g_player_eligible_feast_center_no", "$current_town"),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$g_encountered_party"),
(neg|check_quest_active, "qst_wed_betrothed"),
(neg|check_quest_active, "qst_wed_betrothed_female"),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin), #Married players always make the cut
(jump_to_menu, "mnu_cannot_enter_court"),
(else_try),
(assign, "$town_entered", 1),
(call_script, "script_enter_court", "$current_town"),
(try_end),
], "Door to the castle."),
[
(party_slot_eq,"$current_town",slot_party_type, spt_castle),
(eq, "$sneaked_into_town", 0),
(str_clear, s1),
(try_begin),
(store_faction_of_party, ":center_faction", "$current_town"),
(faction_slot_eq, ":center_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, ":center_faction", slot_faction_ai_object, "$current_town"),
(str_store_string, s1, "str__join_the_feast"),
(try_end),
],"Go to the Lord's hall{s1}.",
[
(try_begin),
(this_or_next|eq, "$all_doors_locked", 1),
(eq, "$sneaked_into_town", 1),
(display_message,"str_door_locked",0xFFFFAAAA),
(else_try),
(this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 50),
(neg|troop_slot_ge, "trp_player", slot_troop_renown, 125),
(neq, "$g_player_eligible_feast_center_no", "$current_town"),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$g_encountered_party"),
(neg|check_quest_active, "qst_wed_betrothed"),
(neg|check_quest_active, "qst_wed_betrothed_female"),
(neg|troop_slot_ge, "trp_player", slot_troop_spouse, active_npcs_begin), #Married players always make the cut
(jump_to_menu, "mnu_cannot_enter_court"),
(else_try),
(assign, "$town_entered", 1),
(call_script, "script_enter_court", "$current_town"),
(try_end),
], "Door to the castle."),
module game Menu's 2;
(
"recruit_nobles",0,
"{s18}",
"none",
[(store_faction_of_party, ":cur_faction", "$current_town"),
(faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_5_troop),
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 40),#40 denars per man
(assign, ":party_capacity", ":free_capacity"),
(val_min, ":party_capacity", ":gold_capacity"),
(try_begin),
(gt, ":party_capacity", 0),
(val_min, ":volunteer_amount", ":party_capacity"),
(try_end),
(assign, reg5, ":volunteer_amount"),
(assign, reg7, 0),
(try_begin),
(gt, ":volunteer_amount", ":gold_capacity"),
(assign, reg7, 1), #not enough money
(try_end),
(try_begin),
(eq, ":volunteer_amount", 0),
(str_store_string, s18, "@No one here seems to be willing to join your party."),
(else_try),
(store_mul, reg6, ":volunteer_amount", 40),#40 denars per man
(str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
(try_begin),
(eq, reg5, 1),
(str_store_string, s18, "@One {s3} volunteers to follow you."),
(else_try),
(str_store_string, s18, "@{reg5} {s3} volunteer to follow you."),
(try_end),
(set_background_mesh, "mesh_pic_recruits"),
(try_end),
],
[
("continue_not_enough_gold",
[
(eq, reg7, 1),
],
"I don't have enough money...",
[
(jump_to_menu, "mnu_town"),
]),
("continue",
[
(eq, reg7, 0),
(eq, reg5, 0),
], #noone willing to join
"Continue...",
[
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(jump_to_menu, "mnu_town"),
]),
("recruit_them",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Recruit them ({reg6} denars).",
[
(call_script, "script_town_recruit_nobles_recruit"),
(jump_to_menu, "mnu_town"),
]),
("forget_it",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Forget it.",
[
(jump_to_menu, "mnu_town"),
]),
],
),
"recruit_nobles",0,
"{s18}",
"none",
[(store_faction_of_party, ":cur_faction", "$current_town"),
(faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_5_troop),
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 40),#40 denars per man
(assign, ":party_capacity", ":free_capacity"),
(val_min, ":party_capacity", ":gold_capacity"),
(try_begin),
(gt, ":party_capacity", 0),
(val_min, ":volunteer_amount", ":party_capacity"),
(try_end),
(assign, reg5, ":volunteer_amount"),
(assign, reg7, 0),
(try_begin),
(gt, ":volunteer_amount", ":gold_capacity"),
(assign, reg7, 1), #not enough money
(try_end),
(try_begin),
(eq, ":volunteer_amount", 0),
(str_store_string, s18, "@No one here seems to be willing to join your party."),
(else_try),
(store_mul, reg6, ":volunteer_amount", 40),#40 denars per man
(str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
(try_begin),
(eq, reg5, 1),
(str_store_string, s18, "@One {s3} volunteers to follow you."),
(else_try),
(str_store_string, s18, "@{reg5} {s3} volunteer to follow you."),
(try_end),
(set_background_mesh, "mesh_pic_recruits"),
(try_end),
],
[
("continue_not_enough_gold",
[
(eq, reg7, 1),
],
"I don't have enough money...",
[
(jump_to_menu, "mnu_town"),
]),
("continue",
[
(eq, reg7, 0),
(eq, reg5, 0),
], #noone willing to join
"Continue...",
[
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(jump_to_menu, "mnu_town"),
]),
("recruit_them",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Recruit them ({reg6} denars).",
[
(call_script, "script_town_recruit_nobles_recruit"),
(jump_to_menu, "mnu_town"),
]),
("forget_it",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Forget it.",
[
(jump_to_menu, "mnu_town"),
]),
],
),
place this at the end of module game menus before the last ]
if you have any problems let me know in a post. i will soon be adding how to recruit separate troop trees through castles and towns.
if the tutorial was unclear please tell me so i can improve upon it.
MAKE SURE TO WAIT THREE DAYS IN GAME, MENU WILL NOT SHOW UP OTHERWISE
please post if this helped you.
--------------------------------------------------------------------------------------------------------------------------------
Here is the separate troop trees part of the tutorial
This tutorial allows you to implement a code that lets you recruit troops from both castles and towns, however you can recruit nobles from castles, and regulars from towns.
first off is scripts
you will copy and paste the first script code right below itself, you must rename the script so it may look like this,
#script_cf_town_recruit_volunteers_cond
# INPUT: none
# OUTPUT: none
("cf_town_recruit_volunteers_cond", #renamed
[(store_faction_of_party, ":town_faction", "$current_town"),
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(store_relation, ":town_faction_relation", ":town_faction", "fac_player_faction"),
(ge, ":center_relation", 0),
(this_or_next|ge, ":center_relation", 5),
(this_or_next|eq, ":town_faction", "$players_kingdom"),
(this_or_next|ge, ":town_faction_relation", 0),
(this_or_next|eq, ":town_faction", "$supported_pretender_old_faction"),
( eq, "$players_kingdom", 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(ge, ":free_capacity", 1),
]),
# INPUT: none
# OUTPUT: none
("cf_town_recruit_volunteers_cond", #renamed
[(store_faction_of_party, ":town_faction", "$current_town"),
(party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
(store_relation, ":town_faction_relation", ":town_faction", "fac_player_faction"),
(ge, ":center_relation", 0),
(this_or_next|ge, ":center_relation", 5),
(this_or_next|eq, ":town_faction", "$players_kingdom"),
(this_or_next|ge, ":town_faction_relation", 0),
(this_or_next|eq, ":town_faction", "$supported_pretender_old_faction"),
( eq, "$players_kingdom", 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
(party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(ge, ":free_capacity", 1),
]),
For the next one you have to edit a tiny bit more.
#script_town_recruit_nobles_recruit
# INPUT: none
# OUTPUT: none
("town_recruit_nobles_recruit", #renamed
[(store_faction_of_party, ":cur_faction", "$current_town"),
(faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_1_troop), #changed tier so it wouldnt recruit nobles.
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":volunteer_amount", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 200),#200 denars per man
(val_min, ":volunteer_amount", ":gold_capacity"),
(party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(store_mul, ":cost", ":volunteer_amount", 200),#200 denars per man
(troop_remove_gold, "trp_player", ":cost"),
]),
# INPUT: none
# OUTPUT: none
("town_recruit_nobles_recruit", #renamed
[(store_faction_of_party, ":cur_faction", "$current_town"),
(faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_1_troop), #changed tier so it wouldnt recruit nobles.
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":volunteer_amount", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 200),#200 denars per man
(val_min, ":volunteer_amount", ":gold_capacity"),
(party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(store_mul, ":cost", ":volunteer_amount", 200),#200 denars per man
(troop_remove_gold, "trp_player", ":cost"),
]),
Now for module game menus, we are going to change it so each tree is specifically recruited from castle or town.
("recruit_nobles",[(is_between, "$current_town",
castles_begin, castles_end), (call_script,
"script_cf_town_castle_recruit_volunteers_cond"),]
,"Recruit Nobles.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu, "mnu_recruit_nobles"),
(try_end),
]),
castles_begin, castles_end), (call_script,
"script_cf_town_castle_recruit_volunteers_cond"),]
,"Recruit Nobles.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu, "mnu_recruit_nobles"),
(try_end),
]),
this code will allow for regulars to be recruited from towns.
("recruit_normals",[(is_between, "$current_town",
towns_begin, towns_end), (call_script,
"script_cf_town_recruit_volunteers_cond"),]
,"Recruit Volunteers.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu, "mnu_recruit_normales"),
(try_end),
]),
towns_begin, towns_end), (call_script,
"script_cf_town_recruit_volunteers_cond"),]
,"Recruit Volunteers.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu, "mnu_recruit_normales"),
(try_end),
]),
This code is if you want troops recruited from towns only.
("recruit_normals",[(is_between, "$current_town",
towns_begin, towns_end), (call_script,
"script_cf_town_recruit_volunteers_cond"),] #notice that this part calls on the id given in the first part of the split troop trees tutorial
,"Recruit Volunteers.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu, "mnu_recruit_normales"),
(try_end),
]),
towns_begin, towns_end), (call_script,
"script_cf_town_recruit_volunteers_cond"),] #notice that this part calls on the id given in the first part of the split troop trees tutorial
,"Recruit Volunteers.",
[
(try_begin),
(call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
(jump_to_menu, "mnu_recruit_normales"),
(try_end),
]),
Now for the last game menus.
"recruit_normales",0,
"{s18}",
"none",
[(store_faction_of_party, ":cur_faction", "$current_town"),
(faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_1_troop), #Notice the changed tier
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 40),#40 denars per man
(assign, ":party_capacity", ":free_capacity"),
(val_min, ":party_capacity", ":gold_capacity"),
(try_begin),
(gt, ":party_capacity", 0),
(val_min, ":volunteer_amount", ":party_capacity"),
(try_end),
(assign, reg5, ":volunteer_amount"),
(assign, reg7, 0),
(try_begin),
(gt, ":volunteer_amount", ":gold_capacity"),
(assign, reg7, 1), #not enough money
(try_end),
(try_begin),
(eq, ":volunteer_amount", 0),
(str_store_string, s18, "@No one here seems to be willing to join your party."),
(else_try),
(store_mul, reg6, ":volunteer_amount", 40),#40 denars per man
(str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
(try_begin),
(eq, reg5, 1),
(str_store_string, s18, "@One {s3} volunteers to follow you."),
(else_try),
(str_store_string, s18, "@{reg5} {s3} volunteer to follow you."),
(try_end),
(set_background_mesh, "mesh_pic_recruits"),
(try_end),
],
[
("continue_not_enough_gold",
[
(eq, reg7, 1),
],
"I don't have enough money...",
[
(jump_to_menu, "mnu_town"),
]),
("continue",
[
(eq, reg7, 0),
(eq, reg5, 0),
], #noone willing to join
"Continue...",
[
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(jump_to_menu, "mnu_town"),
]),
("recruit_them",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Recruit them ({reg6} denars).",
[
(call_script, "script_town_recruit_nobles_recruit"),
(jump_to_menu, "mnu_town"),
]),
("forget_it",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Forget it.",
[
(jump_to_menu, "mnu_town"),
]),
],
),
"{s18}",
"none",
[(store_faction_of_party, ":cur_faction", "$current_town"),
(faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_1_troop), #Notice the changed tier
(party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 40),#40 denars per man
(assign, ":party_capacity", ":free_capacity"),
(val_min, ":party_capacity", ":gold_capacity"),
(try_begin),
(gt, ":party_capacity", 0),
(val_min, ":volunteer_amount", ":party_capacity"),
(try_end),
(assign, reg5, ":volunteer_amount"),
(assign, reg7, 0),
(try_begin),
(gt, ":volunteer_amount", ":gold_capacity"),
(assign, reg7, 1), #not enough money
(try_end),
(try_begin),
(eq, ":volunteer_amount", 0),
(str_store_string, s18, "@No one here seems to be willing to join your party."),
(else_try),
(store_mul, reg6, ":volunteer_amount", 40),#40 denars per man
(str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
(try_begin),
(eq, reg5, 1),
(str_store_string, s18, "@One {s3} volunteers to follow you."),
(else_try),
(str_store_string, s18, "@{reg5} {s3} volunteer to follow you."),
(try_end),
(set_background_mesh, "mesh_pic_recruits"),
(try_end),
],
[
("continue_not_enough_gold",
[
(eq, reg7, 1),
],
"I don't have enough money...",
[
(jump_to_menu, "mnu_town"),
]),
("continue",
[
(eq, reg7, 0),
(eq, reg5, 0),
], #noone willing to join
"Continue...",
[
(party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
(jump_to_menu, "mnu_town"),
]),
("recruit_them",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Recruit them ({reg6} denars).",
[
(call_script, "script_town_recruit_nobles_recruit"),
(jump_to_menu, "mnu_town"),
]),
("forget_it",
[
(eq, reg7, 0),
(gt, reg5, 0),
],
"Forget it.",
[
(jump_to_menu, "mnu_town"),
]),
],
),
Remember to wait 3 days, unless you follow ritter's comment.
if you want to recruit different troops from villages as well, then simply change the tier for each script and game menu under villages.
You do not have to change simple triggers.