• Please note that we've updated the Mount & Blade II: Bannerlord save file system which requires you to take certain steps in order for your save files to be compatible with e1.7.1 and any later updates. You can find the instructions here.

WB Coding Troop trees problem

Users who are viewing this thread

pan-boroda

Knight at Arms
Good evening, please help with this problem. When adding new factions, when viewing the lines of troops, only a few states are displayed (to be precise, 24, although there are 30 of them).
Tell me how to increase the number of viewed states, or how to prescribe that the faction window with the line of troops would switch left and right as in dinamic troop trees.
As I understand it, you need to make changes in the module_presentations

mb42.jpg

Code:
## Tocan- ##
  ("faction_troop_trees", 0, 0, [
    (ti_on_presentation_load,
      [
        (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),
       
        (create_mesh_overlay, reg1, "mesh_load_window"),
        (position_set_x, pos1, 0),
        (position_set_y, pos1, 0),
        (overlay_set_position, reg1, pos1),
       
        ## combo_button
        (create_combo_button_overlay, "$g_presentation_obj_1"),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 690),
        (overlay_set_position, "$g_presentation_obj_1", pos1),
        # factions
        (store_sub, ":num_factions", npc_kingdoms_end, npc_kingdoms_begin),
        (store_add, ":num_pages", ":num_factions", 3),
       
        ## page names, from bottom to top
        (overlay_add_item, "$g_presentation_obj_1", "@Others"),
        (overlay_add_item, "$g_presentation_obj_1", "@Outlaws"),
        (overlay_add_item, "$g_presentation_obj_1", "[USER=4023]@Mercenary[/USER]"),
        (try_for_range_backwards, ":page_no", 0, ":num_factions"),
          (store_add, ":faction_no", ":page_no", npc_kingdoms_begin),
          (str_store_faction_name, s0, ":faction_no"),
          (overlay_add_item, "$g_presentation_obj_1", s0),
        (try_end),
        (store_sub, ":presentation_obj_val", ":num_pages", "$g_selected_page"),
        (val_sub, ":presentation_obj_val", 1),
        (overlay_set_val, "$g_presentation_obj_1", ":presentation_obj_val"),
       
        ## back
        (create_game_button_overlay, "$g_presentation_obj_2", "@Close"),
        (position_set_x, pos1, 750),
        (position_set_y, pos1, 685),
        (overlay_set_position, "$g_presentation_obj_2", pos1),
       
        ## tips
        (create_text_overlay, reg1, "[USER=445895]@Click[/USER] the center button to toggle faction^Click the avatars to view details of them", tf_left_align),
        (position_set_x, pos1, 800),
        (position_set_y, pos1, 800),
        (overlay_set_size, reg1, pos1),
        (position_set_x, pos1, 30),
        (position_set_y, pos1, 690),
        (overlay_set_position, reg1, pos1),
       
        ## pic_arms
        (try_begin),
          (is_between, "$g_selected_page", 0, ":num_factions"),
          (store_add, ":pic_arms", "mesh_pic_arms_swadian", "$g_selected_page"),
          (create_mesh_overlay, reg1, ":pic_arms"),
          (position_set_x, pos1, 120),
          (position_set_y, pos1, 100),
          (overlay_set_position, reg1, pos1),
          (position_set_x, pos1, 300),
          (position_set_y, pos1, 300),
          (overlay_set_size, reg1, pos1),
        (try_end),

        # detect_total_max_tier, calculate offset_x
        (assign, ":total_max_tier", 1),
        (try_for_range, ":cur_troop", soldiers_begin, soldiers_end),
          (neg|troop_is_hero, ":cur_troop"),
          # can upgrade
          (troop_get_upgrade_troop, ":upgrade_troop", ":cur_troop", 0),
          (gt, ":upgrade_troop", 0),
          # page_no_for_cur_troop
          (call_script, "script_get_page_no_of_troop_tree_for_troop_on", ":cur_troop"),
          (assign, ":page_no_for_cur_troop", reg0),
          # on current page_no
          (eq, ":page_no_for_cur_troop", "$g_selected_page"),
          (assign, reg0, 1), # reg0: init max_tier to 1
          (call_script, "script_troop_tree_recursive_detect_max_tier", ":cur_troop", 1),
          (assign, ":cur_max_tier", reg0),
          (try_begin),
            (gt, ":cur_max_tier", ":total_max_tier"),
            (assign, ":total_max_tier", ":cur_max_tier"),
          (try_end),
        (try_end),
        (val_sub, ":total_max_tier", 1),
        (val_max, ":total_max_tier", 1),
        (store_div, ":eek:ffset_x", 700, ":total_max_tier"),
        (val_min, ":eek:ffset_x", 120),
       
        (str_clear, s0),
        (create_text_overlay, reg1, s0, tf_scrollable),
        (position_set_x, pos1, 15),
        (position_set_y, pos1, 15),
        (overlay_set_position, reg1, pos1),
        (position_set_x, pos1, 800),
        (position_set_y, pos1, 660),
        (overlay_set_area_size, reg1, pos1),
        (set_container_overlay, reg1),
       
        (assign, "$g_cur_slot_no", 0),
        (assign, reg2, 75),
        # find all root troops of selected faction
        (try_for_range, ":cur_troop", soldiers_begin, soldiers_end),
          (neg|troop_is_hero, ":cur_troop"),
          # can upgrade
          (troop_get_upgrade_troop, ":upgrade_troop", ":cur_troop", 0),
          (gt, ":upgrade_troop", 0),
          # page_no_for_cur_troop
          (call_script, "script_get_page_no_of_troop_tree_for_troop_on", ":cur_troop"),
          (assign, ":page_no_for_cur_troop", reg0),
          # on current page_no
          (eq, ":page_no_for_cur_troop", "$g_selected_page"),
          # can't be upgraded from other troops of the same page
          (assign, ":is_root_troop", 1),
          (assign, ":end_cond", soldiers_end),
          (try_for_range, ":loop_troop", soldiers_begin, ":end_cond"),
            (neg|troop_is_hero, ":loop_troop"),
            # page_no_for_loop_troop
            (call_script, "script_get_page_no_of_troop_tree_for_troop_on", ":loop_troop"),
            (assign, ":page_no_for_loop_troop", reg0),
            # on current page_no
            (eq,  ":page_no_for_loop_troop", "$g_selected_page"),
            (troop_get_upgrade_troop, ":upgrade_troop_1", ":loop_troop", 0),
            (troop_get_upgrade_troop, ":upgrade_troop_2", ":loop_troop", 1),
            (this_or_next|eq, ":upgrade_troop_1", ":cur_troop"),
            (eq, ":upgrade_troop_2", ":cur_troop"),
            (assign, ":is_root_troop", 0),
            (assign, ":end_cond", 0), #break
          (try_end),
          (eq, ":is_root_troop", 1), # draw troop tree of cur root_troop
          (call_script, "script_troop_tree_recursive_backtracking", ":cur_troop", 50, reg2, ":eek:ffset_x"),
          (val_add, reg2, 160),
        (try_end),
       
        (set_container_overlay, -1),
       
        ## draw selected_troop: Attributes, Skills, Equipments,
        (try_begin),
          (gt, "$g_selected_troop", 0),
          (store_mul, ":cur_troop", "$g_selected_troop", 2), #with weapons
          (create_image_button_overlay_with_tableau_material, reg1, -1, "tableau_game_party_window", ":cur_troop"),
          (position_set_x, pos1, 450),
          (position_set_y, pos1, 600),
          (overlay_set_size, reg1, pos1),
          (position_set_x, pos1, 810),
          (position_set_y, pos1, 550),
          (overlay_set_position, reg1, pos1),
         
          # pos2: text size
          (position_set_x, pos2, 750),
          (position_set_y, pos2, 750),
          # pos2: title text size
          (position_set_x, pos3, 900),
          (position_set_y, pos3, 900),
          # Name
          (str_store_troop_name, s1, "$g_selected_troop"),
          (create_text_overlay, reg1, s1, tf_center_justify),
          (position_set_x, pos1, 900),
          (position_set_y, pos1, 710),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos2),
         
          # level and HP
          (store_character_level, reg3, "$g_selected_troop"),
          (assign, ":troop_hp", 35),
          (store_skill_level, ":skill", skl_ironflesh, "$g_selected_troop"),
          (store_attribute_level, ":strength", "$g_selected_troop", ca_strength),
          (val_mul, ":skill", 2),
          (val_add, ":troop_hp", ":skill"),
          (val_add, ":troop_hp", ":strength"),
          (assign, reg4, ":troop_hp"),
          (create_text_overlay, reg1, "@Level: {reg3}^Health: {reg4}", tf_left_align),
          (position_set_x, pos1, 900),
          (position_set_y, pos1, 665),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos2),
         
          # Attributes
          (create_text_overlay, reg1, "@Attributes", tf_left_align),
          (position_set_x, pos1, 900),
          (position_set_y, pos1, 630),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos3),
          (create_text_overlay, reg1, "@STR^AGI^INT^CHA", tf_left_align),
          (position_set_x, pos1, 900),
          (position_set_y, pos1, 570),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos2),
         
          (try_for_range, ":attrib_id", 0, 4),
            (try_begin),
              (eq, ":attrib_id", 0),
              (store_attribute_level, reg2, "$g_selected_troop", ":attrib_id"),
              (str_store_string, s1, "@{reg2}"),
            (else_try),
              (store_attribute_level, reg2, "$g_selected_troop", ":attrib_id"),
              (str_store_string, s1, "@{s1}^{reg2}"),
            (try_end),
          (try_end),
          (create_text_overlay, reg1, s1, tf_right_align),
          (position_set_x, pos1, 980),
          (position_set_y, pos1, 570),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos2),
         
          # Skills
          (create_text_overlay, reg1, "@Skills", tf_left_align),
          (position_set_x, pos1, 840),
          (position_set_y, pos1, 527),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos3),
          (create_text_overlay, reg1, "@Ironflesh^Power Strike^Power Throw^Power Draw^Shield^Athletics^Riding^Horse Archery", tf_left_align),
          (position_set_x, pos1, 840),
          (position_set_y, pos1, 415),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos2),
         
          (try_for_range_backwards, ":skill_id", 0, 42),
            (try_begin),
              (eq, ":skill_id", "skl_ironflesh"),
              (store_skill_level, reg2, ":skill_id", "$g_selected_troop"),
              (str_store_string, s1, "@{reg2}"),
            (else_try),
              (this_or_next|eq, ":skill_id", "skl_power_strike"),
              (this_or_next|eq, ":skill_id", "skl_power_throw"),
              (this_or_next|eq, ":skill_id", "skl_power_draw"),
              (this_or_next|eq, ":skill_id", "skl_shield"),
              (this_or_next|eq, ":skill_id", "skl_athletics"),
              (this_or_next|eq, ":skill_id", "skl_riding"),
              (eq, ":skill_id", "skl_horse_archery"),
              (store_skill_level, reg2, ":skill_id", "$g_selected_troop"),
              (str_store_string, s1, "@{s1}^{reg2}"),
            (try_end),
          (try_end),
          (create_text_overlay, reg1, s1, tf_right_align),
          (position_set_x, pos1, 980),
          (position_set_y, pos1, 415),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos2),
         
          # Weapon Proficiencies
          (create_text_overlay, reg1, "@Proficiencies", tf_left_align),
          (position_set_x, pos1, 840),
          (position_set_y, pos1, 370),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos3),
          (create_text_overlay, reg1, "@1H Weapons^2H Weapons^Polearms^Archery^Crossbows^Throwing", tf_left_align),
          (position_set_x, pos1, 840),
          (position_set_y, pos1, 285),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos2),
         
          (try_for_range, ":wp_id", 0, 6),
            (try_begin),
              (eq, ":wp_id", wpt_one_handed_weapon),
              (store_proficiency_level, reg2, "$g_selected_troop", ":wp_id"),
              (str_store_string, s1, "@{reg2}"),
            (else_try),
              (is_between, ":wp_id", wpt_two_handed_weapon, wpt_firearm),
              (store_proficiency_level, reg2, "$g_selected_troop", ":wp_id"),
              (str_store_string, s1, "@{s1}^{reg2}"),
            (try_end),
          (try_end),
          (create_text_overlay, reg1, s1, tf_right_align),
          (position_set_x, pos1, 980),
          (position_set_y, pos1, 285),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos2),
         
          # Equipments
          (create_text_overlay, reg1, "@Equipments", tf_left_align),
          (position_set_x, pos1, 840),
          (position_set_y, pos1, 235),
          (overlay_set_position, reg1, pos1),
          (overlay_set_size, reg1, pos3),
          (str_clear, s0),
          (create_text_overlay, "$g_presentation_obj_3", s0, tf_scrollable),
          (position_set_x, pos1, 840),
          (position_set_y, pos1, 30),
          (overlay_set_position, "$g_presentation_obj_3", pos1),
          (position_set_x, pos1, 13:cool:,
          (position_set_y, pos1, 202),
          (overlay_set_area_size, "$g_presentation_obj_3", pos1),
          (set_container_overlay, "$g_presentation_obj_3"),
         
          (troop_clear_inventory, "trp_temp_array_a"),
          (troop_get_inventory_capacity, ":inv_cap", "$g_selected_troop"),
          (try_for_range, ":i_slot", 0, ":inv_cap"),
            (troop_get_inventory_slot, ":item", "$g_selected_troop", ":i_slot"),
            (gt, ":item", -1),
            (troop_get_inventory_slot_modifier, ":imod", "$g_selected_troop", ":i_slot"),
            (troop_add_item,"trp_temp_array_a",":item", ":imod"),
          (try_end),
         
          (assign, ":pos_x", 0),
          (assign, ":pos_y", 280),
          (assign, ":slot_no", 10),
          (try_for_range, ":unused_height", 0, :cool:,
            (try_for_range, ":unused_width", 0, 3),
              (create_mesh_overlay, reg1, "mesh_mp_inventory_choose"),
              (position_set_x, pos1, 320),
              (position_set_y, pos1, 320),
              (overlay_set_size, reg1, pos1),
              (position_set_x, pos1, ":pos_x"),
              (position_set_y, pos1, ":pos_y"),
              (overlay_set_position, reg1, pos1),
              (troop_set_slot, "trp_temp_array_a", ":slot_no", reg1),
              (create_mesh_overlay, reg1, "mesh_inv_slot"),
              (position_set_x, pos1, 400),
              (position_set_y, pos1, 400),
              (overlay_set_size, reg1, pos1),
              (position_set_x, pos1, ":pos_x"),
              (position_set_y, pos1, ":pos_y"),
              (overlay_set_position, reg1, pos1),
              (troop_get_inventory_slot, ":item_no", "trp_temp_array_a", ":slot_no"),
              (val_max, ":item_no", 0),
              (create_mesh_overlay_with_item_id, reg1, ":item_no"),
              (position_set_x, pos1, 400),
              (position_set_y, pos1, 400),
              (overlay_set_size, reg1, pos1),
              (store_add, ":item_x", ":pos_x", 20),
              (store_add, ":item_y", ":pos_y", 20),
              (position_set_x, pos1, ":item_x"),
              (position_set_y, pos1, ":item_y"),
              (overlay_set_position, reg1, pos1),
              (troop_set_slot, "trp_temp_array_b", ":slot_no", reg1),
              (val_add, ":pos_x", 40),
              (val_add, ":slot_no", 1),
            (try_end),
            (assign, ":pos_x", 0),
            (val_sub, ":pos_y", 40),
          (try_end),
          (set_container_overlay, -1),
        (try_end),
      ]),
     
    (ti_on_presentation_mouse_enter_leave,
      [
      (store_trigger_param_1, ":eek:bject"),
      (store_trigger_param_2, ":enter_leave"),
     
      (try_begin),
        (gt, "$g_selected_troop", 0),
        (try_begin),
          (eq, ":enter_leave", 0),
          (try_for_range, ":slot_no", 10, 106),
            (troop_slot_eq, "trp_temp_array_a", ":slot_no", ":eek:bject"),
            (troop_get_inventory_slot, ":item_no", "trp_temp_array_a", ":slot_no"),
            (troop_get_inventory_slot_modifier, ":cur_imod", "trp_temp_array_a", ":slot_no"),
            (try_begin),
              (gt, ":item_no", -1),
              (troop_get_slot, ":target_obj", "trp_temp_array_b", ":slot_no"),
              (overlay_get_position, pos0, ":target_obj"),
              (show_item_details_with_modifier, ":item_no", ":cur_imod", pos0, 100),
              (assign, "$g_current_opened_item_details", ":slot_no"),
            (try_end),
          (try_end),
        (else_try),
          (try_for_range, ":slot_no", 10, 106),
            (troop_slot_eq, "trp_temp_array_a", ":slot_no", ":eek:bject"),
            (try_begin),
              (eq, "$g_current_opened_item_details", ":slot_no"),
              (close_item_details),
            (try_end),
          (try_end),
        (try_end),
      (try_end),
    ]),
   
    (ti_on_presentation_event_state_change,
      [
        (store_trigger_param_1, ":eek:bject"),
        (store_trigger_param_2, ":value"),
       
        (try_for_range, ":slot_no", 0, "$g_cur_slot_no"),
          (troop_slot_eq, "trp_stack_selection_amounts", ":slot_no", ":eek:bject"),
          (troop_get_slot, "$g_selected_troop", "trp_stack_selection_ids", ":slot_no"),
          (start_presentation, "prsnt_faction_troop_trees"),
        (try_end),
       
        (try_begin),
          (eq, ":eek:bject", "$g_presentation_obj_1"),
          (store_sub, ":num_pages", npc_kingdoms_end, npc_kingdoms_begin),
          (val_add, ":num_pages", 3),
          (store_sub, "$g_selected_page", ":num_pages", ":value"),
          (val_sub, "$g_selected_page", 1),
          (assign, "$g_selected_troop", 0),
          (start_presentation, "prsnt_faction_troop_trees"),
        (else_try),
          (eq, ":eek:bject", "$g_presentation_obj_2"),
          (assign, "$g_selected_troop", 0),
          (assign, "$g_selected_page", 0),
          (presentation_set_duration, 0),
        (try_end),
      ]),
  ]),
 
