OSP Kit QoL Tournament Play Enhancements 1.5

Users who are viewing this thread

Bayard-X said:
Thanks! :grin:

Could you also point out, which lines of that code I need to copy? Would I also need other parts of the code?
For the ladies here is a script version of what you're looking for.
Code:
# script_tpe_rep_gain_ladies
# This section implements the "Lady Reactions" feature.
# Inputs: None
# Output: None
  ("tpe_rep_gain_ladies",
    [
		# Raises relation with Ladies that are (present).  More so if in courtship.
		(try_for_range, ":troop_npc", kingdom_ladies_begin, kingdom_ladies_end),
			(troop_slot_eq, ":troop_npc", slot_troop_cur_center, "$current_town"), # For the Ladies.
			(assign, ":lady_rep", 1),
			(try_begin),
				(troop_slot_ge, ":troop_npc", slot_troop_courtship_state, 2),
				(val_add, ":lady_rep", 2),
			(try_end),
			(call_script, "script_change_player_relation_with_troop", ":troop_npc", ":lady_rep"),
		(try_end),
	]),

Here is the small section to improve town reputation.  This requires use of a slot_center_tournament_wins constant (which I was using #233) to keep track of how many wins you have in that specific town.  It just adds 1 to the counter each time and gives you a reputation gain equal to the total.
Code:
# Determines relation gain based on repeated wins in the same town.
(str_store_party_name, s3, "$current_town"),
(party_get_slot, ":total_wins", "$current_town", slot_center_tournament_wins),
(val_add, ":total_wins", 1),
(party_set_slot, "$current_town", slot_center_tournament_wins, ":total_wins"),
(call_script, "script_change_player_relation_with_center", "$current_town", ":total_wins"),
The lord section is currently being fixed as it does not appear to be working correctly, but I will post it as well once done.  I hope that helps.

Once that is complete I will be posting a new revision of this kit ported over to modmerger format for those interested.
 
Lord Section
Code:
# script_tpe_rep_gain_lords
# This section implements the "Lord Reactions" feature.
# Inputs: None
# Output: None
  ("tpe_rep_gain_lords",
    [
		# Raises relation with Lords that are (present) AND (friendly).  Enemies gain nothing.
		(party_collect_attachments_to_party, "$current_town", "p_temp_party"),
		(party_get_num_companion_stacks,":party_stacks","p_temp_party"),
		(try_for_range, ":stack_no", 0, ":party_stacks"),
			(party_stack_get_troop_id,":troop_in_party","p_temp_party",":stack_no"),
			(troop_is_hero, ":troop_in_party"),
			(neg|is_between, ":troop_in_party", companions_begin, companions_end), # Removed companions from this benefit.
			(call_script, "script_troop_get_player_relation", ":troop_in_party"),
			(assign, ":relation", reg0),
			(assign, ":relation_gain", 0),
			(try_begin),
				(ge, ":relation", 10),
				(val_add, ":relation_gain", 1),
			(else_try),
				(le, ":relation", -5),
				(val_sub, ":relation_gain", -1),
			(try_end),
			(call_script, "script_change_player_relation_with_troop", ":troop_in_party", ":relation_gain"),
		(try_end),
	]),
 
Great! :grin: I implemented and tested the lady and town section last evening. Works perfectly. However, I implemented not as a script but directly in the menu. Is there something to worry?

You'll get credits from the Renaissance mod. :grin:

 
I'm trying to implement the script, but I'm getting this error when I build the module.
Code:
Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Traceback (most recent call last):
  File "process_global_variables.py", line 12, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 6, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 66, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 7, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 4, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 7, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Traceback (most recent call last):
  File "process_game_menus.py", line 5, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\process_oper
ations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\New\Data\module_game_
menus.py", line 10276
SyntaxError: Non-ASCII character '\x93' in file C:\Program Files (x86)\Mount&Bla
de Warband\Modules\New\Data\module_game_menus.py on line 10276, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
This is the line that's in question:
Code:
	  ("tournament_options_panel", [(eq, “$g_wp_tpe_active”, 1)], "Change tournament options.",
 
Somebody said:
Delete that entire line and re-type it yourself, or change the encoding declared at the top of the file - it's probably a quote character or something.
I agree with this.  If you have modmerger installed in your mod I will have 1.1 of TPE uploaded sometime in the morning assuming my Internet connection at home is back. Then modmerger can do the work for you.  A much better set of installation instructions will also be included.
 
Version 1.1 released

Changes:
  • Converted to Modmerger format for easier installation and updating.
  • All items needed to get the kit working included if a modder doens't wish to designate their own.
  • Mostly bug fixes and refinements.

Original post updated with download information.
 
Version 1.11 released

Changes:
  • Bug fixes to the never spawn feature which wasn't copied over when the kit was repackaged.  For people who have already installed this kit you only need to replace the tournament_scripts.py file as this was the only file updated.

Original post updated with download information.
 
Hey, first I want to say that this looks really nice.

However, I'm mainly interested in the Lord/Lady/Town reputation and the renown scaling.
You've already answered Bayard for the reputations, but what part of the script do I use for renown scaling?

I found the section about it
Code:
# script_tpe_determine_scaled_renown
# This section implements the "Renown Scaling" feature.
# Inputs: None
# Output: reg0 (new renown)
  ("tpe_determine_scaled_renown",
    [
		# Determine renown gained by player level.
		(store_character_level, ":player_level", "trp_player"),
		(store_div, ":sr_level_factor", 40, ":player_level"),  # Balanced for a max level of 40.  Beyond this you get minimum gain.
		(val_mul, ":sr_level_factor", 5),
		(store_div, ":sr_factor_limit", wp_tpe_max_renown, 2), # Since two factors are used.  Total is split by 2.
		(val_min, ":sr_level_factor", ":sr_factor_limit"),     # Prevents an extremely low level gaining more renown than intended.
		(val_max, ":sr_level_factor", 5),                      # Sets a minimum renown gain of 5 no matter how high your level is.
		
		# Determine renown gained by player renown.
		(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
		(store_div, ":sr_renown_factor", 1500, ":player_renown"),  # Balanced for a max renown of 1500.  Beyond this you get minimum gain.
		(val_mul, ":sr_renown_factor", 5),
		(store_div, ":sr_factor_limit", wp_tpe_max_renown, 2),  # Since two factors are used.  Total is split by 2.
		(val_min, ":sr_renown_factor", ":sr_factor_limit"),     # Prevents an extremely low level gaining more renown than intended.
		(val_max, ":sr_renown_factor", 5),                      # Sets a minimum renown gain of 5 no matter how high your level is.
		
		(store_add, reg0, ":sr_level_factor", ":sr_renown_factor"), # combines both factors.
	]),
but is there any other section of the scripts that I would need to add to it to make it work?
 
Michigan J. Frog said:
but is there any other section of the scripts that I would need to add to it to make it work?
That is the correct script.  The only input it needs to make it independent of the TPE mod is for constant (wp_tpe_max_renown) to be defined or simply set it locally.  I used 80 since the amount scales down very quickly as you gain level and renown.

The code that called that script is fairly straight forward:
Code:
# Determine scaled renown
(call_script, "script_tpe_determine_scaled_renown"),
(call_script, "script_change_troop_renown", "trp_player", reg0),
That is all that is needed to make it work.  I simply moved the renown changing script up with the rest so that it isn't underneath the conditional global ($g_wp_tpe_renown_scaling).  You can find that information in the top of the tournament_game_menus.py file.
 
Ok, so this
Code:
from ID_items import *
from ID_quests import *
from ID_factions import *
##############################################################
# These constants are used in various files.
# If you need to define a value that will be used in those files,
# just define it here rather than copying it across each file, so
# that it will be easy to change it if you need to.
##############################################################

# Renown Scaling
slot_center_tournament_wins            = 233  # This tallies each win so that subsequent wins gain more reputation as a "crowd favorite".
wp_tpe_max_renown                      = 80   # This sets a hard limit on how much renown can be gained at most.
and this
Code:
# -*- coding: cp1254 -*-
from header_common import *
from header_operations import *
from module_constants import *
from module_constants import *
from header_parties import *
from header_skills import *
from header_mission_templates import *
from header_items import *
from header_triggers import *
from header_terrain_types import *
from header_music import *
from header_map_icons import *
from ID_animations import *


####################################################################################################################
# scripts is a list of script records.
# Each script record contns the following two fields:
# 1) Script id: The prefix "script_" will be inserted when referencing scripts.
# 2) Operation block: This must be a valid operation block. See header_operations.py for reference.
####################################################################################################################

scripts = [
# Renown Scaling in Tournaments
# script_tpe_determine_scaled_renown
# This section implements the "Renown Scaling" feature.
# Inputs: None
# Output: reg0 (new renown)
  ("tpe_determine_scaled_renown",
    [
		# Determine renown gained by player level.
		(store_character_level, ":player_level", "trp_player"),
		(store_div, ":sr_level_factor", 40, ":player_level"),  # Balanced for a max level of 40.  Beyond this you get minimum gain.
		(val_mul, ":sr_level_factor", 5),
		(store_div, ":sr_factor_limit", wp_tpe_max_renown, 2), # Since two factors are used.  Total is split by 2.
		(val_min, ":sr_level_factor", ":sr_factor_limit"),     # Prevents an extremely low level gaining more renown than intended.
		(val_max, ":sr_level_factor", 5),                      # Sets a minimum renown gain of 5 no matter how high your level is.
		
		# Determine renown gained by player renown.
		(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
		(store_div, ":sr_renown_factor", 1500, ":player_renown"),  # Balanced for a max renown of 1500.  Beyond this you get minimum gain.
		(val_mul, ":sr_renown_factor", 5),
		(store_div, ":sr_factor_limit", wp_tpe_max_renown, 2),  # Since two factors are used.  Total is split by 2.
		(val_min, ":sr_renown_factor", ":sr_factor_limit"),     # Prevents an extremely low level gaining more renown than intended.
		(val_max, ":sr_renown_factor", 5),                      # Sets a minimum renown gain of 5 no matter how high your level is.
		
		(store_add, reg0, ":sr_level_factor", ":sr_renown_factor"), # combines both factors.
	]),
would work then right?
If so, where do I need to call the script? I'm not the greatest at understanding where things need to be. I've been messing with prisoner chat dialogs, so I've just been copy/pasting scripts for the most part :smile:
 
Michigan J. Frog said:
If so, where do I need to call the script? I'm not the greatest at understanding where things need to be. I've been messing with prisoner chat dialogs, so I've just been copy/pasting scripts for the most part :smile:
I'm not sure I understand your question so let me clarify.  Do you want to have the scaling renown, lord reputation, lady reputation and town reputation features work with the normal native tournament?  If that is the case then:

1) Copy the scripts for each somewhere into your module_scripts.py file. 
2) Add the constants you listed above to your module_constants.py file.
3) Then look up this section of native code in module_game_menus.py:
Code:
(
    "town_tournament_won",mnf_disable_all_keys,
    "You have won the tournament of {s3}! You are filled with pride as the crowd cheers your name.\
 In addition to honour, fame and glory, you earn a prize of {reg9} denars. {s8}",
    "none",
    [
        (str_store_party_name, s3, "$current_town"),
        (call_script, "script_change_troop_renown", "trp_player", 20),
        (call_script, "script_change_player_relation_with_center", "$current_town", 1),   
        (assign, reg9, 200),
        (add_xp_to_troop, 250, "trp_player"),
        (troop_add_gold, "trp_player", reg9),
        (str_clear, s8),
        (store_add, ":total_win", "$g_tournament_bet_placed", "$g_tournament_bet_win_amount"),
        (try_begin),
          (gt, "$g_tournament_bet_win_amount", 0),
          (assign, reg8, ":total_win"),
          (str_store_string, s8, "@Moreover, you earn {reg8} denars from the clever bets you placed on yourself..."),
        (try_end),
		(try_begin),
			(this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
				(neg|troop_slot_ge, "trp_player", slot_troop_renown, 70),
			(neg|troop_slot_ge, "trp_player", slot_troop_renown, 145),

			(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
			(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$g_encountered_party"),
			(str_store_string, s8, "str_s8_you_are_also_invited_to_attend_the_ongoing_feast_in_the_castle"),
		(try_end),
        (troop_add_gold, "trp_player", ":total_win"),
        (assign, ":player_odds_sub", 0),
        (store_div, ":player_odds_sub", "$g_tournament_bet_win_amount", 5),
        (party_get_slot, ":player_odds", "$current_town", slot_town_player_odds),
        (val_sub, ":player_odds", ":player_odds_sub"),
        (val_max, ":player_odds", 250),
        (party_set_slot, "$current_town", slot_town_player_odds, ":player_odds"),
        (call_script, "script_play_victorious_sound"),
        
        (unlock_achievement, ACHIEVEMENT_MEDIEVAL_TIMES),
        ],
    [
      ("continue", [], "Continue...",
       [(jump_to_menu, "mnu_town"),
        ]),
    ]
  ),
...and replace it with...
Code:
(
    "town_tournament_won",mnf_disable_all_keys,
    "You have won the tournament of {s3}! You are filled with pride as the crowd cheers your name.\
 In addition to honour, fame and glory, you earn a prize of {reg9} denars. {s8}",
    "none",
    [
        ## TOURNAMENT PLAY ENHANCEMENTS (1.0) begin - Windyplains
		# Determine scaled renown
		(call_script, "script_tpe_determine_scaled_renown"),
		(assign, ":sr_renown", reg0),

		# Determines relation gain based on repeated wins in the same town.
		(str_store_party_name, s3, "$current_town"),
		(party_get_slot, ":total_wins", "$current_town", slot_center_tournament_wins),
		(val_add, ":total_wins", 1),
		(party_set_slot, "$current_town", slot_center_tournament_wins, ":total_wins"),
		
			(call_script, "script_change_troop_renown", "trp_player", ":sr_renown"),
			(call_script, "script_change_player_relation_with_center", "$current_town", ":total_wins"),
			
			# Raises relation with Lords that are (present) AND (friendly).  Enemies lose relation.
			(call_script, "script_tpe_rep_gain_lords"),
			
			# Raises relation with Ladies that are (present).  More so if in courtship.
			(call_script, "script_tpe_rep_gain_ladies"),
		## TOURNAMENT PLAY ENHANCEMENTS end
		
        (assign, reg9, 2000), # Was 200
        (add_xp_to_troop, 2500, "trp_player"), # Was 250
        (troop_add_gold, "trp_player", reg9),
        (str_clear, s8),
        (store_add, ":total_win", "$g_tournament_bet_placed", "$g_tournament_bet_win_amount"),
        (try_begin),
          (gt, "$g_tournament_bet_win_amount", 0),
          (assign, reg8, ":total_win"),
          (str_store_string, s8, "@Moreover, you earn {reg8} denars from the clever bets you placed on yourself..."),
        (try_end),
		(try_begin),
			(this_or_next|neq, "$players_kingdom", "$g_encountered_party_faction"),
				(neg|troop_slot_ge, "trp_player", slot_troop_renown, 70),
			(neg|troop_slot_ge, "trp_player", slot_troop_renown, 145),

			(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_state, sfai_feast),
			(faction_slot_eq, "$g_encountered_party_faction", slot_faction_ai_object, "$g_encountered_party"),
			(str_store_string, s8, "str_s8_you_are_also_invited_to_attend_the_ongoing_feast_in_the_castle"),
		(try_end),
        (troop_add_gold, "trp_player", ":total_win"),
        (assign, ":player_odds_sub", 0),
        (store_div, ":player_odds_sub", "$g_tournament_bet_win_amount", 5),
        (party_get_slot, ":player_odds", "$current_town", slot_town_player_odds),
        (val_sub, ":player_odds", ":player_odds_sub"),
        (val_max, ":player_odds", 250),
        (party_set_slot, "$current_town", slot_town_player_odds, ":player_odds"),
        (call_script, "script_play_victorious_sound"),
        
        (unlock_achievement, ACHIEVEMENT_MEDIEVAL_TIMES),
        ],
    [
      ("continue", [], "Continue...",
       [(jump_to_menu, "mnu_town"),
        ]),
    ]
  ),
That should implement everything.  Let me know if you run into any trouble with that.
 
I guess I'm not the best at communication either :wink:
I'm testing it right now, so thanks for the help with this.

Edit: btw, what I meant by "where do I call this" was where do I need to put it, but your instructions in game_menus answered it already.

Ok, I've added it all in, (haven't tested in game) but I had a question about the reputation gain with towns.
Windyplains said:
It just adds 1 to the counter each time and gives you a reputation gain equal to the total.
So if I had won 10 tournaments in the town, I would gain 10 relation with them?
I know it would take a while to get to a lot of wins in just one town (but there are feats, etc.), but is there a way to set a limit on the amount of relation points you get? Something like 7 seems reasonable to me. Or is there a way to make it so you get less relation points then your total wins (ex. 1 win/2 rounds to 1 point, 2 wins/2 rounds to 1 point, 3 wins/2 rounds to 2, and so on).
 
I got an error when compiling it that said that wp_tpe_debug is not defined.
Does that need to be in the script to work? Otherwise, what needs to be done to fix it.

Edit:  I got rid of the debug part, and I held a feast so I could test the tournament. When I started to wait at the town for lords to come, a screen said "you prepare to duel', and suddenly I was fighting Haringoth. :razz: After the duel, it went into a endless loop of him saying "surrender or die" and me saying "do your worst".  :lol:
 
So if I had won 10 tournaments in the town, I would gain 10 relation with them?
Correct.  You are in effect a crowd favorite.
I know it would take a while to get to a lot of wins in just one town (but there are feats, etc.), but is there a way to set a limit on the amount of relation points you get? Something like 7 seems reasonable to me. Or is there a way to make it so you get less relation points then your total wins (ex. 1 win/2 rounds to 1 point, 2 wins/2 rounds to 1 point, 3 wins/2 rounds to 2, and so on).
Sure.  In that menu I showed before look for...
Code:
(val_add, ":total_wins", 1),
(party_set_slot, "$current_town", slot_center_tournament_wins, ":total_wins"),
...and add...
Code:
(val_min, ":total_wins", 7),
...between those two lines.
Which will cap it at 7 maximum or whatever you set that number to.

Michigan J. Frog said:
I got an error when compiling it that said that wp_tpe_debug is not defined.
Does that need to be in the script to work? Otherwise, what needs to be done to fix it.

Edit:  I got rid of the debug part, and I held a feast so I could test the tournament. When I started to wait at the town for lords to come, a screen said "you prepare to duel', and suddenly I was fighting Haringoth. :razz: After the duel, it went into a endless loop of him saying "surrender or die" and me saying "do your worst".  :lol:
Amusing, but odd.  This kit doesn't touch the dueling template at all.  Oh and sorry about the wp_tpe_debug, just set it to 0.  Have you tried installing the kit via modmerger and seeing if it works?  Without knowing whatever other changes you've made it is hard to say where that went wrong.  The TPE 1.11 kit itself should only replace mnu_town_tournament & mnu_town_tournament_won.  Everything else should be separate from the native code unless you've made other alterations.

Out of curiosity, did you try to enter a tournament from a dialog at the feast?  If that is the case that is something I haven't accounted for.  I just setup a hook to change the main tournament menu itself.
 
Up until now, I didn't know you could enter a tournament through dialogs at a feast.
Actually, I didn't enter anything. I asked my wife to start a feast (to generate a tournament rather than search for one), and when I clicked "wait here for a while" so one would generate, the dueling thing popped up after after about an hour.

Edit: About the total wins thing, would adding something like val_div (not sure what it is fully, have seen it in scripts though) make it so every two tournaments you win the amount of relation you gain goes up by one.
Edit 2: BTW, I was just pasting in that line for the total wins (unless that division thing works), and I noticed it says val_min. Is this correct, or should it say val_max? Not to question the master of course :wink:
 
val_max returns the larger of the two values, so that would give you a minimum increase of two. Use val_div before (call_script, "script_change_player_relation_with_center", "$current_town", ":total_wins"), if you want to halve the effect.
 
Somebody said:
val_max returns the larger of the two values, so that would give you a minimum increase of two. Use val_div before (call_script, "script_change_player_relation_with_center", "$current_town", ":total_wins"), if you want to halve the effect.
@ Michigan
What is quoted here is right and works for what you're suggesting.

(val_min, ":total_wins", 7), # This would compare ":total_wins" to 7 and if it is larger turn it into a 7.  (thus capping it).
(val_div, ":total_wins", 2), # This will give you your half amount of total wins.
(val_max, ":total_wins", 7), # This would actually cause ":total_wins" to be 7 at a minimum unless it is higher than 7 already.

Hope that makes more sense.
 
Back
Top Bottom