OSP Code SP Perfect troop tree presentation

Users who are viewing this thread

Caripija_XV

Recruit
To remove the mercenaries, bandits and others, simply remove the lines for them and the line with which you add 3 to the count of factions.
Code:
        ## 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", "@Mercenary"), <---
        (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"),
This line is responsible for which troops are getting shown. Introduce new constants and if-clauses by yourself, to adjust it to your likings.
Code:
        (try_for_range, ":cur_troop", soldiers_begin, soldiers_end),
so that's why even when removing those lines it showed the bandits but on other civilization tabs instead of removing them alltogether, also I can't remove the (store_add, ":num_pages", ":num_factions", 3) because that will throw a warning, so instead I change it to zero. i'll try rearranging the soldier begin and soldier end counter and I will come back after it works.
 

Caripija_XV

Recruit
To remove the mercenaries, bandits and others, simply remove the lines for them and the line with which you add 3 to the count of factions.
Code:
        ## 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", "@Mercenary"), <---
        (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"),
This line is responsible for which troops are getting shown. Introduce new constants and if-clauses by yourself, to adjust it to your likings.
Code:
        (try_for_range, ":cur_troop", soldiers_begin, soldiers_end),
there, it works now, you forgot to tell me that I need to remove the following line
(val_add, ":num_pages", 3),
this is on the end of the code, I guess most of my problems are me figuring out the solution, still thanks for your help.
 
Top Bottom