Last edited by a moderator:
Complete code in presentations
Python:
  ("faction_troop_trees", 0, 0, [ (...)
  ]),
It is good that you have learned how to include code in code blocks (finally). What are you asking for right now? You have to adjust the script yourself depending on your preferences. I doubt someone will do it for you.
 
Upvote 0
After implementing the updated script, you will have to adjust (store_trigger_param_1, ":eek:bject"), (":eek:bject"); it would not be like that if you had included the presentation in code blocks. Happy find and replacing!
 
Upvote 0

pan-boroda

Knight at Arms
Please reread my latest post and try to apply the required changes. Post your new code and what happens.
My friend, thank you so much for your help. But my knowledge of the module system is very small. It's one thing to add factions, cities, and prescribe family ties, or banners for specific lords, it's another thing to change scripts and presentations.
To be honest, I have not figured out how to make the changes you indicated. I would not have touched Rubik's script if it supported more than 24 factions.
And I certainly can't configure (store_trigger_param_1, ": eek: bject"), (": eek: bject"), as the respected Veledentella advises.
In any case, thank you for your help, but it is already clear that I will not pull the creation of the mod alone (taking into account all my ideas).
 
Last edited:
Upvote 0

pan-boroda

Knight at Arms
So I tried it again in 1 day.
This is what happens when you switch to the right.
CJ0JIC3n6EPLJNu5U-nTVgwVmGac4k_X6-qW5AqKSNtOS0yn0UjrM_DMzbgxCCvxTLItz_FRzQB9R061NdJribCuxfIhl4oGJ5U5BfYkcAl3er38O29_IljYt1IXdF2jhx_rzTA0B3XtubqxW54MPC00e53JJCT7wvtjGZeyHYD-Q5Di8S5RSrhVVJzCezTMNcyL1JfQPV1RkenCyd7SBdWRgX8EOXpQC7tkIea47ppB8gCBE2wzMGyy_z7os8f8roSsr4V4Yrq_zay-eNveVgziRpx3n5Apkv12E2KnmZw5ESiZYcst6n5gbgJniqCt8UrnOI_BR4orgUlC4nwrtT-lhLnF7wTUhZmybTHrYhpOsRdN3cb-bwYVxJEkuHUL4oGZtzM-mtcLv62di0lgAuxZqWBtqLUezZriiVi0igHQSCNA2QExOy_VH-2KjMSW5rPLd1JUmaM3dKKyL7yf-LQUJxx-C7Xg-_QALOhkLa_R8OhEmL8-km3MBa3u-D_hCzGBJDWzw0qN9NgZimDSISuD9gO3Wz9oQl3NF8AAoD-nSElfcxJeZ6GyAhX4PW2tseP_hxNv8XQ2Jm2KDN2uR6qoR3ZgznBQ_JkakN43dTcw4skqNbSWDBzFyLO7vhacNgA7SuA_JHKIsA_rI4hoc2TgzNKql8NH0h94AGanoIVc2-kS_2YBtAJfbBv1QmblO2Mqv_WLxWUIVNkX40pZeg=w1622-h912-no

BXLdfD0zVNiAmVGAFj5MLjoR_PLUdz2Ew79mH2nKlDTJTwZe06M5m8M9HM9SXefXzviCXCYMwWhFbAt5amRRtJdTWCj6qghwFW8OJQvUFQ2ltkZX6hy1HHjN4fgNdAvOJpKo4sMSV5qPZhpZ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8ztRNfbRNDEI6O_HMsuOV4R0yM9UAAotJBsO2r-dQMre39L-v_Otmo1rWefrxT1uNSEPnOBDMxZeolXJUUfqbB2JisUddL-3QwZHVYRlnVvG72vHD9CX19esC1SkS-8cuPDCS9-_2owEgl4EKJH32yE2xhcS3583nkh01Tt-WkWTWxIOMKnqe7w_xda09eXGEs-SOe61mVzsPg817LHxeRyP_Pl-l4TxyO645-dswyK9TgfwtfZCUtvunmsaVNBEkRxdKrstfgjNk7exOVwNz6BdcEPVeQ0SIvXTeOzrJk8pCt5mjxytvBB_FoSSkeN2lDqio-ZDqr9h8xKblCoKr8dcLncoMh3JKG0s1X12-PUO0mV3B0W-uKt81hd8Iov2nDZEuTj_ri5riiM8x73x6xonyRtouVAsfZ6s3WgasrX4_LtiFf14AwrbQSPpkRWl9542bPB8njVeJgOLyyQrYt4SI5h5t3G5uiWRNpyRdXPG-DmpBTOGGubKGIxmR_wtHq9_t6y3WMrPbk7wcWtQlkunkLPcKX70pYqycdx8o-KURuknBUZi-kWhNl8XdE_20aOA6ISD6KL6B_eJOzH39dqH3N4DP2G-tE8AfkLMTwoUNJaqBen-k2U8s-w=w1622-h912-no

