OP below.
SOLVED!
Here is the working code. Made by Geoffrey Ashe.
Solution by Hokie BT.
This one, below, is pasted at the bottom of the file.
I know this one have been beaten to death already but I need some help.
I looked at the python script exchange thread an found this post by Geoffrey Ashe (link to post)
I searched the forums but I couldn't find anything that could help me.
The problem is that I cant seem to get any troops into the recruit screen. All I see is a clone of my self.
Also I looked at the SoD V4 source, but it looks exactly the same, to me. I thought I could use their but to no avail.
And yes, I've started a new game
So I'm wondering if there is a way to fix this?
Or if anyone knows how to enable the feature already existing in the game but is commented out?
Here is the code I'm using. I've left some of the native code visible in the spoilers.
Just so that you can see where I've put it.
I looked at the python script exchange thread an found this post by Geoffrey Ashe (link to post)
I searched the forums but I couldn't find anything that could help me.
The problem is that I cant seem to get any troops into the recruit screen. All I see is a clone of my self.
Also I looked at the SoD V4 source, but it looks exactly the same, to me. I thought I could use their but to no avail.
And yes, I've started a new game
So I'm wondering if there is a way to fix this?
Or if anyone knows how to enable the feature already existing in the game but is commented out?
Here is the code I'm using. I've left some of the native code visible in the spoilers.
Just so that you can see where I've put it.
SOLVED!
Here is the working code. Made by Geoffrey Ashe.
Solution by Hokie BT.
Code:
##########################################################
# Test : Tavern Recruitment Begin ########################
##########################################################
slot_town_mercs = 66
merc_parties_begin = "p_town_merc_1"
merc_parties_end = "p_castle_1"
#########################################################
# Test : Tavern Recruitment End #########################
#########################################################
Code:
[anyone,"tavernkeeper_deliver_wine_lost", [],
"What? I was waiting for that {s4} for weeks!\
And now you are telling me that you lost it?\
You may rest assured that I will let {s1} know about this.", "tavernkeeper_pretalk",
[(add_xp_as_reward, 40),
(quest_get_slot, ":quest_target_item", "qst_deliver_wine", slot_quest_target_item),
(quest_get_slot, ":quest_giver_troop", "qst_deliver_wine", slot_quest_giver_troop),
(str_store_item_name, s4, ":quest_target_item"),
(str_store_troop_name, s1, ":quest_giver_troop"),
(val_add, "$debt_to_merchants_guild", "$qst_deliver_wine_debt"),
(call_script, "script_end_quest", "qst_deliver_wine"),
]],
#######################################################################################
# Test : Tavern recruitment Begin ###################################################
#######################################################################################
[anyone|plyr,"tavernkeeper_talk", [], "I need to hire some soldiers. Can you help me?", "tavernkeeper_buy_peasants",[]],
[anyone,"tavernkeeper_buy_peasants",
[
(store_encountered_party,reg(3)),
(store_faction_of_party,reg(4),reg(3)),
(store_relation,reg(5),"fac_player_supporters_faction",reg(4)),
(lt, reg(5), -3),
], "I don't think anyone from this town will follow somebody like you. Try your luck elsewhere.", "tavernkeeper_buy_peasants_2",[]],
[anyone,"tavernkeeper_buy_peasants", [], "I know a few fellows who would follow you if you paid for their equipment.", "tavernkeeper_buy_peasants_2",[(store_encountered_party,reg(2)),(party_get_slot,"$tavernkeeper_party",reg(2),slot_town_mercs),(set_mercenary_source_party,"$tavernkeeper_party"),(change_screen_buy_mercenaries)]],
[anyone,"tavernkeeper_buy_peasants_2", [], "Anything else?", "tavernkeeper_talk",[]],
#######################################################################################
# Test : Tavern recruitment end #####################################################
#######################################################################################
# NOTE TO SELF:
# I altered line 8943. The original line looks like this :
# [anyone,"tavernkeeper_buy_peasants", [], "I know a few fellows who would follow you if you paid for their equipment.", "tavernkeeper_buy_peasants_2",[(store_encountered_party,reg(2)),(party_get_slot,"$tavernkeeper_party",reg(2)),slot_town_mercs),(set_mercenary_source_party,"$tavernkeeper_party"),(change_screen_buy_mercenaries)]],
#
# I added the "(" to (slot_town_mercs). Otherwise it gives a syntax.
# I changed it to :
# [anyone,"tavernkeeper_buy_peasants", [], "I know a few fellows who would follow you if you paid for their equipment.", "tavernkeeper_buy_peasants_2",[(store_encountered_party,reg(2)),(party_get_slot,"$tavernkeeper_party",reg(2)),(slot_town_mercs),(set_mercenary_source_party,"$tavernkeeper_party"),(change_screen_buy_mercenaries)]],
###################################################################################
###################################################################################
## [anyone|plyr,"tavernkeeper_talk", [], "I need to hire some soldiers. Can you help me?", "tavernkeeper_buy_peasants",[]],
## [anyone,"tavernkeeper_buy_peasants",
## [
## (store_encountered_party,reg(3)),
## (store_faction_of_party,reg(4),reg(3)),
## (store_relation,reg(5),"fac_player_supporters_faction",reg(4)),
## (lt, reg(5), -3),
## ], "I don't think anyone from this town will follow somebody like you. Try your luck elsewhere.", "tavernkeeper_buy_peasants_2",[]],
Code:
[anyone,"tavernkeeper_buy_drinks_end",
[], "Don't worry {sir/madam}. Your name will be cheered and toasted here all night.", "tavernkeeper_pretalk",
[
(troop_remove_gold, "trp_player", "$temp"),
(call_script, "script_change_player_relation_with_center", "$current_town", 1),
(store_current_hours,":cur_hours"),
(assign, "$buy_drinks_last_time", ":cur_hours"),
]],
#####################################################################################
# Test: Tavern recruitment and Ale Begin ############################################
#####################################################################################
[anyone|plyr,"tavernkeeper_talk", [
(store_current_hours,":cur_hours"),
(val_sub, ":cur_hours", 24),
(gt, ":cur_hours", "$buy_drinks_last_time"),
], "I'd like to buy me and my men a barrel of your best ale.", "tavernkeeper_buy_drinks_troops",[]],
[anyone,"tavernkeeper_buy_drinks_troops",
[
], "Of course, {my lord/my lady}. I reckon {reg5} denars should be enough for that. What should I tell the lads?", "tavernkeeper_buy_drinks_troops_2",[
(assign, "$temp", 20),
(store_party_size_wo_prisoners, reg5, "p_main_party"),
(store_mul, "$temp", "$temp", reg5),
(assign, reg5, "$temp"),
]],
[anyone|plyr,"tavernkeeper_buy_drinks_troops_2",
[
(store_troop_gold, ":gold", "trp_player"),
(ge, ":gold", "$temp"),
(str_store_party_name, s10, "$current_town"),
], "The price is fair enough, let my men have at it.", "tavernkeeper_buy_drinks_troops_end",[
]],
[anyone,"tavernkeeper_buy_drinks_troops_end",
[], "Don't worry {sir/madam}. Your men will enjoy their pints.", "tavernkeeper_pretalk",
[
(troop_remove_gold, "trp_player", "$temp"),
(call_script, "script_change_player_party_morale", 20),
(store_current_hours,":cur_hours"),
(assign, "$buy_drinks_last_time", ":cur_hours"),
(rest_for_hours, 2, 5, 0)
]],
[anyone|plyr,"tavernkeeper_buy_drinks_troops_2", [], "Actually, cancel that order.", "tavernkeeper_pretalk",[]],
#####################################################################################
# Test: Tavern recruitment and Ale End ##############################################
#####################################################################################
[anyone|plyr,"tavernkeeper_talk", [], "I guess I should leave now.", "close_window",[]],
#Tavern Talk (with companions)
# [anyone, "companion_recruit_yes", [(neg|hero_can_join, "p_main_party"),], "I don't think can lead any more men than you do now.\
# You need to release someone from service if you want me to join your party.", "close_window", []],
Code:
# Towns (loop)
(try_for_range, ":town_no", towns_begin, towns_end),
(store_sub, ":offset", ":town_no", towns_begin),
(party_set_slot,":town_no", slot_party_type, spt_town),
# (store_add, ":cur_object_no", "trp_town_1_seneschal", ":offset"),
# (party_set_slot,":town_no", slot_town_seneschal, ":cur_object_no"),
#####################################################################
# Test : Tavern recruitment Begin #################################
#####################################################################
(store_add, ":cur_object_no", "p_town_merc_1", ":offset"),
(party_set_slot,":town_no", slot_town_mercs,":cur_object_no"),
#####################################################################
# Test : Tavern recruitment End ###################################
#####################################################################
(store_add, ":cur_object_no", "scn_town_1_center", ":offset"),
(party_set_slot,":town_no", slot_town_center, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_castle", ":offset"),
(party_set_slot,":town_no", slot_town_castle, ":cur_object_no"),
(store_add, ":cur_object_no", "scn_town_1_prison", ":offset"),
(party_set_slot,":town_no", slot_town_prison, ":cur_object_no"),
Code:
(store_add, ":cur_slot", slot_troop_enemies_begin, ":troop_enemy_count"),
(troop_set_slot, ":troop_id", ":cur_slot", ":result"),
(store_add, ":cur_slot", slot_troop_enemies_begin, ":enemy_troop_enemy_count"),
(troop_set_slot, ":result", ":cur_slot", ":troop_id"),
(try_end),
(try_end),
(try_for_range, ":unused", 0, 8),
(call_script, "script_spawn_bandits"),
(try_end),
###################################################################################
# Test : Tavern Recruitment Begin ###############################################
###################################################################################
(call_script, "script_add_tavern_troops"),
###################################################################################
# Test : Tavern Recruitment End #################################################
###################################################################################
(set_spawn_radius, 50),
(try_for_range, ":unused", 0, 25),
(spawn_around_party,"p_main_party","pt_looters"),
(try_end),
(try_for_range, ":unused", 0, 6),
(call_script, "script_update_trade_good_prices"),
(try_end),
This one, below, is pasted at the bottom of the file.
Code:
##################################################
# Test: Tavern Recruitment Begin ###############
##################################################
#no input/output
#could need a faction check
#that's from the 808 module system
("add_tavern_troops",
[
(try_for_range,reg(2),merc_parties_begin,merc_parties_end),
(store_party_size,reg(6),reg(2)),
(lt,reg(6),30), #never have many more than 30 troops in the tavern
(store_random,reg(7),8),
(party_add_members,reg(2),"trp_townsman",reg(7)),
(store_random,reg(8),5),
(party_add_members,reg(2),"trp_sea_raider",reg(8)),
(store_random,reg(9),5),
(party_add_members,reg(2),"trp_manhunter",reg(9)),
(try_end),
]),
##################################################
# Test: Tavern Recruitment Begin ###############
##################################################
Code:
# ("village_reinforcements","village_reinforcements",pf_is_static|pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(1,1),[]),
#######################################################################################
# Test : Tavern recruitment Begin ###################################################
#######################################################################################
("town_merc_1","sargoth_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_2","tihr_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_3","veluca_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_4","suno_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_5","jelkala_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_6","praven_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_7","uxkhal_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_8","reyvadin_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_9","khudan_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_10","tulga_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_11","curaw_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_12","wercheg_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_13","rivacheg_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_14","halmar_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_15","yalen_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_16","dhirim_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_17","ichamur_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
("town_merc_18","narra_mercs",pf_disabled, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(0,0),[]),
#######################################################################################
# Test : Tavern recruitment End ###################################################
#######################################################################################
("zendar","Zendar",pf_disabled|icon_town|pf_is_static|pf_always_visible|pf_hide_defenders, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(18,60),[]),
Code:
#NPC system changes begin
#Move unemployed NPCs around taverns
(24 * 15, 0, 0,
[
(call_script, "script_update_companion_candidates_in_taverns"),
],
[]
),
#######################################################################################
# Test : Tavern recruitment Begin ###################################################
#######################################################################################
(24.0, 0, 0.0, [],
[
(call_script, "script_add_tavern_troops"),
],
),
#######################################################################################
# Test : Tavern recruitment End #####################################################
#######################################################################################
#Process morale and determine personality clashes
(0, 0, 24,
[],
[