- so, in module_constants
--------------------------
look for the below slots and then add your new constant:
slot_center_npc_volunteer_troop_type = 90
slot_center_npc_volunteer_troop_amount = 91
slot_center_mercenary_troop_type = 90
slot_center_mercenary_troop_amount= 91
slot_center_volunteer_troop_type = 92
slot_center_volunteer_troop_amount= 93
slot_center_volunteer_orc_type = 95 ## this is your new constant
- module_scripts in game_start
----------------------------------
(faction_set_slot, "fac_culture_1", slot_faction_tier_1_troop, "trp_swadian_recruit"),
(faction_set_slot "fac_culture_1", slot_faction_tier_1b_troop, "trp_orc_recruit"), ## repeat this for all the other cultures too -- you only need one tier 1 troop as from thereon you follow the upgrade path of the particular orc unit, i.e. you don't need a factionized orc tier_2, tier_3, etc.
(faction_set_slot, "fac_culture_1", slot_faction_tier_2_troop, "trp_swadian_militia"),
(faction_set_slot, "fac_culture_1", slot_faction_tier_3_troop, "trp_swadian_footman"),
(faction_set_slot, "fac_culture_1", slot_faction_tier_4_troop, "trp_swadian_infantry"),
(faction_set_slot, "fac_culture_1", slot_faction_tier_5_troop, "trp_swadian_knight"),
- module_scripts in initialize_faction_troop_types
---------------------------------------------------
(faction_get_slot, ":troop", ":culture", slot_faction_tier_1_troop),
(faction_set_slot, ":faction_no", slot_faction_tier_1_troop, ":troop"),
(faction_get_slot, ":troop", ":culture", slot_faction_tier_1b_troop), ## your new tier_1 orc unit
(faction_set_slot, ":faction_no", slot_faction_tier_1b_troop, ":troop"), ## your new tier_1 orc unit
(faction_get_slot, ":troop", ":culture", slot_faction_tier_2_troop),
(faction_set_slot, ":faction_no", slot_faction_tier_2_troop, ":troop"),
(faction_get_slot, ":troop", ":culture", slot_faction_tier_3_troop),
(faction_set_slot, ":faction_no", slot_faction_tier_3_troop, ":troop"),
(faction_get_slot, ":troop", ":culture", slot_faction_tier_4_troop),
(faction_set_slot, ":faction_no", slot_faction_tier_4_troop, ":troop"),
(faction_get_slot, ":troop", ":culture", slot_faction_tier_5_troop),
(faction_set_slot, ":faction_no", slot_faction_tier_5_troop, ":troop"),
- these are the 2 marginally modified original scripts, in module_scripts
--------------------------------------------------------------------------
#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),
## new stuff begin
(store_random_in_range, ":random_unit", 0, 10), ## 0-9; random choice, if lower than 5 you get humans, if equal or higher than 5 you get orcs
(try_begin),
(lt,":random_unit", 5),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
(party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
(else_try),
(ge,":random_unit", 5),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1b_troop), ## this is your new orc unit
(party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
(try_end),
(party_set_slot, ":center_no", slot_center_volunteer_orc_type, ":random_unit"), ## this is further needed for the script update_npc_volunteer_troops_in_village
## new stuff end
## ALTERNATIVE new stuff begin -- if you only want to use one and the same orc unit for all factions without declaring a new tier_1b unit (you then have to leave out the changes to initialize_faction_troop_types and game_start in module_scripts)
(assign, ":volunteer_troop", 0),
(store_random_in_range, ":random_unit", 0, 10), ## 0-9; random choice, if lower than 5 you get humans, if equal or higher than 5 you get orcs
(try_begin),
(lt,":random_unit", 5),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
(party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
(else_try),
(ge,":random_unit", 5),
(assign, ":volunteer_troop", "trp_orc_recruit"), ## this is your new orc unit
(party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
(try_end),
(party_set_slot, ":center_no", slot_center_volunteer_orc_type, ":random_unit"), ## this is further needed for the script update_npc_volunteer_troops_in_village
## ALTERNATIVE new stuff 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), ## make sure that your orc unit has an upgrade path to higher tier orc units, else you will only receive tier1 orc units
(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", 12),
(try_begin),
(ge, ":player_relation", 12),
(assign, ":upper_limit", ":player_relation"),
(val_div, ":upper_limit", 2),
(val_add, ":upper_limit", 6),
(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"), ## this line was missing in your original script
(party_set_slot, ":center_no", slot_center_volunteer_troop_amount, ":amount"),
]),
#script_update_npc_volunteer_troops_in_village
# INPUT: arg1 = center_no
# OUTPUT: none
("update_npc_volunteer_troops_in_village",
[
(store_script_param, ":center_no", 1),
(party_get_slot, ":center_culture", ":center_no", slot_center_culture),
## new stuff begin
(party_get_slot, "
rc_yes_or_no", ":center_no", slot_center_volunteer_orc_type),
(try_begin),
(lt, "
rc_yes_or_no", 5),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
(else_try),
(ge, "
rc_yes_or_no", 5),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1b_troop),
(try_end),
## new stuff end
## ALTERNATIVE new stuff begin -- only one orc unit for all factions without declaring a new tier_1b unit (you then have to leave out the changes to initialize_faction_troop_types and game_start in module_scripts)
(assign, ":volunteer_troop", 0),
(party_get_slot, "
rc_yes_or_no", ":center_no", slot_center_volunteer_orc_type),
(try_begin),
(lt, "
rc_yes_or_no", 5),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
(else_try),
(ge, "
rc_yes_or_no", 5),
(assign, ":volunteer_troop", "trp_orc_recruit"),
(try_end),
## ALTERNATIVE new stuff end
(assign, ":volunteer_troop_tier", 1),
(try_for_range, ":unused", 0, 5),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 10),
(store_random_in_range, ":random_no", 0, 2), ## make sure that your orc unit has an upgrade path to higher tier orc units, else you will only receive tier1 orc units
(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", 12),
(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_npc_volunteer_troop_type, ":volunteer_troop"),
(party_set_slot, ":center_no", slot_center_npc_volunteer_troop_amount, ":amount"),
]),