Here is the code
Python:
  ("faction_troop_trees", 0, 0, [
    (ti_on_presentation_load,
      [
        (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),
        
        (create_mesh_overlay, reg1, "mesh_load_window"),
        (position_set_x, pos1, 0),
        (position_set_y, pos1, 0),
        (overlay_set_position, reg1, pos1),
        
        ## combo_label
      (create_combo_label_overlay, "$g_presentation_obj_1"),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 690),
        (overlay_set_position, "$g_presentation_obj_1", pos1),
        
        # factions
        (store_sub, ":num_factions", npc_kingdoms_end, npc_kingdoms_begin),
        (store_add, ":num_pages", ":num_factions", 3),
        
        ## page names, from bottom to top
        (try_for_range, ":page_no", 0, ":num_factions"),             
          (store_add, ":faction_no", ":page_no", npc_kingdoms_begin),       
          (str_store_faction_name, s0, ":faction_no"),                                   
          (overlay_add_item, "$g_presentation_obj_1", s0),                         
        (try_end),
        (overlay_add_item, "$g_presentation_obj_1", "@Others"),
        (overlay_add_item, "$g_presentation_obj_1", "@Outlaws"),
        (overlay_add_item, "$g_presentation_obj_1", "@Mercenary"),               
        (store_sub, ":presentation_obj_val", ":num_pages", "$g_selected_page"),
        (val_sub, ":presentation_obj_val", 0),
        (overlay_set_val, "$g_presentation_obj_1", ":presentation_obj_val"),       

        ## back
    (create_game_button_overlay, "$g_presentation_obj_2", "@Close"),
        (position_set_x, pos1, 750),
        (position_set_y, pos1, 685),
        (overlay_set_position, "$g_presentation_obj_2", pos1),
        
        ## tips
        (create_text_overlay, reg1, "@Click the center button to toggle faction^Click the avatars to view details of them", tf_left_align),
        (position_set_x, pos1, 800),
        (position_set_y, pos1, 800),
        (overlay_set_size, reg1, pos1),
        (position_set_x, pos1, 30),
        (position_set_y, pos1, 690),
        (overlay_set_position, reg1, pos1),
        
        ## pic_arms
        (try_begin),
          (is_between, "$g_selected_page", 0, ":num_factions"),
          (store_add, ":pic_arms", "mesh_pic_arms_swadian", "$g_selected_page"),
          (create_mesh_overlay, reg1, ":pic_arms"),
          (position_set_x, pos1, 600),
          (position_set_y, pos1, 500),
          (overlay_set_position, reg1, pos1),
          (position_set_x, pos1, 600),
          (position_set_y, pos1, 600),
          (overlay_set_size, reg1, pos1),
        (try_end),
 
Upvote 0

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
Can you retry with your screenshot? It's just a big block of text ^^

And I don't think that you needed to change the (val_sub, ":presentation_obj_val", 0), line, keep it at 1 as it was before.
 
Last edited:
Upvote 0

pan-boroda

Knight at Arms
Can you retry with your screenshot? It's just a big block of text ^^

And I don't think that you needed to change the (val_sub, ":presentation_obj_val", 0), line, keep it at 1 as it was before.
In general, I sort of succeeded in part, the factions began to switch from 1 to the last...
but the branches of troops and pic_arms are displayed in reverse order.
plus the tabs of bandits, mercenaries and others have ceased to be displayed

Ogcr9bfzYU5qMBNfzX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AG_AJPtXBAXona2rXmzsHyccvXbV3KM5eVol-fP5Mo7Ize0pwCZqB1Pg7o3BI2wIEO-noZpjKfqEtKmziObdchc_m5vq8oWMugOp2u9ie6lLlFYMxcpuXyE5-7XPgJHXJmgKcyL27LgFQ1SAaPeYZeX_I3WdGwvTvY4q21aHMfAvVLZuUoEOLvBvQ5cdjEANBt25ZQyuCt6f2QRcTiDVpwKwYdK811wuIt_PRS_q1YtcBGmJxRpRee14rjxDycEdHAT5oN1iGVeaaG0DkRkTpEZ9Wp0ig75lUSRZm8gj95w-gwTTKR5kwVsW0g43IEAfNaCreBbHCLIls40VKXt9km2Av2KoxcCQ4ExQmbclwnfjJu-_fKSCgg1cRjtzhkbHfD5WmQSrm2BbkA9nmO_tbsQ7SVJVHbn9flocAV9A=w1622-h912-no

etc.

Python:
  ("faction_troop_trees", 0, 0, [
    (ti_on_presentation_load,
      [
        (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),
       
        (create_mesh_overlay, reg1, "mesh_load_window"),
        (position_set_x, pos1, 0),
        (position_set_y, pos1, 0),
        (overlay_set_position, reg1, pos1),
       
        ## combo_button
        (create_combo_label_overlay, "$g_presentation_obj_1"),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 690),
        (overlay_set_position, "$g_presentation_obj_1", pos1),
       
        # factions
        (store_sub, ":num_factions", npc_kingdoms_end, npc_kingdoms_begin),
        (store_add, ":num_pages", ":num_factions", 3),
       
        ## page names, from bottom to top
        (try_for_range, ":page_no", 0, ":num_factions"),              # Try for the range from 0 to the max number of factions, but backwards
          (store_add, ":faction_no", ":page_no", npc_kingdoms_begin),       # Add to the current page_no (remember that we start from the highest) the constant npc_kingdoms_begin, so ":faction_no" has at the beginning the highest value and goes down.
          (str_store_faction_name, s0, ":faction_no", "fac_kingdom_1"),                                    # Store the name of the faction in s0
          (overlay_add_item, "$g_presentation_obj_1", s0, "fac_kingdom_1"),                          # Show the name of the faction
        (try_end),
        (store_sub, ":presentation_obj_val", ":num_pages", "$g_selected_page"),
        (val_sub, ":presentation_obj_val", 1),
        (overlay_set_val, "$g_presentation_obj_1", ":presentation_obj_val"),
        (overlay_add_item, "$g_presentation_obj_1", "@Others"),
        (overlay_add_item, "$g_presentation_obj_1", "@Outlaws"),
        (overlay_add_item, "$g_presentation_obj_1", "@Mercenary"),                      
       
        ## back
        (create_game_button_overlay, "$g_presentation_obj_2", "@Close"),
        (position_set_x, pos1, 750),
        (position_set_y, pos1, 685),
        (overlay_set_position, "$g_presentation_obj_2", pos1),
       
        ## tips
        (create_text_overlay, reg1, "@Click the center button to toggle faction^Click the avatars to view details of them", tf_left_align),
        (position_set_x, pos1, 800),
        (position_set_y, pos1, 800),
        (overlay_set_size, reg1, pos1),
        (position_set_x, pos1, 30),
        (position_set_y, pos1, 690),
        (overlay_set_position, reg1, pos1),
       
        ## pic_arms
        (try_begin),
          (is_between, "$g_selected_page", 0, ":num_factions"),
          (store_add, ":pic_arms", "mesh_pic_arms_swadian", "$g_selected_page"),
          (create_mesh_overlay, reg1, ":pic_arms"),
          (position_set_x, pos1, 600),
          (position_set_y, pos1, 500),
          (overlay_set_position, reg1, pos1),
          (position_set_x, pos1, 600),
          (position_set_y, pos1, 600),
          (overlay_set_size, reg1, pos1),
        (try_end),

        # detect_total_max_tier, calculate offset_x
        (assign, ":total_max_tier", 1),
        (try_for_range, ":cur_troop", soldiers_begin, soldiers_end),
          (neg|troop_is_hero, ":cur_troop"),
          # can upgrade
          (troop_get_upgrade_troop, ":upgrade_troop", ":cur_troop", 0),
          (gt, ":upgrade_troop", 0),
          # page_no_for_cur_troop
          (call_script, "script_get_page_no_of_troop_tree_for_troop_on", ":cur_troop"),
          (assign, ":page_no_for_cur_troop", reg0),
          # on current page_no
          (eq, ":page_no_for_cur_troop", "$g_selected_page"),
          (assign, reg0, 1), # reg0: init max_tier to 1
          (call_script, "script_troop_tree_recursive_detect_max_tier", ":cur_troop", 1),
          (assign, ":cur_max_tier", reg0),
          (try_begin),
            (gt, ":cur_max_tier", ":total_max_tier"),
            (assign, ":total_max_tier", ":cur_max_tier"),
          (try_end),
        (try_end),
        (val_sub, ":total_max_tier", 1),
        (val_max, ":total_max_tier", 1),
        (store_div, ":offset_x", 700, ":total_max_tier"),
        (val_min, ":offset_x", 120),
       
        (str_clear, s0),
        (create_text_overlay, reg1, s0, tf_scrollable),
        (position_set_x, pos1, 15),
        (position_set_y, pos1, 15),
        (overlay_set_position, reg1, pos1),
        (position_set_x, pos1, 800),
        (position_set_y, pos1, 660),
        (overlay_set_area_size, reg1, pos1),
        (set_container_overlay, reg1),
       
        (assign, "$g_cur_slot_no", 0),
        (assign, reg2, 75),
        # find all root troops of selected faction
        (try_for_range, ":cur_troop", soldiers_begin, soldiers_end),
          (neg|troop_is_hero, ":cur_troop"),
          # can upgrade
          (troop_get_upgrade_troop, ":upgrade_troop", ":cur_troop", 0),
          (gt, ":upgrade_troop", 0),
          # page_no_for_cur_troop
          (call_script, "script_get_page_no_of_troop_tree_for_troop_on", ":cur_troop"),
          (assign, ":page_no_for_cur_troop", reg0),
          # on current page_no
          (eq, ":page_no_for_cur_troop", "$g_selected_page"),
          # can't be upgraded from other troops of the same page
          (assign, ":is_root_troop", 1),
          (assign, ":end_cond", soldiers_end),
          (try_for_range, ":loop_troop", soldiers_begin, ":end_cond"),
            (neg|troop_is_hero, ":loop_troop"),
            # page_no_for_loop_troop
            (call_script, "script_get_page_no_of_troop_tree_for_troop_on", ":loop_troop"),
            (assign, ":page_no_for_loop_troop", reg0),
            # on current page_no
            (eq,  ":page_no_for_loop_troop", "$g_selected_page"),
            (troop_get_upgrade_troop, ":upgrade_troop_1", ":loop_troop", 0),
            (troop_get_upgrade_troop, ":upgrade_troop_2", ":loop_troop", 1),
            (this_or_next|eq, ":upgrade_troop_1", ":cur_troop"),
            (eq, ":upgrade_troop_2", ":cur_troop"),
            (assign, ":is_root_troop", 0),
            (assign, ":end_cond", 0), #break
          (try_end),
          (eq, ":is_root_troop", 1), # draw troop tree of cur root_troop
          (call_script, "script_troop_tree_recursive_backtracking", ":cur_troop", 50, reg2, ":offset_x"),
          (val_add, reg2, 160),
        (try_end),

Can you retry with your screenshot? It's just a big block of text ^^
a set of letters and numbers? strange, they are displayed as screenshots
 
Last edited:
Upvote 0

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
The Others, Mercenaries and Outlaws have disappeared, because you have moved their lines even more down, for some unknown reason. Move them back to their old position.

To do it differently now:
Reverse your changes to the latest working version, at which the problem was only that clicking on right gave you the faction before and not after (so with the try_for_range_backwards). Then move the outlaws, mercenaries and others just below the try loop (and before the store_sub line!). It should then first show the kingdoms and then the rest. And no one cares which kingdoms gets shown first, so we can call it a day.
 
Upvote 0

pan-boroda

Knight at Arms
The Others, Mercenaries and Outlaws have disappeared, because you have moved their lines even more down, for some unknown reason. Move them back to their old position.

To do it differently now:
Reverse your changes to the latest working version, at which the problem was only that clicking on right gave you the faction before and not after (so with the try_for_range_backwards). Then move the outlaws, mercenaries and others just below the try loop (and before the store_sub line!). It should then first show the kingdoms and then the rest. And no one cares which kingdoms gets shown first, so we can call it a day.

Did, but unfortunately, the name of the factions, he starts showing with mercenaries, and goes in the opposite direction

-IUH1w20g6VRDxLV1g5BEhFX_gdw2b0VwsTUAcM7d9Q78k9Ds2r42niNK5LCclPgqUnU8MEvtDsemuuqSlt2TT4leeKcAqzdXwH14Po1kVTJv2tCOc1JLT8aP-inJHKEUkf69HbgtHmJ4LVHa2IMhP6PHXpDNDOebYppaUHYY7tphk4XumJ707sooqUktOhWCPd_Z2iGIII6JlEnumx8RyutelvfbHX0qtX_6TMdmqD9k8YOe6u3BzNuxbvyqc6mg3hLlJRTC112YuJ5jw5tEtT5mBdGkg892bNP_CCJ5vBGUGuFwwl1rPlP5PNR2OOFv9YPslg3eELEouWCaL2mSGpfL-2AoBYv7RuK4tWTcLi5ubH37yNh9Ftodz402JaFTIuDXlu3tFzMBsmdePEv7ot5khHH9yRDhhFtrzYZgxctpnieDfRtRb_5RbGHd1ato2Sf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ftWq7wmXEvZDjY3PhNflUykOHz_ykDn_4uGoi-VWtxkCJplCzOZytv6d6W01KBeGVMWzc32vTNMbN1IUIMtyxydrcgsB3bGJ1dwFm2sw8G8WHajsS0-m_uACd411G9Hi8iWqqh4PSASERPE9xzrzVo0upt_A13mWNapKsg1jxyalQCN6EwdD1_3UUk6UyjUILWFn6gBcROdBoGamSeAvQS08HblTm9YSpcGwSlWfYKaPj0Z1DtbpfqjnSAmAiClqfK3n42ZZT3x12j9XJUOnKNLtLDhosQaHL47p5_jggm6Fe2uAVQyLghF8wMggcyRJ8g=w1622-h912-no

code
Python:
  ("faction_troop_trees", 0, 0, [
    (ti_on_presentation_load,
      [
        (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),
      
        (create_mesh_overlay, reg1, "mesh_load_window"),
        (position_set_x, pos1, 0),
        (position_set_y, pos1, 0),
        (overlay_set_position, reg1, pos1),
      
        ## combo_label
      (create_combo_label_overlay, "$g_presentation_obj_1"),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 690),
        (overlay_set_position, "$g_presentation_obj_1", pos1),
      
        # factions
        (store_sub, ":num_factions", npc_kingdoms_end, npc_kingdoms_begin),
        (store_add, ":num_pages", ":num_factions", 3),
      
        ## page names, from bottom to top
        (try_for_range_backwards, ":page_no", 0, ":num_factions"),
          (store_add, ":faction_no", ":page_no", npc_kingdoms_begin),
          (str_store_faction_name, s0, ":faction_no"),
          (overlay_add_item, "$g_presentation_obj_1", s0),
        (try_end),
        (overlay_add_item, "$g_presentation_obj_1", "@Others"),     
        (overlay_add_item, "$g_presentation_obj_1", "@Outlaws"),
        (overlay_add_item, "$g_presentation_obj_1", "@Mercenary"),
        (store_sub, ":presentation_obj_val", ":num_pages", "$g_selected_page"),
        (val_sub, ":presentation_obj_val", 1),
        (overlay_set_val, "$g_presentation_obj_1", ":presentation_obj_val"),
      
        ## back
    (create_game_button_overlay, "$g_presentation_obj_2", "@Close"),
        (position_set_x, pos1, 750),
        (position_set_y, pos1, 685),
        (overlay_set_position, "$g_presentation_obj_2", pos1),
      
        ## tips
        (create_text_overlay, reg1, "@Click the center button to toggle faction^Click the avatars to view details of them", tf_left_align),
        (position_set_x, pos1, 800),
        (position_set_y, pos1, 800),
        (overlay_set_size, reg1, pos1),
        (position_set_x, pos1, 30),
        (position_set_y, pos1, 690),
        (overlay_set_position, reg1, pos1),
      
        ## pic_arms
        (try_begin),
          (is_between, "$g_selected_page", 0, ":num_factions"),
          (store_add, ":pic_arms", "mesh_pic_arms_swadian", "$g_selected_page"),
          (create_mesh_overlay, reg1, ":pic_arms"),
          (position_set_x, pos1, 600),
          (position_set_y, pos1, 500),
          (overlay_set_position, reg1, pos1),
          (position_set_x, pos1, 600),
          (position_set_y, pos1, 600),
          (overlay_set_size, reg1, pos1),
        (try_end),
 
Upvote 0

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
Then you just have to live with the fact that a left click brings the next faction and a right click the faction before. It won't matter a lot. It's not like people use that presentation all the time, they get used to it.
 
Upvote 0
@pan-boroda, the screenshots are not displayed, so I cannot see where the problem lies; maybe try another image hosting site. Also, all you have to do is find ":eek:bject" and replace it with ":object" within the script.
 
Upvote 0

pan-boroda

Knight at Arms
@pan-boroda, the screenshots are not displayed, so I cannot see where the problem lies; maybe try another image hosting site. Also, all you have to do is find ":eek:bject" and replace it with ":object" within the script.
I've been trying hosting for 4, including google.
is the picture normal now?
mb65.jpg

Sorry, I didn't quite understand what to find ...
Code:
":eek:bject"
??? and change it to
Code:
":object"
?
 
Last edited:
Upvote 0
I've been trying hosting for 4, including google.
is the picture normal now?
No, it is not. Imgur is the most popular site for hosting images; I personally use PostImages and I like it.

If you have used a brand new copy of the script, then you have nothing to search for/ replace. I was talking about ":eek:bject" with respect to ":object" modified by TW forum's text parser.
 
Upvote 0
Top Bottom