What is for: Mount&Blade Warband
Recuriment: presentation for troop tree provided by rubic or dunde (this are links)
Or you can use troop tree presentation from Viking Conquest provided in spoiler. Add constants in file module_constants.py used in VC presentation from the end of the spoiler.
1) File module_scripts.py add script
Code for Viking Conquest troop tree (easiest)
Code for rubic's troop treee
2) Open file game_variables.txt in compiled module folder
3) Open file module.ini and add:
4) Open file languages\en\ui.csv in compiled module folder or in "Mount&Blade Warband" game installed folder and add:
Some fonts don't fit to button. In this case add space before and after "Troop Tree" so the text will fit in the button. Add an empty line after so last character will display.
Recuriment: presentation for troop tree provided by rubic or dunde (this are links)
Or you can use troop tree presentation from Viking Conquest provided in spoiler. Add constants in file module_constants.py used in VC presentation from the end of the spoiler.
Code:
#chief presentacion game_troop_tree moto
#INPUT: reg0 selected troop
("game_troop_tree", 0, 0, [
(ti_on_presentation_load, [
(presentation_set_duration, 999999),
(set_fixed_point_multiplier, 1000),
(assign, ":troop", reg0),
###mesh de fondo MOTO must do it this way or won't allow party screen to reappear
(create_mesh_overlay, reg0, "mesh_load_window"),
(position_set_x, pos1, -1),
(position_set_y, pos1, -1),
(overlay_set_position, reg0, pos1),
(position_set_x, pos1, 1002),
(position_set_y, pos1, 1002),
(overlay_set_size, reg0, pos1),
#Message first part
#screen top
(create_text_overlay, reg1, "@Troop Tree", tf_center_justify),
(position_set_x, pos1, Screen_Width/2),
(position_set_y, pos1, Screen_Title_Height),
(overlay_set_position, reg1, pos1),
#write the trees
(call_script, "script_troop_tree_precurse", ":troop", 1, 1),
(store_div, "$troop_tree_pic_width", Troop_Tree_Area_Width, reg0),
(store_div, "$troop_tree_pic_height", Troop_Tree_Area_Height, reg1),
(store_div, ":x_pos", "$troop_tree_pic_width", 2),
(val_add, ":x_pos", Screen_Border_Width),
(store_mul, ":y_pos", "$troop_tree_pic_height", -1),
(val_add, ":y_pos", Screen_Title_Height-2*Screen_Text_Height),
(call_script, "script_troop_tree_recurse", ":troop", ":x_pos", ":y_pos"),
#screen bottom
(create_game_button_overlay, "$presentation_leave_button", "@Done", tf_center_justify),
(position_set_x, pos1, Screen_Width/2),
(position_set_y, pos1, Screen_Border_Width),
(overlay_set_position, "$presentation_leave_button", pos1),
]),
(ti_on_presentation_run, [
(try_begin),
(this_or_next|key_clicked, key_escape),
(key_clicked, key_xbox_start),
(presentation_set_duration, 0),
(try_end),
]),
(ti_on_presentation_event_state_change, [
(store_trigger_param_1, ":object"),
(eq, ":object", "$presentation_leave_button"),
(presentation_set_duration, 0),
]),
]), #end troop tree
# declare constants in module_constants.py
Screen_Width = 1024-Screen_Border_Width
Troop_Tree_Num_Levels = 6
Troop_Tree_Max_Per_Level = 5 #2^(Troop_Tree_Num_Levels-1) opt for counting most upgrade2 over all factions
Troop_Tree_Area_Height = Screen_Title_Height-4*Screen_Text_Height
Troop_Tree_Area_Width = Screen_Width-2*Screen_Border_Width
Troop_Tree_Line_Color = 0x001380
Troop_Tree_Tableau_Height = 800
Troop_Tree_Tableau_Width = Troop_Tree_Tableau_Height*Screen_Undistort_Width_Num/Screen_Undistort_Width_Den
1) File module_scripts.py add script
Code for Viking Conquest troop tree (easiest)
Code:
#script_game_troop_upgrades_button_clicked
# This script is called from the game engine when the player clicks on said button from the party screen
# INPUT: arg1 = troop_id
("game_troop_upgrades_button_clicked", [
(store_script_param, reg0, 1),
(start_presentation, "prsnt_game_troop_tree"),
]),
Code:
#script_game_troop_upgrades_button_clicked
# This script is called from the game engine when the player clicks on said button from the party screen
# INPUT: arg1 = troop_id
("game_troop_upgrades_button_clicked",
[
(store_script_param, reg0, 1),
(assign, "$g_selected_troop", reg0),
(call_script, "script_get_page_no_of_troop_tree_for_troop_on", "$g_selected_troop"),
(assign, "$g_selected_page", reg0),
(start_presentation, "prsnt_faction_troop_trees"),
]),
Code:
After
party_t_upgrade_text_color = 0xFF991100
Add
party_b_troop_upgrades_position_x = 0.09 #upgrade advise.
party_b_troop_upgrades_position_y = 0.25 #upgrade advise.#before 0.22
After
party_b_move_down_h = 0.03
Add
party_b_troop_upgrades_h = 0.033
3) Open file module.ini and add:
Code:
show_troop_upgrades_button = 1
4) Open file languages\en\ui.csv in compiled module folder or in "Mount&Blade Warband" game installed folder and add:
Code:
ui_troop_upgrades| Troop Tree
Last edited: