MartinF
Squire
Hi guys,
as some of you have probably already seen I've been working on a kit for duelling based on an idea by Phosphoer in this thread. I've since been adding on bits and pieces until it has come to the stage where I think it's ready to be a standalone kit that you can implement into your own mod if you want to. So I'm hereby releasing version 0.5
Feel free to use this for whatever you want, but a credit would be nice. And please let me know so I can try it out
Credits and thanks
Features
They way it works is very straightforward. You start a conversation with a (neutral or friendly) lord or king and say "I want to ask you something". It will then come up with the option to challenge them to a friendly duel. They'll either accept or decline based on your renown.
If they accept, they'll ask you a series of questions which determine whether you'll fight mounted or unmounted and which weapons you'll use.
For your own party members, go to the party screen, select a unit and press 'Talk'. Then for your normal units the option will show up straight away, for companions again you click "I want to ask you something".
Note: After the dialog closes, it will put you back into the party screen or the scene you were in when you addressed the NPC. Press <Tab> to exit the scene and go to the duel menu, or press close in the party screen.
So now to implementing it. No original code needs to be changed, you're just adding stuff. You'll need to edit the following files:
module_constants.py
I use slots which have to be added to the constants file, as well as two constants for setting the minimum renown needed to duel lords and kings. Where you put them doesn't really matter. For consistancy I put the slot_troop pieces with the other troop slots and the constants all the way at the end of the file.
Note, if you've already added extra slots, you might want to change the numbers. These are the first 'empty' slots for troop.
module_dialog.py
This is where most of the jazz happens. There are different dialog bits for the four different types (troops, companions, lords and kings). The dialog also sets up the fight. All this is explained in the comments in the code itself.
Where you place it is not hugely important, but I would suggest just above the line "### COMPANIONS" as that works well for me
[edit] changed the first king dialog option to fix a bug, see post by Hokie[/edit]
module_game_menus.py
This is the start and end of the each duel. This is where you see how many duels you've fought/won/lost against this troop.
Search for "simple_encounter" and put the right above that one.
module_mission_templates.py
This is where the actual duel options are defined. I've used several different 'visitors' with different equipment. By assigning the player and his opponent to the different visitor numbers, they get different equipment. If you want to change the items you duel with, do it here. Of course you might have to change the dialog to reflect these changes. I've commented so you can see which one is which option.
Again, doesn't really matter where you put it, I've got it plugged in just under the "arena_challenge_fight" tuple.
If you've done all thise like I told you, it should work. Build and play, my friends!
Some observations:
Duelling on horseback is somewhat lame, the AI seems to mostly just run around in circles, for future versions I'll have to look at that, maybe include the jousting thing from janus' arena expansion. Problem with that is that I would have to include scenes and it wouldn't really be a 'kit' anymore but a proper mod.
Kings are evil
Some Lords are more equal than others.. I guess this should already be obvious in the game and from looking at the troops.py but it's VERY obvious when one is bashing your head in with dramatic fervor.
It's all quite a lot of fun.
Future features and fixes
If you have any problems or questions please let me know. Any bugs also. I've tested it quite extensively but you never know what can pop up.
Have fun!
as some of you have probably already seen I've been working on a kit for duelling based on an idea by Phosphoer in this thread. I've since been adding on bits and pieces until it has come to the stage where I think it's ready to be a standalone kit that you can implement into your own mod if you want to. So I'm hereby releasing version 0.5
Feel free to use this for whatever you want, but a credit would be nice. And please let me know so I can try it out
Credits and thanks
- Phosphoer - original idea and original code
- Jinnai - help with the coding and explanation of slots.
- HokieBT - Screenies and bugfix
Features
- Practice duelling with your own troops, from recruits to knights
- Duel your companions. Firentis *****ing about Katrin again? Beat the **** out of him!
- As your renown increases, duel lord and eventually even kings!
- Duel mounted or on foot using a range of weapons options: your own weapons, sword and shield, 2-handed weapons or ranged weapons.
- The kit keeps track of how many times you fight a certain npc and whether you win or lose. The dialog changes accordingly.
- Duels take place in arenas
They way it works is very straightforward. You start a conversation with a (neutral or friendly) lord or king and say "I want to ask you something". It will then come up with the option to challenge them to a friendly duel. They'll either accept or decline based on your renown.
If they accept, they'll ask you a series of questions which determine whether you'll fight mounted or unmounted and which weapons you'll use.
For your own party members, go to the party screen, select a unit and press 'Talk'. Then for your normal units the option will show up straight away, for companions again you click "I want to ask you something".
Note: After the dialog closes, it will put you back into the party screen or the scene you were in when you addressed the NPC. Press <Tab> to exit the scene and go to the duel menu, or press close in the party screen.
So now to implementing it. No original code needs to be changed, you're just adding stuff. You'll need to edit the following files:
- module_constants.py - 2 places
- module_dialogs.py - 1 place
- module_game_menus.py - 1 place
- module_mission_templates.py - 1 place
module_constants.py
I use slots which have to be added to the constants file, as well as two constants for setting the minimum renown needed to duel lords and kings. Where you put them doesn't really matter. For consistancy I put the slot_troop pieces with the other troop slots and the constants all the way at the end of the file.
Note, if you've already added extra slots, you might want to change the numbers. These are the first 'empty' slots for troop.
Code:
# Duel Mod Troop Slots
slot_troop_duel_won = 142 #duel mod - how many duels player won against this troop
slot_troop_duel_lost = 143 #duel mod - how many duels player lost against this troop
slot_troop_duel_started = 144 #duel mod - if player started dueling with this troop
# Duel mod constants
king_renown_for_duel = 150 # Minimum renown needed to challenge a king to a friendly duel
lord_renown_for_duel = 50 # Minimum renown needed to challenge a king to a friendly duel
module_dialog.py
This is where most of the jazz happens. There are different dialog bits for the four different types (troops, companions, lords and kings). The dialog also sets up the fight. All this is explained in the comments in the code itself.
Where you place it is not hugely important, but I would suggest just above the line "### COMPANIONS" as that works well for me
[edit] changed the first king dialog option to fix a bug, see post by Hokie[/edit]
Code:
################################################ # Duel Mod Start ################################################
# dialog for companions
[anyone|plyr,"member_question_2", [], "I would like to challenge you to a friendly duel.", "duel_accept",[]],
# dialog to challenge regular troops in player party
[anyone|plyr,"regular_member_talk", [], "Let's have a practice duel.", "duel_accept",[]],
# dialog for kings. Renown requirements can be set in the module_constants file.
[anyone|plyr,"lord_talk_ask_something_2",[
(is_between, "$g_talk_troop", kings_begin, kings_end),
(assign, reg(25), 1),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(ge, ":player_renown", king_renown_for_duel),
], "My lord, I would like to challenge you to a friendly duel.", "lord_question_duel",[]],
[anyone|plyr,"lord_talk_ask_something_2",[
(is_between, "$g_talk_troop", kings_begin, kings_end),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(lt, ":player_renown", king_renown_for_duel),
], "My lord, I would like to challenge you to a friendly duel.", "king_decline_duel",[]],
[anyone, "king_decline_duel", [], "It would hardly be fitting for a king to duel a mere soldier like yourself. Perhaps after you have distinguished yourself we can duel on friendly terms.", "lord_talk_ask_something_2",[]],
# dialog for lords. Renown requirements can be set in the module_constants file.
[anyone|plyr,"lord_talk_ask_something_2",[
(is_between, "$g_talk_troop", kingdom_heroes_begin, kingdom_heroes_end),
(neq, reg(25), 1), #make sure lord is not a king
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(ge, ":player_renown", lord_renown_for_duel),
], "I would like to challenge you to a friendly duel.", "lord_question_duel",[]],
[anyone|plyr,"lord_talk_ask_something_2",[
(is_between, "$g_talk_troop", kingdom_heroes_begin, kingdom_heroes_end),
(neq, reg(25), 1),
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(lt, ":player_renown", lord_renown_for_duel),
], "I would like to challenge you to a friendly duel.", "lord_decline_duel",[]],
[anyone,"lord_decline_duel", [], "It would hardly be fitting for a lord to duel a mere soldier like yourself. Perhaps after you have distinguished yourself we can duel on friendly terms.", "lord_talk_ask_something_2",[]],
# next are the replies to the duel request by the lord, based on how many duels player won/lost against him.
[anyone, "lord_question_duel", [
(troop_get_slot, ":duel_wins", "$g_talk_troop", slot_troop_duel_won),
(troop_get_slot, ":duel_losses", "$g_talk_troop", slot_troop_duel_lost),
(troop_get_slot, ":duel_started", "$g_talk_troop", slot_troop_duel_started),
(try_begin),
(eq, ":duel_started", 0),
(str_store_string, s1, "@A duel, that sounds like an interesting idea. We could keep score and see who is the better fighter!"),
(troop_set_slot, "$g_talk_troop", slot_troop_duel_started, 1),
(else_try),
(gt, ":duel_losses", ":duel_wins"),
(str_store_string, s1, "@Ah, so you wish to be beaten by me again, eh? I shall teach you another lesson in the art of dueling"),
(else_try),
(gt, ":duel_wins", ":duel_losses"),
(str_store_string, s1, "@You may have won more of our duels than I, but that will change today!"),
(else_try),
(eq, ":duel_losses", ":duel_wins"),
(str_store_string, s1, "@We seem to be evenly match so another duel should prove to be interesting."),
(else_try),
(str_store_string, s1, "@You should not be seeing this text."),
(try_end),
], "{s1}", "duel_accept",[]],
# show different dialog options based on if you're challenging a mounted or unmounted unit.
# note that there's no check if you are mounted yourself, so if you have no horse and challenge someone to a mounted duel, you won't get a horse.
# the visitor numbers correlate with templates in the mission template. So which weapons to use and which items to override. Visitor nr 0 is template 1.
[anyone,"duel_accept", [
(assign, "$g_duel_result", 0),
(assign, "$g_duel_vis_point_plyr", 0), #this is the visitor nr for the player
(assign, "$g_duel_vis_point_opp", 0), #this is the visitor nr for the opponent
(assign, "$talk_troop_mounted",0),
(str_clear, s3),
(try_begin),
(this_or_next|troop_is_mounted, "$g_talk_troop"),
(troop_is_guarantee_horse, "$g_talk_troop"),
(str_store_string, s3, "@I accept your challenge.^Do you wish to fight on horseback or on foot?"),
(else_try),
(str_store_string, s3, "@I accept your challenge. ^Let us choose our weapons."),
(try_end),
],
"{s3}", "duel_choose_mount", []],
[anyone|plyr,"duel_choose_mount", [
(this_or_next|troop_is_mounted, "$g_talk_troop"),
(troop_is_guarantee_horse, "$g_talk_troop"),
(assign, "$talk_troop_mounted",1),
],
"I would like to duel mounted", "duel_weap_mounted", [(str_clear, s4), (str_store_string, s4, "@horseback"),]],
[anyone|plyr,"duel_choose_mount", [
(this_or_next|troop_is_mounted, "$g_talk_troop"),
(troop_is_guarantee_horse, "$g_talk_troop"),
],
"I would like to duel on foot", "duel_weap_choose", [(str_clear, s4), (str_store_string, s4, "@foot"),]],
[anyone|plyr,"duel_choose_mount", [
(neq, "$talk_troop_mounted", 1),
],
"Very well.", "duel_weap_choose", [(str_clear, s4), (str_store_string, s4, "@foot"),]],
[anyone|plyr,"duel_choose_mount", [],
"Forget about it.", "close_window", []],
#options for the mounted fights
[anyone, "duel_weap_mounted", [], "What kind of weapons would you like to fight with?", "duel_weap_mounted", []],
[anyone|plyr,"duel_weap_mounted", [],
"We should use our own weapons.", "duel_start", [(str_clear, s5), (str_store_string, s5, "@our own weapons"),(
assign, "$g_duel_vis_point_plyr", 0), (assign, "$g_duel_vis_point_opp", 1),]],
[anyone|plyr,"duel_weap_mounted", [],
"Let us fight with sword and shield.", "duel_start", [(str_clear, s5), (str_store_string, s5, "@sword and shield"),
(assign, "$g_duel_vis_point_plyr", 4), (assign, "$g_duel_vis_point_opp", 5),]],
[anyone|plyr,"duel_weap_mounted", [],
"We should fight with two-handed weapons.", "duel_start", [(str_clear, s5), (str_store_string, s5, "@two handed weapons"),
(assign, "$g_duel_vis_point_plyr", 8), (assign, "$g_duel_vis_point_opp", 9),]],
[anyone|plyr,"duel_weap_mounted", [],
"A duel with light armor and ranged weapons would be my choice.", "duel_start", [(str_clear, s5), (str_store_string, s5, "@light armor and ranged weapons"),
(assign, "$g_duel_vis_point_plyr", 12), (assign, "$g_duel_vis_point_opp", 13),]],
[anyone|plyr,"duel_weap_mounted", [],
"What was your previous question again?.", "duel_accept", []],
#options for the unmounted fights
[anyone, "duel_weap_choose", [], "What kind of weapons would you like to fight with?", "duel_weap_choose", []],
[anyone|plyr,"duel_weap_choose", [],
"We should use our own weapons.", "duel_start", [(str_clear, s5), (str_store_string, s5, "@our own weapons"),
(assign, "$g_duel_vis_point_plyr", 2), (assign, "$g_duel_vis_point_opp", 3),]],
[anyone|plyr,"duel_weap_choose", [],
"Let us fight with sword and shield.", "duel_start", [(str_clear, s5), (str_store_string, s5, "@sword and shield"),
(assign, "$g_duel_vis_point_plyr", 6), (assign, "$g_duel_vis_point_opp", 7),]],
[anyone|plyr,"duel_weap_choose", [],
"We should fight with two-handed weapons.", "duel_start", [(str_clear, s5), (str_store_string, s5, "@two handed weapons"),
(assign, "$g_duel_vis_point_plyr", 10), (assign, "$g_duel_vis_point_opp", 11),]],
[anyone|plyr,"duel_weap_choose", [],
"A duel with light armor and ranged weapons would be my choice.", "duel_start", [(str_clear, s5), (str_store_string, s5, "@light armor and ranged weapons"),
(assign, "$g_duel_vis_point_plyr", 14), (assign, "$g_duel_vis_point_opp", 15),]],
[anyone|plyr,"duel_weap_choose", [],
"What was your previous question again?.", "duel_accept", []],
#final dialog
[anyone, "duel_start", [], "Very well {playername}. ^^We will be duelling on {s4}, using {s5}.^^If this is all right, I will meet you down at the arena as soon as you finish preparing.", "duel_start", []],
[anyone|plyr, "duel_start", [], "That sound great. I'll meet you down there.", "close_window", [(assign, reg(0), "$g_talk_troop"),(jump_to_menu, "mnu_duel_menu"),]],
[anyone|plyr, "duel_start", [], "No, you've got it all wrong, let's try again.", "duel_accept", []],
################################################ # Duel Mod End ################################################
module_game_menus.py
This is the start and end of the each duel. This is where you see how many duels you've fought/won/lost against this troop.
Search for "simple_encounter" and put the right above that one.
Code:
############################### Duel Mod Start ##############################
("duel_menu",0,
"{s1}{s2}",
"none",
[
(str_clear, s2), (str_clear, s3), (str_clear, s5), (str_clear, s6), (str_clear, s7),
(troop_get_slot, ":duel_wins", "$g_talk_troop", slot_troop_duel_won),
(assign, reg(6), ":duel_wins"),
(troop_get_slot, ":duel_losses", "$g_talk_troop", slot_troop_duel_lost),
(assign, reg(7), ":duel_losses"),
(store_add, ":duel_total", ":duel_wins", ":duel_losses"),
(assign, reg(5), ":duel_total"),
(str_store_troop_name, s3, "$g_talk_troop"),
(try_begin),
(eq, "$g_duel_result", -1),
(str_store_string, s1, "@You lost your duel against ^^{s3}"),
(else_try),
(eq, "$g_duel_result", 1),
(str_store_string, s1, "@You won your duel against ^^{s3}"),
(else_try),
(str_store_string, s1, "@You prepare to duel ^^{s3}"),
(try_end),
(try_begin),
(troop_is_hero, "$g_talk_troop"),
(str_store_string, s2, "@^^^^You have fought {s3} {reg5} times. ^^You've won {reg6} times. ^^You've lost {reg7} times"),
(else_try),
(str_store_string, s2, "@^^^^Dueling with your own troops will not count towards your dueling statistics."),
(try_end),
],
[
("start_fight",[(eq, "$g_duel_result", 0)],"Start the duel.",
[(try_begin),
(is_between, "$g_encountered_party", towns_begin, towns_end),
(party_get_slot, ":arena_scene", "$g_encountered_party", slot_town_arena),
(else_try),
(assign, ":closest_dist", 100000),
(assign, ":closest_town", -1),
(try_for_range, ":cur_town", towns_begin, towns_end),
(store_distance_to_party_from_party, ":dist", ":cur_town", "p_main_party"),
(lt, ":dist", ":closest_dist"),
(assign, ":closest_dist", ":dist"),
(assign, ":closest_town", ":cur_town"),
(try_end),
(party_get_slot, ":arena_scene", ":closest_town", slot_town_arena),
(try_end),
(modify_visitors_at_site, ":arena_scene"),
(reset_visitors),
(set_visitor, "$g_duel_vis_point_opp", "$g_talk_troop"),
(set_visitor, "$g_duel_vis_point_plyr", "trp_player"),
(set_jump_mission, "mt_arena_duel_thing_std"),
(jump_to_scene, ":arena_scene"),
(change_screen_mission),
]
),
("duel_again",[(neq, "$g_duel_result", 0)],"Duel again.",
[
(assign, "$g_duel_result", 0),
(jump_to_menu, "mnu_duel_menu"),
]
),
("leave",[],"Leave.",
[(change_screen_map),
]
),
]
),
############################### Duel Mod End ##############################
module_mission_templates.py
This is where the actual duel options are defined. I've used several different 'visitors' with different equipment. By assigning the player and his opponent to the different visitor numbers, they get different equipment. If you want to change the items you duel with, do it here. Of course you might have to change the dialog to reflect these changes. I've commented so you can see which one is which option.
Again, doesn't really matter where you put it, I've got it plugged in just under the "arena_challenge_fight" tuple.
Code:
############################## # Duel Mod Start ##############################
# Below are 8 sets of 2 templates. These are selected by the choices in the dialog. You can change the weapons by adding/removing to the itm_ list
# Entry points are the same for all mounted options and also for all unmounted since only 2 players spawn at a time.
# Duel scores are only kept for duels against heroes (companions, lords and kings).
(
"arena_duel_thing_std",mtf_arena_fight,-1,
"The duel begins!",
[
# visitors 0 and 1 are completely standard
(0, mtef_visitor_source|mtef_team_0, 0, aif_start_alarmed, 1, []),
(8, mtef_visitor_source|mtef_team_2, 0, aif_start_alarmed, 1, []),
#visitors 2 and 3 are override horse only
(56, mtef_visitor_source|mtef_team_0, af_override_horse, aif_start_alarmed, 1, []),
(58, mtef_visitor_source|mtef_team_2, af_override_horse, aif_start_alarmed, 1, []),
#vistiors 4 and 5 are sword/shield standard
(0, mtef_visitor_source|mtef_team_0, af_override_weapons, aif_start_alarmed, 1, [itm_sword_viking_2, itm_tab_shield_heater_c]),
(8, mtef_visitor_source|mtef_team_2,af_override_weapons, aif_start_alarmed, 1, [itm_sword_viking_2, itm_tab_shield_heater_c]),
#visitors 6 and 7 are sword/shield no horse
(56, mtef_visitor_source|mtef_team_0, af_override_weapons|af_override_horse, aif_start_alarmed, 1, [itm_sword_viking_2, itm_tab_shield_heater_c]),
(58, mtef_visitor_source|mtef_team_2,af_override_weapons|af_override_horse, aif_start_alarmed, 1, [itm_sword_viking_2, itm_tab_shield_heater_c]),
#vistiors 8 and 9 are 2-H standard
(0, mtef_visitor_source|mtef_team_0, af_override_weapons, aif_start_alarmed, 1, [itm_sword_of_war, itm_great_axe, itm_warhammer]),
(8, mtef_visitor_source|mtef_team_2,af_override_weapons, aif_start_alarmed, 1, [itm_sword_of_war, itm_great_axe, itm_warhammer]),
#visitors 10 and 11 are 2-H no horse
(56, mtef_visitor_source|mtef_team_0, af_override_weapons|af_override_horse, aif_start_alarmed, 1, [itm_sword_of_war, itm_great_axe, itm_warhammer]),
(58, mtef_visitor_source|mtef_team_2,af_override_weapons|af_override_horse, aif_start_alarmed, 1, [itm_sword_of_war, itm_great_axe, itm_warhammer]),
#vistiors 12 and 13 are ranged standard - note that armor is also changed to light leather stuff
(0, mtef_visitor_source|mtef_team_0, af_override_all_but_horse|af_override_foot, aif_start_alarmed, 1, [itm_hunting_bow, itm_bodkin_arrows, itm_nobleman_outfit, itm_skullcap, itm_light_leather_boots, itm_leather_gloves]),
(8, mtef_visitor_source|mtef_team_2, af_override_all_but_horse|af_override_foot, aif_start_alarmed, 1, [itm_hunting_bow, itm_bodkin_arrows, itm_nobleman_outfit, itm_skullcap, itm_light_leather_boots, itm_leather_gloves]),
#visitors 14 and 15 are ranged no horse - note that armor is also changed to light leather stuff
(0, mtef_visitor_source|mtef_team_0, af_override_everything, aif_start_alarmed, 1, [itm_hunting_bow, itm_bodkin_arrows, itm_nobleman_outfit, itm_skullcap, itm_light_leather_boots, itm_leather_gloves]),
(8, mtef_visitor_source|mtef_team_2, af_override_everything, aif_start_alarmed, 1, [itm_hunting_bow, itm_bodkin_arrows, itm_nobleman_outfit, itm_skullcap, itm_light_leather_boots, itm_leather_gloves]),
],
[
common_inventory_not_available,
(ti_tab_pressed, 0, 0, [],
[(question_box,"@Do you wish to give up the fight?")]),
(ti_question_answered, 0, 0, [],
[(store_trigger_param_1,":answer"),
(eq,":answer",0),
#add 1 to the slot for amount of duels the player lost against this troop if it is a tf_hero
(try_begin),
(troop_is_hero, "$g_talk_troop"),
(assign, "$g_duel_result", -1),
(troop_get_slot, ":duel_losses", "$g_talk_troop", slot_troop_duel_lost),
(val_add, ":duel_losses", 1),
(troop_set_slot, "$g_talk_troop", slot_troop_duel_lost, ":duel_losses"),
(try_end),
#add 1 to the total amount of duels player lost if it is a tf_hero
(try_begin),
(troop_is_hero, "$g_talk_troop"),
(troop_get_slot, ":duel_losses_player", "trp_player", slot_troop_duel_lost),
(val_add, ":duel_losses_player", 1),
(troop_set_slot, "trp_player", slot_troop_duel_lost, ":duel_losses_player"),
(assign, reg(2), ":duel_losses_player"),
(display_message, "@You've lost a total number of {reg2} duels."),
(try_end),
(assign, "$g_duel_result", -1),
(finish_mission),
]),
(1,3, ti_once, [
(all_enemies_defeated, 1),
(neg|main_hero_fallen, 0)
],
[
#add 1 to the slot for amount of duels the player won against this troop if it is a tf_hero
(assign, "$g_duel_result", 1),
(try_begin),
(troop_is_hero, "$g_talk_troop"),
(troop_get_slot, ":duel_wins", "$g_talk_troop", slot_troop_duel_won),
(val_add, ":duel_wins", 1),
(troop_set_slot, "$g_talk_troop", slot_troop_duel_won, ":duel_wins"),
#add 1 to the total amount of duels player won if it is a tf_hero
(troop_get_slot, ":duel_wins_player", "trp_player", slot_troop_duel_won),
(val_add, ":duel_wins_player", 1),
(troop_set_slot, "trp_player", slot_troop_duel_won, ":duel_wins_player"),
(assign, reg(2), ":duel_wins_player"),
(display_message, "@You've won a total number of {reg2} duels"),
(try_end),
(finish_mission),
]),
(2, 3, ti_once, [
(main_hero_fallen),
],
[
#add 1 to the slot for amount of duels the player lost against this troop if it is a tf_hero
(assign, "$g_duel_result", -1),
(try_begin),
(troop_is_hero, "$g_talk_troop"),
(troop_get_slot, ":duel_losses", "$g_talk_troop", slot_troop_duel_lost),
(val_add, ":duel_losses", 1),
(troop_set_slot, "$g_talk_troop", slot_troop_duel_lost, ":duel_losses"),
(assign, reg(1), ":duel_losses"),
#add 1 to the total amount of duels player lost if it is a tf_hero
(troop_get_slot, ":duel_losses_player", "trp_player", slot_troop_duel_lost),
(val_add, ":duel_losses_player", 1),
(troop_set_slot, "trp_player", slot_troop_duel_lost, ":duel_losses_player"),
(assign, reg(2), ":duel_losses_player"),
(display_message, "@You've lost a total number of {reg2} duels."),
(try_end),
(finish_mission),
]),
],
),
########################## Duel Mod End ##############################
If you've done all thise like I told you, it should work. Build and play, my friends!
Some observations:
Duelling on horseback is somewhat lame, the AI seems to mostly just run around in circles, for future versions I'll have to look at that, maybe include the jousting thing from janus' arena expansion. Problem with that is that I would have to include scenes and it wouldn't really be a 'kit' anymore but a proper mod.
Kings are evil
Some Lords are more equal than others.. I guess this should already be obvious in the game and from looking at the troops.py but it's VERY obvious when one is bashing your head in with dramatic fervor.
It's all quite a lot of fun.
Future features and fixes
- Make the transition from dialog to duel more smooth
- Defeating a lot of lords and kings without losing will give renown gain
- Report option so you can see your duel results with the various lords
- Result based dialog for companions
- More expanded dialog for lords and kings, make them really worked up or smug depending on results.
- more, different and more useful duel options
If you have any problems or questions please let me know. Any bugs also. I've tested it quite extensively but you never know what can pop up.
Have fun!