# Cultures:
(faction_set_slot, "fac_culture_3", slot_faction_tier_1_troop, "trp_gary"),
(faction_set_slot, "fac_culture_3", slot_faction_tier_2_troop, "trp_khergit_skirmisher"),
(faction_set_slot, "fac_culture_3", slot_faction_tier_3_troop, "trp_khergit_horseman"),
(faction_set_slot, "fac_culture_3", slot_faction_tier_4_troop, "trp_khergit_horse_archer"),
(faction_set_slot, "fac_culture_3", slot_faction_tier_5_troop, "trp_khergit_veteran_horse_archer"),
# Cultures:
(faction_set_slot, "fac_culture_5", slot_faction_tier_1_troop, "trp_rhodok_tribesman"),
(faction_set_slot, "fac_culture_5", slot_faction_tier_2_troop, "trp_rhodok_spearman"),
(faction_set_slot, "fac_culture_5", slot_faction_tier_3_troop, "trp_rhodok_trained_spearman"),
(faction_set_slot, "fac_culture_5", slot_faction_tier_4_troop, "trp_rhodok_veteran_spearman"),
(faction_set_slot, "fac_culture_5", slot_faction_tier_5_troop, "trp_rhodok_sergeant"),
(faction_set_slot, "fac_culture_5", slot_faction_tier_6_troop, "trp_your_troop/hero"),
#script_village_recruit_volunteers_recruit
# INPUT: none
# OUTPUT: none
("village_recruit_volunteers_recruit",
[(try_begin),
(eq,slot_center_original_faction,"fac_culture_(number_of_faction_with_sixth_troop),
(assign,":volunteer_troop","6),
(try_end),
(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
(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"),
(try_begin),
(eq,":volunteer_troop",6),
(assign,":volunteer_troop",1),
(try_end),
(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"),
]),
jik said:Interesting.
I was about to post a question on the culture stuff. So I take it that this is the reason? The troops they can hire?
AngusH said:OK, so that would make every troop (of tier 1) hired a hero. Thanks very much!
But what if, say, you wanted to have the option to recruit troops normally, but have also have the ability to recruit a 'companion' (ie. custom hero) from each village? I know it would be a matter of creating the menu option and then assigning the code to "add" the npc, I'm just not sure how exactly to add an npc with code.
jik said:you can do a random availability check, then test if there are any "free" at the moment. Not sure what would mark them as free, though I think only the player can hire them. The rest are lords.
jik said:It's not much for some. Others would have no idea.
killkhergit said:To let the code check if one's available: (no need to change if you're going to add one to all factions)...
Code:#script_village_recruit_volunteers_recruit # INPUT: none # OUTPUT: none ("village_recruit_volunteers_recruit", [(try_begin), (eq,slot_center_original_faction,"fac_culture_(number_of_faction_with_sixth_troop), (assign,":volunteer_troop","6), (try_end), (party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type), (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"), (try_begin), (eq,":volunteer_troop",6), (assign,":volunteer_troop",1), (try_end), (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"), ]),
3. Should work, but if it doesn't, tell me.
(faction_set_slot, "fac_culture_5", slot_faction_tier_6_troop, "trp_wa_recruit"),
MartinF said:you'll also need to define the slot in module_constants. If the compiler is throwing up an error it's because it can't find it there. So the slot nr isn't defined making the slot_etc mean nothing.
I've been watching this thread but I can't help but wonder if changing the faction 1 troop in this way won't affect other things as well, like recruitment for hero parties for instance.
Also, the quest qst_raise_troops seems to do something with tier one troops, but that didn't make much sense to me.
What I meant was recruitment.
Just had a look through the script. #script_spawn_bandits uses the faction 1 troop for spawning deserters.
Anyway apart from your deserter parties getting messed up, it seems you're pretty safe to use that method, although I think it lacks elegance. The second one is much better.
jik said:killkhergit, I think you are missing the point.
If you change a tier_1 troop to be a hero, then when a lord goes to raise his own troops what happens then? Heroes need to be unique. This may cause them to recruit a number of that hero. Same goes with bandits/deserters/etc. If you change their tier 1 troop type, then it could affect how there are spawned. If you change one of the native tier trees, expect it to affect where ever these tier trees are used.
We have an agreement!Anyway apart from your deserter parties getting messed up, it seems you're pretty safe to use that method, although I think it lacks elegance. The second one is much better.