Pr123
Regular
Hello!
I am trying to modify the script script_village_recruit_volunteers_recruit so that the recruits you get from a village would depend on the faction you are in. So far the only modification that I made and works like I want it to is this:
If you are not in a faction you will get mercenary troops from the village(farmers upgrade to mercenaries) and if you are in one you will get troops depending on the centers volunteer troop type(you get nord recruits from nord lands). But if I try this:
It doesn't work like I want it to. What I get is that if you are not in any faction, you get the troops correctly, the mercenary ones, but if you join a faction you still get troops depending on centers volunteer troop type. I realise that it just skips the else_try-s because the equatation (eq,"$players_kingdom","$kingdom_1"),(or kingdom_2 etc.) is not true. What I do not know, is what else do I have to write in that equatation?
Thanks.
I am trying to modify the script script_village_recruit_volunteers_recruit so that the recruits you get from a village would depend on the faction you are in. So far the only modification that I made and works like I want it to is this:
Code:
#script_village_recruit_volunteers_recruit
# INPUT: none
# OUTPUT: none
("village_recruit_volunteers_recruit",
[(try_begin),
(eq,"$players_kingdom",0),
(assign,":volunteer_troop", "trp_farmer"),
(else_try),
(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
(try_end),
(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"),
]),
If you are not in a faction you will get mercenary troops from the village(farmers upgrade to mercenaries) and if you are in one you will get troops depending on the centers volunteer troop type(you get nord recruits from nord lands). But if I try this:
Code:
("village_recruit_volunteers_recruit",
[(try_begin),
(eq,"$players_kingdom",0),
(assign,":volunteer_troop", "trp_farmer"),
(else_try),
(eq,"$players_kingdom","$kingdom_1"),
(assign,":volunteer_troop", "trp_swadian_recruit"),
(else_try),
(eq,"$players_kingdom","$kingdom_2"),
(assign,":volunteer_troop", "trp_vaegir_recruit"),
(else_try),
(eq,"$players_kingdom","$kingdom_3"),
(assign,":volunteer_troop", "trp_khergit_tribesman"),
(else_try),
(eq,"$players_kingdom","$kingdom_4"),
(assign,":volunteer_troop", "trp_nord_recruit"),
(else_try),
(eq,"$players_kingdom","$kingdom_5"),
(assign,":volunteer_troop", "trp_rhodok_tribesman"),
(else_try),
(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
(try_end),
(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"),
]),
It doesn't work like I want it to. What I get is that if you are not in any faction, you get the troops correctly, the mercenary ones, but if you join a faction you still get troops depending on centers volunteer troop type. I realise that it just skips the else_try-s because the equatation (eq,"$players_kingdom","$kingdom_1"),(or kingdom_2 etc.) is not true. What I do not know, is what else do I have to write in that equatation?
Thanks.