OSP Code MP Killstreaks and statistics

Users who are viewing this thread

1. Introduction

Alright, this OSP will be massive. The modding scene of Warband seems to have gone pretty extinct as of late, so I guess I may give people some goodies before I leave it altogether (as a New Year 2022 present; happy new year!). Before getting rid of all Warband-related stuff, I think it is nice to salvage some stuff I deem worthy enough to share and which will not disrupt balance in MP. Here is a bundle of MP scripts related to one another that I wrote for my mod Varena NeoGK (https://forums.taleworlds.com/index.php?threads/varena-neogk.447294/); they deal with killstreaks and statistics in general. Maybe someone will find them useful, who knows?

To know what I am talking about, here are some pictures of:
  1. Killfeed killstreak messages
    20211111073828-1.jpg
  2. Session statistics presentation
    20211112084437-1.jpg
  3. Lifetime statistics presentation
    20211111180504-1.jpg
They were written for MP, so some adjustments may be needed to port them to SP or adjust to some other non-Native modules.

2. License

I created the scripts all alone from scratch, therefore giving me credit is mandatory. All adjustments or big modifications may be done at one's discretion, whatever they want to do with the scripts. They may (they work perfectly in Native MP) exhibit some worse scripting than if a professional wrote them, therefore they are provided as they are. I do not want to receive suggestions or improvement solutions regarding them, so respect that please.

3. The scripts and their installation and properties

  • The below script's description from Varena NeoGK's thread linked above: Lifetime statistics conveniently showing important information during gameplay (kills are the only thing not present across all gamemodes - disabled in Invasion for obvious reasons - slaying bots is easy and would spam the killfeed/ display inflated amount of kills).
Python:
("lifetime_statistics", prsntf_read_only|prsntf_manual_end_only, 0, [
         (ti_on_presentation_load,
         [(presentation_set_duration, 99999),
         (set_fixed_point_multiplier, 1000),
        
         (create_mesh_overlay, reg0, "mesh_white_plane"),
         (overlay_set_color, reg0, 0x000000),
         (overlay_set_alpha, reg0, 0x35),
         (position_set_x, pos1, 10),
         (position_set_y, pos1, 530),
         (overlay_set_position, reg0, pos1),
         (position_set_x, pos1, 12150),
         (position_set_y, pos1, 5030),
         (overlay_set_size, reg0, pos1),
        
         (create_mesh_overlay, reg0, "mesh_white_plane"),
         (overlay_set_color, reg0, 0xE07910),
         (overlay_set_alpha, reg0, 0xE3),
         (position_set_x, pos1, 10),
         (position_set_y, pos1, 610),
         (overlay_set_position, reg0, pos1),
         (position_set_x, pos1, 12150),
         (position_set_y, pos1, 50),
         (overlay_set_size, reg0, pos1),
        
         (create_text_overlay, "$g_presentation_obj_lifetime_statistics_1", "str_empty_string", tf_with_outline),
         (overlay_set_color, "$g_presentation_obj_lifetime_statistics_1", 0xE07910),
         (position_set_x, pos1, 5),
         (position_set_y, pos1, 610),
         (overlay_set_position, "$g_presentation_obj_lifetime_statistics_1", pos1),
         (position_set_x, pos1, 700),
         (position_set_y, pos1, 700),
         (overlay_set_size, "$g_presentation_obj_lifetime_statistics_1", pos1),
        
         (create_text_overlay, "$g_presentation_obj_lifetime_statistics_2", "str_empty_string", tf_with_outline),
         (overlay_set_color, "$g_presentation_obj_lifetime_statistics_2", 0xFFFFFF),
         (position_set_x, pos1, 5),
         (position_set_y, pos1, 590),
         (overlay_set_position, "$g_presentation_obj_lifetime_statistics_2", pos1),
         (position_set_x, pos1, 700),
         (position_set_y, pos1, 700),
         (overlay_set_size, "$g_presentation_obj_lifetime_statistics_2", pos1),
        
         (create_text_overlay, "$g_presentation_obj_lifetime_statistics_3", "str_empty_string", tf_with_outline),
         (overlay_set_color, "$g_presentation_obj_lifetime_statistics_3", 0xFFFFFF),
         (position_set_x, pos1, 5),
         (position_set_y, pos1, 570),
         (overlay_set_position, "$g_presentation_obj_lifetime_statistics_3", pos1),
         (position_set_x, pos1, 700),
         (position_set_y, pos1, 700),
         (overlay_set_size, "$g_presentation_obj_lifetime_statistics_3", pos1),
        
         (create_text_overlay, "$g_presentation_obj_lifetime_statistics_4", "str_empty_string", tf_with_outline),
         (overlay_set_color, "$g_presentation_obj_lifetime_statistics_4", 0xFFFFFF),
         (position_set_x, pos1, 5),
         (position_set_y, pos1, 550),
         (overlay_set_position, "$g_presentation_obj_lifetime_statistics_4", pos1),
         (position_set_x, pos1, 700),
         (position_set_y, pos1, 700),
         (overlay_set_size, "$g_presentation_obj_lifetime_statistics_4", pos1),
        
         (create_text_overlay, "$g_presentation_obj_lifetime_statistics_5", "str_empty_string", tf_with_outline),
         (overlay_set_color, "$g_presentation_obj_lifetime_statistics_5", 0xFFFFFF),
         (position_set_x, pos1, 5),
         (position_set_y, pos1, 530),
         (overlay_set_position, "$g_presentation_obj_lifetime_statistics_5", pos1),
         (position_set_x, pos1, 700),
         (position_set_y, pos1, 700),
         (overlay_set_size, "$g_presentation_obj_lifetime_statistics_5", pos1),
        
         ]),
        
       (ti_on_presentation_run,
       [
       (try_begin),
        (eq, "$g_display_lifetimestatistics", 0), #another presentation may be made to handle when this one is displayed or not
        (presentation_set_duration, 0),
       (else_try),
        (multiplayer_get_my_player, ":my_pl"),
        (multiplayer_get_my_team, ":my_team"),
        (multiplayer_get_my_troop, ":my_tr"),
        
        (gt, ":my_pl", -1),
        
         (str_store_string, s2, "@Lifetime statistics"),
         (overlay_set_text, "$g_presentation_obj_lifetime_statistics_1", s2),
        
         (try_begin),
            (is_between, ":my_tr", multiplayer_troops_begin, multiplayer_troops_end),
            (str_store_troop_name, s1, ":my_tr"), #troop
         (else_try),
            (this_or_next|eq, ":my_team", multi_team_spectator),
            (eq, ":my_team", multi_team_unassigned),
            (str_store_string, s1, "@Spectator"), #including spectators as well
         (else_try),
            (eq, ":my_tr", -1),
            (str_store_string, s1, "@Not decided yet"), #including state change after choosing a faction
         (try_end),
        
         (str_store_string, s2, "@Name of the troop: {s1}"),
         (overlay_set_text, "$g_presentation_obj_lifetime_statistics_2", s2),
        
         (player_get_ping, reg1, ":my_pl"), #ping
         (str_store_string, s2, "@Ping (miliseconds): {reg1}"),
         (overlay_set_text, "$g_presentation_obj_lifetime_statistics_3", s2),
        
         (assign, reg1, 0),
        
         (assign, ":time", "$g_lifetime_statistics_time_alive"), #time since last death in minutes (including seconds like in session statistics would be too much)
         (val_div, ":time", 60),
         (assign, reg1, ":time"),
         (str_store_string, s2, "@Time survived (minutes): {reg1}"),
         (overlay_set_text, "$g_presentation_obj_lifetime_statistics_4", s2),
        
         (assign, reg1, 0),
        
         (try_begin),
            (eq, "$g_multiplayer_game_type", multiplayer_game_type_captain_coop),
            (str_store_string, s2, "@Lifetime kills: not counted in Invasion mode"), #self-explanatory
         (else_try),
            (assign, reg1, "$g_player_controlled_agent_kill_count"),
            (str_store_string, s2, "@Lifetime kills: {reg1}"),
         (try_end),
        
         (overlay_set_text, "$g_presentation_obj_lifetime_statistics_5", s2),
        
        (try_end),
        ]),
        
       ]),

  • The below scripts' description from Varena NeoGK's thread linked above: Killfeed messages upon being spawned, slain and killing others (the latter get colored as killstreak progresses; teamkills count as well - disabled in Invasion for obvious reasons - slaying bots is easy and would spam the killfeed/ display inflated amount of kills).
Python:
session_statistics_agent_dead = (ti_on_agent_killed_or_wounded, 0, 0, [],
          [
          (neg|multiplayer_is_dedicated_server),
          (store_trigger_param_1, ":dead_agent_no"),
          
          (neq, "$g_multiplayer_game_type", multiplayer_game_type_captain_coop), #invasion-forbidden
          
          (multiplayer_get_my_player, ":my_player_no"),
          (player_get_agent_id, ":player_agent", ":my_player_no"),
          
          (eq, ":dead_agent_no", ":player_agent"),
          
          (multiplayer_get_my_troop, ":my_troop_no"),
          (multiplayer_get_my_team, ":my_team"),
          (team_get_faction, ":faction", ":my_team"),
          
          (is_between, ":my_troop_no", multiplayer_troops_begin, multiplayer_troops_end),
          (call_script, "script_multiplayer_get_troop_class", ":my_troop_no"),
          (assign, ":class", reg0),
          
          (try_begin),
             (agent_is_active, ":dead_agent_no"),
                (try_begin),
                   (le, ":class", multi_troop_class_spearman),
                   (val_add, "$g_session_statistics_death_count_infantry", 1),
                (else_try),
                   (eq, ":class", multi_troop_class_cavalry),
                   (val_add, "$g_session_statistics_death_count_cavalry", 1),
                (else_try),
                   (ge, ":class", multi_troop_class_archer),
                   (val_add, "$g_session_statistics_death_count_ranged", 1),
                (try_end),
          (try_end),
          
          (try_begin),
             (agent_is_active, ":dead_agent_no"),
                (try_begin),
                   (eq, ":faction", "fac_kingdom_1"),
                   (val_add, "$g_session_statistics_death_count_swadians", 1),
                (else_try),
                   (eq, ":faction", "fac_kingdom_2"),
                   (val_add, "$g_session_statistics_death_count_vaegirs", 1),
                (else_try),
                   (eq, ":faction", "fac_kingdom_3"),
                   (val_add, "$g_session_statistics_death_count_khergits", 1),
                (else_try),
                   (eq, ":faction", "fac_kingdom_4"),
                   (val_add, "$g_session_statistics_death_count_nords", 1),
                (else_try),
                   (eq, ":faction", "fac_kingdom_5"),
                   (val_add, "$g_session_statistics_death_count_rhodoks", 1),
                (else_try),
                   (eq, ":faction", "fac_kingdom_6"),
                   (val_add, "$g_session_statistics_death_count_sarranids", 1),
                (try_end),
          (try_end),
          
          ])

session_statistics_agent_dead_store_kill_count = (ti_on_agent_killed_or_wounded, 0, 0, [],
          [
          (neg|multiplayer_is_dedicated_server),
          (store_trigger_param_1, ":slain_agent_no"),
          (store_trigger_param_2, ":attacker_agent_no"),
          
          (neq, "$g_multiplayer_game_type", multiplayer_game_type_captain_coop), #invasion-forbidden
          
          #the below is for making killstreaks be not counted in spec mode
          (multiplayer_get_my_team, ":my_team"), #printing messages with 1 kill when not alive - fix
          (neq, ":my_team", multi_team_spectator), 
          (neq, ":my_team", multi_team_unassigned),
          
          (gt, ":slain_agent_no", -1),
          (gt, ":attacker_agent_no", -1),
          
          (agent_is_human, ":slain_agent_no"),
          (agent_is_human, ":attacker_agent_no"),
          
          (multiplayer_get_my_player, ":my_player_no"),
          (player_get_agent_id, ":player_agent", ":my_player_no"),
          (eq, ":attacker_agent_no", ":player_agent"),
          
          (neq, ":slain_agent_no", ":player_agent"),
          (agent_get_team, ":team_of_a_victim", ":slain_agent_no"),
          
          (multiplayer_get_my_troop, ":my_troop_no"),
          (multiplayer_get_my_team, ":my_team"),
          (team_get_faction, ":faction", ":my_team"),
          
          (is_between, ":my_troop_no", multiplayer_troops_begin, multiplayer_troops_end),
          (call_script, "script_multiplayer_get_troop_class", ":my_troop_no"),
          (assign, ":class", reg0),
          
          (try_begin),
             (agent_is_active, ":slain_agent_no"),
                (try_begin),
                   (this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_deathmatch), #in DM and Duel everyone is in their own team even though factions are shared, therefore it must have been reflected here
                   (eq, "$g_multiplayer_game_type", multiplayer_game_type_duel),
                      (try_begin),
                         (le, ":class", multi_troop_class_spearman),
                         (val_add, "$g_session_statistics_kill_count_infantry", 1),
                      (else_try),
                         (eq, ":class", multi_troop_class_cavalry),
                         (val_add, "$g_session_statistics_kill_count_cavalry", 1),
                      (else_try),
                         (ge, ":class", multi_troop_class_archer),
                         (val_add, "$g_session_statistics_kill_count_ranged", 1),
                      (try_end),
                (else_try),
                   (neq, "$g_multiplayer_game_type", multiplayer_game_type_deathmatch),
                   (neq, "$g_multiplayer_game_type", multiplayer_game_type_duel),
                      (try_begin),
                         (neq, ":my_team", ":team_of_a_victim"),
                            (try_begin),
                               (le, ":class", multi_troop_class_spearman),
                               (val_add, "$g_session_statistics_kill_count_infantry", 1),
                            (else_try),
                               (eq, ":class", multi_troop_class_cavalry),
                               (val_add, "$g_session_statistics_kill_count_cavalry", 1),
                            (else_try),
                               (ge, ":class", multi_troop_class_archer),
                               (val_add, "$g_session_statistics_kill_count_ranged", 1),
                            (try_end),
                      (else_try),
                         (eq, ":my_team", ":team_of_a_victim"),
                            (try_begin),
                               (le, ":class", multi_troop_class_spearman),
                               (val_sub, "$g_session_statistics_kill_count_infantry", 1),
                            (else_try),
                               (eq, ":class", multi_troop_class_cavalry),
                               (val_sub, "$g_session_statistics_kill_count_cavalry", 1),
                            (else_try),
                               (ge, ":class", multi_troop_class_archer),
                               (val_sub, "$g_session_statistics_kill_count_ranged", 1),
                            (try_end),
                      (try_end),
                (try_end),
          (try_end),
          
          (try_begin),
             (agent_is_active, ":slain_agent_no"),
                (try_begin),
                   (this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_deathmatch),
                   (eq, "$g_multiplayer_game_type", multiplayer_game_type_duel),
                      (try_begin),
                         (eq, ":faction", "fac_kingdom_1"),
                         (val_add, "$g_session_statistics_kill_count_swadians", 1),
                      (else_try),
                         (eq, ":faction", "fac_kingdom_2"),
                         (val_add, "$g_session_statistics_kill_count_vaegirs", 1),
                      (else_try),
                         (eq, ":faction", "fac_kingdom_3"),
                         (val_add, "$g_session_statistics_kill_count_khergits", 1),
                      (else_try),
                         (eq, ":faction", "fac_kingdom_4"),
                         (val_add, "$g_session_statistics_kill_count_nords", 1),
                      (else_try),
                         (eq, ":faction", "fac_kingdom_5"),
                         (val_add, "$g_session_statistics_kill_count_rhodoks", 1),
                      (else_try),
                         (eq, ":faction", "fac_kingdom_6"),
                         (val_add, "$g_session_statistics_kill_count_sarranids", 1),
                      (try_end),
                (else_try),
                   (neq, "$g_multiplayer_game_type", multiplayer_game_type_deathmatch),
                   (neq, "$g_multiplayer_game_type", multiplayer_game_type_duel),
                      (try_begin),
                         (neq, ":my_team", ":team_of_a_victim"),
                            (try_begin),
                               (eq, ":faction", "fac_kingdom_1"),
                               (val_add, "$g_session_statistics_kill_count_swadians", 1),
                            (else_try),
                               (eq, ":faction", "fac_kingdom_2"),
                               (val_add, "$g_session_statistics_kill_count_vaegirs", 1),
                            (else_try),
                               (eq, ":faction", "fac_kingdom_3"),
                               (val_add, "$g_session_statistics_kill_count_khergits", 1),
                            (else_try),
                               (eq, ":faction", "fac_kingdom_4"),
                               (val_add, "$g_session_statistics_kill_count_nords", 1),
                            (else_try),
                               (eq, ":faction", "fac_kingdom_5"),
                               (val_add, "$g_session_statistics_kill_count_rhodoks", 1),
                            (else_try),
                               (eq, ":faction", "fac_kingdom_6"),
                               (val_add, "$g_session_statistics_kill_count_sarranids", 1),
                            (try_end),
                      (else_try),
                         (eq, ":my_team", ":team_of_a_victim"),
                            (try_begin),
                               (eq, ":faction", "fac_kingdom_1"),
                               (val_sub, "$g_session_statistics_kill_count_swadians", 1),
                            (else_try),
                               (eq, ":faction", "fac_kingdom_2"),
                               (val_sub, "$g_session_statistics_kill_count_vaegirs", 1),
                            (else_try),
                               (eq, ":faction", "fac_kingdom_3"),
                               (val_sub, "$g_session_statistics_kill_count_khergits", 1),
                            (else_try),
                               (eq, ":faction", "fac_kingdom_4"),
                               (val_sub, "$g_session_statistics_kill_count_nords", 1),
                            (else_try),
                               (eq, ":faction", "fac_kingdom_5"),
                               (val_sub, "$g_session_statistics_kill_count_rhodoks", 1),
                            (else_try),
                               (eq, ":faction", "fac_kingdom_6"),
                               (val_sub, "$g_session_statistics_kill_count_sarranids", 1),
                            (try_end),
                      (try_end),
                (try_end),
          (try_end),
          
          ])

session_statistics_time_alive = (1, 0, 0, [],
          [
          (neg|multiplayer_is_dedicated_server),
          
          (multiplayer_get_my_player, ":my_player_no"),
          (player_get_agent_id, ":player_agent", ":my_player_no"),
          (multiplayer_get_my_troop, ":my_troop_no"),
          (multiplayer_get_my_team, ":my_team"),
          (team_get_faction, ":faction", ":my_team"),
          
          (is_between, ":my_troop_no", multiplayer_troops_begin, multiplayer_troops_end),
          (call_script, "script_multiplayer_get_troop_class", ":my_troop_no"),
          (assign, ":class", reg0),
          
          (try_begin),
             (agent_is_active, ":player_agent"),
             (agent_is_alive, ":player_agent"),
                (try_begin),
                   (le, ":class", multi_troop_class_spearman),
                   (val_add, "$g_session_statistics_time_alive_infantry", 1), #+1 sec
                (else_try),
                   (eq, ":class", multi_troop_class_cavalry),
                   (val_add, "$g_session_statistics_time_alive_cavalry", 1), #+1 sec
                (else_try),
                   (ge, ":class", multi_troop_class_archer),
                   (val_add, "$g_session_statistics_time_alive_ranged", 1), #+1 sec
                (try_end),
          (try_end),
          
          (try_begin),
             (agent_is_active, ":player_agent"),
             (agent_is_alive, ":player_agent"),
                (try_begin),
                   (eq, ":faction", "fac_kingdom_1"),
                   (val_add, "$g_session_statistics_time_alive_swadians", 1), #+1 sec
                (else_try),
                   (eq, ":faction", "fac_kingdom_2"),
                   (val_add, "$g_session_statistics_time_alive_vaegirs", 1), #+1 sec
                (else_try),
                   (eq, ":faction", "fac_kingdom_3"),
                   (val_add, "$g_session_statistics_time_alive_khergits", 1), #+1 sec
                (else_try),
                   (eq, ":faction", "fac_kingdom_4"),
                   (val_add, "$g_session_statistics_time_alive_nords", 1), #+1 sec
                (else_try),
                   (eq, ":faction", "fac_kingdom_5"),
                   (val_add, "$g_session_statistics_time_alive_rhodoks", 1), #+1 sec
                (else_try),
                   (eq, ":faction", "fac_kingdom_6"),
                   (val_add, "$g_session_statistics_time_alive_sarranids", 1), #+1 sec
                (try_end),
          (try_end),
          
          ])

lifetime_statistics_time_alive = (1, 0, 0, [],
          [
          (neg|multiplayer_is_dedicated_server),
        
          (multiplayer_get_my_player, ":my_player_no"),
          (player_get_agent_id, ":player_agent", ":my_player_no"),
          
          (try_begin),
             (agent_is_active, ":player_agent"),
             (agent_is_alive, ":player_agent"),
             (val_add, "$g_lifetime_statistics_time_alive", 1), #+1 sec
          (try_end),
          
          ])

lifetime_statistics_agent_alive = (ti_on_agent_spawn, 0, 0, [],
          [
          (neg|multiplayer_is_dedicated_server),
          (store_trigger_param_1, ":alive_agent_no"),
          
          (multiplayer_get_my_player, ":my_player_no"),
          (player_get_agent_id, ":player_agent", ":my_player_no"),
          
          (eq, ":alive_agent_no", ":player_agent"),
          (display_message, "@You have been spawned",0x4D9617),
          (assign, "$g_player_controlled_agent_kill_count", 0), #setting values to 0 for the duration of player's life upon spawn
          (assign, "$g_lifetime_statistics_time_alive", 0),
          ])

lifetime_statistics_agent_dead = (ti_on_agent_killed_or_wounded, 0, 0, [],
          [
          (neg|multiplayer_is_dedicated_server),
          (store_trigger_param_1, ":dead_agent_no"),
          
          (multiplayer_get_my_player, ":my_player_no"),
          (player_get_agent_id, ":player_agent", ":my_player_no"),
          
          (eq, ":dead_agent_no", ":player_agent"),
          (display_message, "@You have been slain",0xC3342C),
          
          ])

lifetime_statistics_agent_dead_store_kill_count = (ti_on_agent_killed_or_wounded, 0, 0, [],
          [
          (neg|multiplayer_is_dedicated_server),
          (store_trigger_param_1, ":slain_agent_no"),
          (store_trigger_param_2, ":attacker_agent_no"),
          
          (neq, "$g_multiplayer_game_type", multiplayer_game_type_captain_coop), #invasion-forbidden
          
          #the below is for making killstreaks be not counted in spec mode - refer to this if it hasn't been fixed already
          (multiplayer_get_my_team, ":my_team"), #printing messages with 1 kill when not alive - fix
          (neq, ":my_team", multi_team_spectator),
          (neq, ":my_team", multi_team_unassigned),
          
          (gt, ":slain_agent_no", -1),
          (gt, ":attacker_agent_no", -1),
          
          (agent_is_human, ":slain_agent_no"),
          (agent_is_human, ":attacker_agent_no"),
          
          (multiplayer_get_my_player, ":my_player_no"),
          (player_get_agent_id, ":player_agent", ":my_player_no"),
          (eq, ":attacker_agent_no", ":player_agent"),
          
          (neq, ":slain_agent_no", ":player_agent"),
          (agent_get_team, ":team_of_a_victim", ":slain_agent_no"),
          
          (try_begin),
             (agent_is_active, ":slain_agent_no"),
                (try_begin),
                   (this_or_next|eq, "$g_multiplayer_game_type", multiplayer_game_type_deathmatch),
                   (eq, "$g_multiplayer_game_type", multiplayer_game_type_duel),
                   (val_add, "$g_player_controlled_agent_kill_count", 1),
                (else_try),
                   (neq, "$g_multiplayer_game_type", multiplayer_game_type_deathmatch),
                   (neq, "$g_multiplayer_game_type", multiplayer_game_type_duel),
                      (try_begin),
                         (neq, ":my_team", ":team_of_a_victim"),
                         (val_add, "$g_player_controlled_agent_kill_count", 1),
                      (else_try),
                         (eq, ":my_team", ":team_of_a_victim"),
                         (val_sub, "$g_player_controlled_agent_kill_count", 1),
                      (try_end),
                (try_end),
          (try_end),
            
          (assign, reg3, "$g_player_controlled_agent_kill_count"),
          
#the below options include different stages of killstreak as well as distinction between singular and plural forms paired with values

          (try_begin),
             (le, reg3, -2),
             (display_message, "@{reg3} kills so far",0xEE1B5B),
          (else_try),
             (eq, reg3, -1),
             (display_message, "@{reg3} kill so far",0xB4006E),
          (else_try),
             (eq, reg3, 0),
             (display_message, "@{reg3} kills so far",0xB4006E),
          (else_try),
             (eq, reg3, 1),
             (display_message, "@{reg3} kill so far",0xB7DC18),
          (else_try),
             (is_between, reg3, 2, 6),
             (display_message, "@{reg3} kills so far",0xB7DC18),
          (else_try),
             (is_between, reg3, 6, 11),
             (display_message, "@{reg3} kills so far",0xDCBD18),
          (else_try),
             (is_between, reg3, 11, 16),
             (display_message, "@{reg3} kills so far",0xDC7018),
          (else_try),
             (ge, reg3, 16),
             (display_message, "@{reg3} kills so far",0xDC3918),
          (try_end),
          
          ])
 
Continuing from the previous post due to the length limit

  • The below script's description from Varena NeoGK's thread linked above: Session statistics counting ratio of kills/ deaths and time spent of playing in a session with a breakdown per factions and classes (be careful - due to an engine property, values get erased upon navigating back to the main menu, therefore for their preservation, you may want to stay in the MP menu; also - Khergit Lancers are counted as infantry (Dismounted Lancers) due to an engine bug taking the class from SP).
Python:
("madmin_varena_session_statistics", prsntf_manual_end_only, 0, [ #not counting deaths due to autobalance since they occur too rarely to make a big difference

      (ti_on_presentation_load,
         [(set_fixed_point_multiplier, 1000),
          (presentation_set_duration, 999999),
          
      (create_mesh_overlay, reg0, "mesh_cb_ui_main"), #to avoid clipping, the background mesh needs to be put within ti_on_presentation_load instead of after prsntf_manual_end_only
      (position_set_x, pos1, 0),
      (position_set_y, pos1, 0),
      (overlay_set_position, reg0, pos1),
        
        (assign, ":class_color", 0xD7CC88),
        
###########################################################################
################################K/D values#################################
###########################################################################

          (assign, ":kdv_y_pos_difference", 90),
          (assign, ":kdv_y_pos_initial", 50),
          
          (assign, ":kdv_y_pos_difference_central", 90),
          (assign, ":kdv_y_pos_initial_central", 50),
          
          (assign, ":kdv_x_pos_right", 880),
          (assign, ":kdv_x_pos_right_center", 770),
          
          (assign, ":kdv_y_pos_size", 800),
          (assign, ":kdv_x_pos_size", 800),
          
        (create_text_overlay, "$g_total_kdv", "str_session_statistics_kdv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_total_kdv", 0xBEC219), #total
        (position_set_x, pos1, 1200),
        (position_set_y, pos1, 1200),
        (overlay_set_size, "$g_total_kdv", pos1),
        (position_set_x, pos1, 750),
        (position_set_y, pos1, 550),
        (overlay_set_position, "$g_total_kdv", pos1),
        
        (create_text_overlay, "$g_inf_kdv", "str_session_statistics_kdv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_inf_kdv", ":class_color"), #infantry
        (position_set_x, pos1, ":kdv_x_pos_size"),
        (position_set_y, pos1, ":kdv_y_pos_size"),
        (overlay_set_size, "$g_inf_kdv", pos1),
        (position_set_x, pos1, ":kdv_x_pos_right_center"),
        (position_set_y, pos1, ":kdv_y_pos_initial_central"),
        (overlay_set_position, "$g_inf_kdv", pos1),
        
        (val_add, ":kdv_y_pos_initial_central", ":kdv_y_pos_difference_central"),
        
        (create_text_overlay, "$g_ranged_kdv", "str_session_statistics_kdv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_ranged_kdv", ":class_color"), #ranged
        (position_set_x, pos1, ":kdv_x_pos_size"),
        (position_set_y, pos1, ":kdv_y_pos_size"),
        (overlay_set_size, "$g_ranged_kdv", pos1),
        (position_set_x, pos1, ":kdv_x_pos_right_center"),
        (position_set_y, pos1, ":kdv_y_pos_initial_central"),
        (overlay_set_position, "$g_ranged_kdv", pos1),
        
        (val_add, ":kdv_y_pos_initial_central", ":kdv_y_pos_difference_central"),
        
        (create_text_overlay, "$g_cav_kdv", "str_session_statistics_kdv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_cav_kdv", ":class_color"), #cavalry
        (position_set_x, pos1, ":kdv_x_pos_size"),
        (position_set_y, pos1, ":kdv_y_pos_size"),
        (overlay_set_size, "$g_cav_kdv", pos1),
        (position_set_x, pos1, ":kdv_x_pos_right_center"),
        (position_set_y, pos1, ":kdv_y_pos_initial_central"),
        (overlay_set_position, "$g_cav_kdv", pos1),
        
        (create_text_overlay, "$g_sw_kdv", "str_session_statistics_kdv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_sw_kdv", 0xFFEE7744), #sw
        (position_set_x, pos1, ":kdv_x_pos_size"),
        (position_set_y, pos1, ":kdv_y_pos_size"),
        (overlay_set_size, "$g_sw_kdv", pos1),
        (position_set_x, pos1, ":kdv_x_pos_right"),
        (position_set_y, pos1, ":kdv_y_pos_initial"),
        (overlay_set_position, "$g_sw_kdv", pos1),
        
        (val_add, ":kdv_y_pos_initial", ":kdv_y_pos_difference"),
        
        (create_text_overlay, "$g_sarr_kdv", "str_session_statistics_kdv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_sarr_kdv", 0xFFDDDD33), #sarr
        (position_set_x, pos1, ":kdv_x_pos_size"),
        (position_set_y, pos1, ":kdv_y_pos_size"),
        (overlay_set_size, "$g_sarr_kdv", pos1),
        (position_set_x, pos1, ":kdv_x_pos_right"),
        (position_set_y, pos1, ":kdv_y_pos_initial"),
        (overlay_set_position, "$g_sarr_kdv", pos1),
        
        (val_add, ":kdv_y_pos_initial", ":kdv_y_pos_difference"),
        
        (create_text_overlay, "$g_rh_kdv", "str_session_statistics_kdv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_rh_kdv", 0xFF33DD33), #rh
        (position_set_x, pos1, ":kdv_x_pos_size"),
        (position_set_y, pos1, ":kdv_y_pos_size"),
        (overlay_set_size, "$g_rh_kdv", pos1),
        (position_set_x, pos1, ":kdv_x_pos_right"),
        (position_set_y, pos1, ":kdv_y_pos_initial"),
        (overlay_set_position, "$g_rh_kdv", pos1),
        
        (val_add, ":kdv_y_pos_initial", ":kdv_y_pos_difference"),
        
        (create_text_overlay, "$g_kh_kdv", "str_session_statistics_kdv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_kh_kdv", 0xFFCC99FF), #kh
        (position_set_x, pos1, ":kdv_x_pos_size"),
        (position_set_y, pos1, ":kdv_y_pos_size"),
        (overlay_set_size, "$g_kh_kdv", pos1),
        (position_set_x, pos1, ":kdv_x_pos_right"),
        (position_set_y, pos1, ":kdv_y_pos_initial"),
        (overlay_set_position, "$g_kh_kdv", pos1),
        
        (val_add, ":kdv_y_pos_initial", ":kdv_y_pos_difference"),
        
        (create_text_overlay, "$g_v_kdv", "str_session_statistics_kdv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_v_kdv", 0xFFCCBB99), #v
        (position_set_x, pos1, ":kdv_x_pos_size"),
        (position_set_y, pos1, ":kdv_y_pos_size"),
        (overlay_set_size, "$g_v_kdv", pos1),
        (position_set_x, pos1, ":kdv_x_pos_right"),
        (position_set_y, pos1, ":kdv_y_pos_initial"),
        (overlay_set_position, "$g_v_kdv", pos1),
        
        (val_add, ":kdv_y_pos_initial", ":kdv_y_pos_difference"),
        
        (create_text_overlay, "$g_n_kdv", "str_session_statistics_kdv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_n_kdv", 0xFF33DDDD), #n
        (position_set_x, pos1, ":kdv_x_pos_size"),
        (position_set_y, pos1, ":kdv_y_pos_size"),
        (overlay_set_size, "$g_n_kdv", pos1),
        (position_set_x, pos1, ":kdv_x_pos_right"),
        (position_set_y, pos1, ":kdv_y_pos_initial"),
        (overlay_set_position, "$g_n_kdv", pos1),

###########################################################################
################################K/D values#################################
###########################################################################

###########################################################################
################################Time values################################
###########################################################################
        
          (assign, ":tv_y_pos_difference", 90),
          (assign, ":tv_y_pos_initial", 50),
          
          (assign, ":tv_y_pos_difference_central", 90),
          (assign, ":tv_y_pos_initial_central", 50),
          
          (assign, ":tv_x_pos_left", 120),
          (assign, ":tv_x_pos_left_center", 230),
          
          (assign, ":tv_y_pos_size", 800),
          (assign, ":tv_x_pos_size", 800),
          
        (create_text_overlay, "$g_total_tv", "str_session_statistics_tv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_total_tv", 0xBEC219), #total
        (position_set_x, pos1, 1200),
        (position_set_y, pos1, 1200),
        (overlay_set_size, "$g_total_tv", pos1),
        (position_set_x, pos1, 250),
        (position_set_y, pos1, 550),
        (overlay_set_position, "$g_total_tv", pos1),
        
        (create_text_overlay, "$g_inf_tv", "str_session_statistics_tv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_inf_tv", ":class_color"), #infantry
        (position_set_x, pos1, ":tv_x_pos_size"),
        (position_set_y, pos1, ":tv_y_pos_size"),
        (overlay_set_size, "$g_inf_tv", pos1),
        (position_set_x, pos1, ":tv_x_pos_left_center"),
        (position_set_y, pos1, ":tv_y_pos_initial_central"),
        (overlay_set_position, "$g_inf_tv", pos1),
        
        (val_add, ":tv_y_pos_initial_central", ":tv_y_pos_difference_central"),
        
        (create_text_overlay, "$g_ranged_tv", "str_session_statistics_tv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_ranged_tv", ":class_color"), #ranged
        (position_set_x, pos1, ":tv_x_pos_size"),
        (position_set_y, pos1, ":tv_y_pos_size"),
        (overlay_set_size, "$g_ranged_tv", pos1),
        (position_set_x, pos1, ":tv_x_pos_left_center"),
        (position_set_y, pos1, ":tv_y_pos_initial_central"),
        (overlay_set_position, "$g_ranged_tv", pos1),
        
        (val_add, ":tv_y_pos_initial_central", ":tv_y_pos_difference_central"),
        
        (create_text_overlay, "$g_cav_tv", "str_session_statistics_tv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_cav_tv", ":class_color"), #cavalry
        (position_set_x, pos1, ":tv_x_pos_size"),
        (position_set_y, pos1, ":tv_y_pos_size"),
        (overlay_set_size, "$g_cav_tv", pos1),
        (position_set_x, pos1, ":tv_x_pos_left_center"),
        (position_set_y, pos1, ":tv_y_pos_initial_central"),
        (overlay_set_position, "$g_cav_tv", pos1),
        
        (create_text_overlay, "$g_sw_tv", "str_session_statistics_tv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_sw_tv", 0xFFEE7744), #sw
        (position_set_x, pos1, ":tv_x_pos_size"),
        (position_set_y, pos1, ":tv_y_pos_size"),
        (overlay_set_size, "$g_sw_tv", pos1),
        (position_set_x, pos1, ":tv_x_pos_left"),
        (position_set_y, pos1, ":tv_y_pos_initial"),
        (overlay_set_position, "$g_sw_tv", pos1),
        
        (val_add, ":tv_y_pos_initial", ":tv_y_pos_difference"),
        
        (create_text_overlay, "$g_sarr_tv", "str_session_statistics_tv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_sarr_tv", 0xFFDDDD33), #sarr
        (position_set_x, pos1, ":tv_x_pos_size"),
        (position_set_y, pos1, ":tv_y_pos_size"),
        (overlay_set_size, "$g_sarr_tv", pos1),
        (position_set_x, pos1, ":tv_x_pos_left"),
        (position_set_y, pos1, ":tv_y_pos_initial"),
        (overlay_set_position, "$g_sarr_tv", pos1),
        
        (val_add, ":tv_y_pos_initial", ":tv_y_pos_difference"),
        
        (create_text_overlay, "$g_rh_tv", "str_session_statistics_tv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_rh_tv", 0xFF33DD33), #rh
        (position_set_x, pos1, ":tv_x_pos_size"),
        (position_set_y, pos1, ":tv_y_pos_size"),
        (overlay_set_size, "$g_rh_tv", pos1),
        (position_set_x, pos1, ":tv_x_pos_left"),
        (position_set_y, pos1, ":tv_y_pos_initial"),
        (overlay_set_position, "$g_rh_tv", pos1),
        
        (val_add, ":tv_y_pos_initial", ":tv_y_pos_difference"),
        
        (create_text_overlay, "$g_kh_tv", "str_session_statistics_tv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_kh_tv", 0xFFCC99FF), #kh
        (position_set_x, pos1, ":tv_x_pos_size"),
        (position_set_y, pos1, ":tv_y_pos_size"),
        (overlay_set_size, "$g_kh_tv", pos1),
        (position_set_x, pos1, ":tv_x_pos_left"),
        (position_set_y, pos1, ":tv_y_pos_initial"),
        (overlay_set_position, "$g_kh_tv", pos1),
        
        (val_add, ":tv_y_pos_initial", ":tv_y_pos_difference"),
        
        (create_text_overlay, "$g_v_tv", "str_session_statistics_tv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_v_tv", 0xFFCCBB99), #v
        (position_set_x, pos1, ":tv_x_pos_size"),
        (position_set_y, pos1, ":tv_y_pos_size"),
        (overlay_set_size, "$g_v_tv", pos1),
        (position_set_x, pos1, ":tv_x_pos_left"),
        (position_set_y, pos1, ":tv_y_pos_initial"),
        (overlay_set_position, "$g_v_tv", pos1),
        
        (val_add, ":tv_y_pos_initial", ":tv_y_pos_difference"),
        
        (create_text_overlay, "$g_n_tv", "str_session_statistics_tv", tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, "$g_n_tv", 0xFF33DDDD), #n
        (position_set_x, pos1, ":tv_x_pos_size"),
        (position_set_y, pos1, ":tv_y_pos_size"),
        (overlay_set_size, "$g_n_tv", pos1),
        (position_set_x, pos1, ":tv_x_pos_left"),
        (position_set_y, pos1, ":tv_y_pos_initial"),
        (overlay_set_position, "$g_n_tv", pos1),
        
        
###########################################################################
################################Time values################################
###########################################################################

        (create_game_button_overlay, "$g_presentation_obj_session_statistics_go_back", "str_back", 0), #the button to allow players to exit the presentation
        (position_set_x, pos1, 548),
        (position_set_y, pos1, 559),
        (overlay_set_position, "$g_presentation_obj_session_statistics_go_back", pos1),
        (position_set_x, pos1, 60),
        (position_set_y, pos1, 30),
        (overlay_set_size, "$g_presentation_obj_session_statistics_go_back", pos1),

###########################################################################
##################################Headers##################################
###########################################################################
        
        (create_text_overlay, reg0, "str_session_statistics", tf_double_space|tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, reg0, 0xFFFFD700),
        (position_set_x, pos1, 2200),
        (position_set_y, pos1, 2200),
        (overlay_set_size, reg0, pos1),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 705),
        (overlay_set_position, reg0, pos1),
        
        (create_text_overlay, reg0, "str_session_statistics_time", tf_double_space|tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, reg0, 0xFFF02838),
        (position_set_x, pos1, 1900),
        (position_set_y, pos1, 1900),
        (overlay_set_size, reg0, pos1),
        (position_set_x, pos1, 250),
        (position_set_y, pos1, 630),
        (overlay_set_position, reg0, pos1),
        
        (create_text_overlay, reg0, "str_session_statistics_kd", tf_double_space|tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, reg0, 0xFFF02838),
        (position_set_x, pos1, 1900),
        (position_set_y, pos1, 1900),
        (overlay_set_size, reg0, pos1),
        (position_set_x, pos1, 750),
        (position_set_y, pos1, 630),
        (overlay_set_position, reg0, pos1),
        
        (create_text_overlay, reg0, "str_session_statistics_total", tf_double_space|tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, reg0, 0xFFF07F28),
        (position_set_x, pos1, 1600),
        (position_set_y, pos1, 1600),
        (overlay_set_size, reg0, pos1),
        (position_set_x, pos1, 250),
        (position_set_y, pos1, 585),
        (overlay_set_position, reg0, pos1),
        
        (create_text_overlay, reg0, "str_session_statistics_total", tf_double_space|tf_vertical_align_center|tf_center_justify|tf_single_line|tf_with_outline),
        (overlay_set_color, reg0, 0xFFF07F28),
        (position_set_x, pos1, 1600),
        (position_set_y, pos1, 1600),
        (overlay_set_size, reg0, pos1),
        (position_set_x, pos1, 750),
        (position_set_y, pos1, 585),
        (overlay_set_position, reg0, pos1),
        
###########################################################################
##################################Headers##################################
###########################################################################
        
        (create_image_button_overlay_with_tableau_material, reg6, -1, "tableau_session_statistics", -1), #the tableau is just a slightly modified Native one from MP menu
        (position_set_x, pos1, 339),
        (position_set_y, pos1, -125),
        (overlay_set_position, reg6, pos1),
        (position_set_x, pos1, 1150),
        (position_set_y, pos1, 1150),
        (overlay_set_size, reg6, pos1),
        
###########################################################################
##################################Meshes###################################
###########################################################################
        
#note that meshes starting with 'varena_' are just Native ones translated in OpenBRF to avoid clipping

          (create_mesh_overlay, reg0, "mesh_ccoop_random_class"),
          (position_set_x, pos1, 474),
          (position_set_y, pos1, 609),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, 150),
          (position_set_y, pos1, 150),
          (overlay_set_size, reg0, pos1),
          (overlay_set_color, reg0, 0xF24836),
          
          (create_mesh_overlay, reg0, "mesh_white_plane"),
          (overlay_set_color, reg0, 0xA40A0A),
          (overlay_set_alpha, reg0, 0xFF),
          (position_set_x, pos1, 820),
          (position_set_y, pos1, 10),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, 50),
          (position_set_y, pos1, 13000),
          (overlay_set_size, reg0, pos1),
          
          (create_mesh_overlay, reg0, "mesh_white_plane"),
          (overlay_set_color, reg0, 0xA40A0A),
          (overlay_set_alpha, reg0, 0xFF),
          (position_set_x, pos1, 180),
          (position_set_y, pos1, 10),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, 50),
          (position_set_y, pos1, 13000),
          (overlay_set_size, reg0, pos1),
          
          (assign, ":shield_y_pos_difference", 89),
          (assign, ":shield_y_pos_initial", 50),
          
          (assign, ":shield_x_pos_left", 40),
          (assign, ":shield_x_pos_right", 960),
          
          (assign, ":shield_y_pos_size", 80),
          (assign, ":shield_x_pos_size", 80),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_7"),
          (position_set_x, pos1, 505),
          (position_set_y, pos1, 515),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          (overlay_set_color, reg0, 0xE05303),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_6"),
          (position_set_x, pos1, ":shield_x_pos_left"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_6"),
          (position_set_x, pos1, ":shield_x_pos_right"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (val_add, ":shield_y_pos_initial", ":shield_y_pos_difference"),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_5"),
          (position_set_x, pos1, ":shield_x_pos_left"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_5"),
          (position_set_x, pos1, ":shield_x_pos_right"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (val_add, ":shield_y_pos_initial", ":shield_y_pos_difference"),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_4"),
          (position_set_x, pos1, ":shield_x_pos_left"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_4"),
          (position_set_x, pos1, ":shield_x_pos_right"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (val_add, ":shield_y_pos_initial", ":shield_y_pos_difference"),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_3"),
          (position_set_x, pos1, ":shield_x_pos_left"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_3"),
          (position_set_x, pos1, ":shield_x_pos_right"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (val_add, ":shield_y_pos_initial", ":shield_y_pos_difference"),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_2"),
          (position_set_x, pos1, ":shield_x_pos_left"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_2"),
          (position_set_x, pos1, ":shield_x_pos_right"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (val_add, ":shield_y_pos_initial", ":shield_y_pos_difference"),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_1"),
          (position_set_x, pos1, ":shield_x_pos_left"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (create_mesh_overlay, reg0, "mesh_varena_ui_kingdom_shield_1"),
          (position_set_x, pos1, ":shield_x_pos_right"),
          (position_set_y, pos1, ":shield_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":shield_x_pos_size"),
          (position_set_y, pos1, ":shield_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          
          (assign, ":icon_y_pos_difference", 90),
          (assign, ":icon_y_pos_initial", 10),
          
          (assign, ":icon_y_pos_size", 800),
          (assign, ":icon_x_pos_size", 800),
          
          (create_mesh_overlay, reg0, "mesh_cb_ui_icon_infantry"),
          (position_set_x, pos1, 647),
          (position_set_y, pos1, ":icon_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":icon_x_pos_size"),
          (position_set_y, pos1, ":icon_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (create_mesh_overlay, reg0, "mesh_cb_ui_icon_infantry"),
          (position_set_x, pos1, 272),
          (position_set_y, pos1, ":icon_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":icon_x_pos_size"),
          (position_set_y, pos1, ":icon_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (val_add, ":icon_y_pos_initial", ":icon_y_pos_difference"),
          
          (create_mesh_overlay, reg0, "mesh_cb_ui_icon_archer"),
          (position_set_x, pos1, 672),
          (position_set_y, pos1, ":icon_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":icon_x_pos_size"),
          (position_set_y, pos1, ":icon_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (create_mesh_overlay, reg0, "mesh_cb_ui_icon_archer"),
          (position_set_x, pos1, 297),
          (position_set_y, pos1, ":icon_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":icon_x_pos_size"),
          (position_set_y, pos1, ":icon_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (val_add, ":icon_y_pos_initial", ":icon_y_pos_difference"),
          
          (create_mesh_overlay, reg0, "mesh_cb_ui_icon_horseman"),
          (position_set_x, pos1, 662),
          (position_set_y, pos1, ":icon_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":icon_x_pos_size"),
          (position_set_y, pos1, ":icon_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
          (create_mesh_overlay, reg0, "mesh_cb_ui_icon_horseman"),
          (position_set_x, pos1, 287),
          (position_set_y, pos1, ":icon_y_pos_initial"),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, ":icon_x_pos_size"),
          (position_set_y, pos1, ":icon_y_pos_size"),
          (overlay_set_size, reg0, pos1),
          
###########################################################################
##################################Meshes###################################
###########################################################################
          
       ]),
  
      (ti_on_presentation_event_state_change,
        [
          (store_trigger_param_1, ":object"),
          (try_begin),
            (eq, ":object", "$g_presentation_obj_session_statistics_go_back"),
            (presentation_set_duration, 0),
          (try_end),
         ]),
      
      (ti_on_presentation_run,
        [
         (try_begin),
           (this_or_next|key_clicked, key_escape),
           (key_clicked, key_xbox_start),
           (presentation_set_duration, 0),
         (try_end),
        
         (assign, ":total_tv", 0), #here is the mathematic calculations section, modals are for gameplay seconds to be included in the presentation
         (assign, ":infantry_tv", 0),
         (assign, ":ranged_tv", 0),
         (assign, ":cavalry_tv", 0),
         (assign, ":sw_tv", 0),
         (assign, ":sarr_tv", 0),
         (assign, ":rh_tv", 0),
         (assign, ":kh_tv", 0),
         (assign, ":v_tv", 0),
         (assign, ":n_tv", 0),
        
        (store_add, ":total_tv", "$g_session_statistics_time_alive_infantry", "$g_session_statistics_time_alive_cavalry"),
        (val_add, ":total_tv", "$g_session_statistics_time_alive_ranged"),
        (store_mod, ":modal", ":total_tv", 60),
        (val_div, ":total_tv", 60),
        (assign, reg56, ":total_tv"),
           (try_begin),
              (lt, ":modal", 60),
              (assign, reg57, ":modal"),
           (try_end),
         (overlay_set_text, "$g_total_tv", "str_session_statistics_tv"),
        
        (val_add, ":infantry_tv", "$g_session_statistics_time_alive_infantry"),
        (store_mod, ":modal_infantry", ":infantry_tv", 60),
        (val_div, ":infantry_tv", 60),
        (assign, reg56, ":infantry_tv"),
           (try_begin),
              (lt, ":modal_infantry", 60),
              (assign, reg57, ":modal_infantry"),
           (try_end),
         (overlay_set_text, "$g_inf_tv", "str_session_statistics_tv"),
        
        (val_add, ":ranged_tv", "$g_session_statistics_time_alive_ranged"),
        (store_mod, ":modal_ranged", ":ranged_tv", 60),
        (val_div, ":ranged_tv", 60),
        (assign, reg56, ":ranged_tv"),
           (try_begin),
              (lt, ":modal_ranged", 60),
              (assign, reg57, ":modal_ranged"),
           (try_end),
         (overlay_set_text, "$g_ranged_tv", "str_session_statistics_tv"),
        
        (val_add, ":cavalry_tv", "$g_session_statistics_time_alive_cavalry"),
        (store_mod, ":modal_cavalry", ":cavalry_tv", 60),
        (val_div, ":cavalry_tv", 60),
        (assign, reg56, ":cavalry_tv"),
           (try_begin),
              (lt, ":modal_cavalry", 60),
              (assign, reg57, ":modal_cavalry"),
           (try_end),
         (overlay_set_text, "$g_cav_tv", "str_session_statistics_tv"),
        
        (val_add, ":sw_tv", "$g_session_statistics_time_alive_swadians"),
        (store_mod, ":modal_sw", ":sw_tv", 60),
        (val_div, ":sw_tv", 60),
        (assign, reg56, ":sw_tv"),
           (try_begin),
              (lt, ":modal_sw", 60),
              (assign, reg57, ":modal_sw"),
           (try_end),
          (overlay_set_text, "$g_sw_tv", "str_session_statistics_tv"),
        
        (val_add, ":sarr_tv", "$g_session_statistics_time_alive_sarranids"),
        (store_mod, ":modal_sarr", ":sarr_tv", 60),
        (val_div, ":sarr_tv", 60),
        (assign, reg56, ":sarr_tv"),
           (try_begin),
              (lt, ":modal_sarr", 60),
              (assign, reg57, ":modal_sarr"),
           (try_end),
         (overlay_set_text, "$g_sarr_tv", "str_session_statistics_tv"),
        
        (val_add, ":rh_tv", "$g_session_statistics_time_alive_rhodoks"),
        (store_mod, ":modal_rh", ":rh_tv", 60),
        (val_div, ":rh_tv", 60),
        (assign, reg56, ":rh_tv"),
           (try_begin),
              (lt, ":modal_rh", 60),
              (assign, reg57, ":modal_rh"),
           (try_end),
         (overlay_set_text, "$g_rh_tv", "str_session_statistics_tv"),
        
        (val_add, ":kh_tv", "$g_session_statistics_time_alive_khergits"),
        (store_mod, ":modal_kh", ":kh_tv", 60),
        (val_div, ":kh_tv", 60),
        (assign, reg56, ":kh_tv"),
           (try_begin),
              (lt, ":modal_kh", 60),
              (assign, reg57, ":modal_kh"),
           (try_end),
         (overlay_set_text, "$g_kh_tv", "str_session_statistics_tv"),
        
        (val_add, ":v_tv", "$g_session_statistics_time_alive_vaegirs"),
        (store_mod, ":modal_v", ":v_tv", 60),
        (val_div, ":v_tv", 60),
        (assign, reg56, ":v_tv"),
           (try_begin),
              (lt, ":modal_v", 60),
              (assign, reg57, ":modal_v"),
           (try_end),
         (overlay_set_text, "$g_v_tv", "str_session_statistics_tv"),
        
        (val_add, ":n_tv", "$g_session_statistics_time_alive_nords"),
        (store_mod, ":modal_n", ":n_tv", 60),
        (val_div, ":n_tv", 60),
        (assign, reg56, ":n_tv"),
           (try_begin),
              (lt, ":modal_n", 60),
              (assign, reg57, ":modal_n"),
           (try_end),
         (overlay_set_text, "$g_n_tv", "str_session_statistics_tv"),
        
         (assign, ":total_k", 0),
         (assign, ":infantry_k", 0),
         (assign, ":ranged_k", 0),
         (assign, ":cavalry_k", 0),
         (assign, ":sw_k", 0),
         (assign, ":sarr_k", 0),
         (assign, ":rh_k", 0),
         (assign, ":kh_k", 0),
         (assign, ":v_k", 0),
         (assign, ":n_k", 0),
        
         (assign, ":total_d", 0),
         (assign, ":infantry_d", 0),
         (assign, ":ranged_d", 0),
         (assign, ":cavalry_d", 0),
         (assign, ":sw_d", 0),
         (assign, ":sarr_d", 0),
         (assign, ":rh_d", 0),
         (assign, ":kh_d", 0),
         (assign, ":v_d", 0),
         (assign, ":n_d", 0),
        
         (store_add, ":total_k", "$g_session_statistics_kill_count_infantry", "$g_session_statistics_kill_count_cavalry"),
         (val_add, ":total_k", "$g_session_statistics_kill_count_ranged"),
         (assign, reg58, ":total_k"),
         (store_add, ":total_d", "$g_session_statistics_death_count_infantry", "$g_session_statistics_death_count_cavalry"),
         (val_add, ":total_d", "$g_session_statistics_death_count_ranged"),
         (assign, reg59, ":total_d"),
         (overlay_set_text, "$g_total_kdv", "str_session_statistics_kdv"),
        
         (val_add, ":infantry_k", "$g_session_statistics_kill_count_infantry"),
         (assign, reg58, ":infantry_k"),
         (val_add, ":infantry_d", "$g_session_statistics_death_count_infantry"),
         (assign, reg59, ":infantry_d"),
         (overlay_set_text, "$g_inf_kdv", "str_session_statistics_kdv"),
        
         (val_add, ":ranged_k", "$g_session_statistics_kill_count_ranged"),
         (assign, reg58, ":ranged_k"),
         (val_add, ":ranged_d", "$g_session_statistics_death_count_ranged"),
         (assign, reg59, ":ranged_d"),
         (overlay_set_text, "$g_ranged_kdv", "str_session_statistics_kdv"),
        
         (val_add, ":cavalry_k", "$g_session_statistics_kill_count_cavalry"),
         (assign, reg58, ":cavalry_k"),
         (val_add, ":cavalry_d", "$g_session_statistics_death_count_cavalry"),
         (assign, reg59, ":cavalry_d"),
         (overlay_set_text, "$g_cav_kdv", "str_session_statistics_kdv"),
        
         (val_add, ":sw_k", "$g_session_statistics_kill_count_swadians"),
         (assign, reg58, ":sw_k"),
         (val_add, ":sw_d", "$g_session_statistics_death_count_swadians"),
         (assign, reg59, ":sw_d"),
         (overlay_set_text, "$g_sw_kdv", "str_session_statistics_kdv"),
        
         (val_add, ":sarr_k", "$g_session_statistics_kill_count_sarranids"),
         (assign, reg58, ":sarr_k"),
         (val_add, ":sarr_d", "$g_session_statistics_death_count_sarranids"),
         (assign, reg59, ":sarr_d"),
         (overlay_set_text, "$g_sarr_kdv", "str_session_statistics_kdv"),
        
         (val_add, ":rh_k", "$g_session_statistics_kill_count_rhodoks"),
         (assign, reg58, ":rh_k"),
         (val_add, ":rh_d", "$g_session_statistics_death_count_rhodoks"),
         (assign, reg59, ":rh_d"),
         (overlay_set_text, "$g_rh_kdv", "str_session_statistics_kdv"),
        
         (val_add, ":kh_k", "$g_session_statistics_kill_count_khergits"),
         (assign, reg58, ":kh_k"),
         (val_add, ":kh_d", "$g_session_statistics_death_count_khergits"),
         (assign, reg59, ":kh_d"),
         (overlay_set_text, "$g_kh_kdv", "str_session_statistics_kdv"),
        
         (val_add, ":v_k", "$g_session_statistics_kill_count_vaegirs"),
         (assign, reg58, ":v_k"),
         (val_add, ":v_d", "$g_session_statistics_death_count_vaegirs"),
         (assign, reg59, ":v_d"),
         (overlay_set_text, "$g_v_kdv", "str_session_statistics_kdv"),
        
         (val_add, ":n_k", "$g_session_statistics_kill_count_nords"),
         (assign, reg58, ":n_k"),
         (val_add, ":n_d", "$g_session_statistics_death_count_nords"),
         (assign, reg59, ":n_d"),
         (overlay_set_text, "$g_n_kdv", "str_session_statistics_kdv"),
        
        ]),

])

Also, here are some associated snippets:

Python:
  ("session_statistics", "Universal session statistics"),
  ("session_statistics_time", "Time spent on playing"),
  ("session_statistics_kd", "Ratio of kills/ deaths"),
  ("session_statistics_total", "In total:"),
  ("session_statistics_tv", "{reg56} min {reg57} sec"),
  ("session_statistics_kdv", "{reg58}/{reg59}"),
 
Continuing from the previous post due to the length limit

As a bonus, here is a mission template trigger handling fiery footprints when on high killstreak; the threshold is defined within the script.
20211112082423-1.jpg
20211112082302-1.jpg

  • The below script's description from Varena NeoGK's thread linked above: Fiery footprints when on rampage (>10 kills for infantry/ ranged, >20 for cavalry).
Python:
common_killstreak_footprints = (0.25, 0, 0, [], #for fiery psys every 0.25 sec, can be changed (changing to 0 spawns psys in every frame for some intense effect)
          [
          (neg|multiplayer_is_dedicated_server),
         
          (neq, "$g_multiplayer_game_type", multiplayer_game_type_captain_coop), #invasion-forbidden
         
          (multiplayer_get_my_player, ":my_player_no"),
          (multiplayer_get_my_troop, ":my_troop_no"),
          (player_get_agent_id, ":player_agent", ":my_player_no"),
         
          (agent_is_active, ":player_agent"),
          (agent_is_alive, ":player_agent"),
         
          (agent_get_horse, ":horse", ":player_agent"),
          (agent_get_position, pos7, ":player_agent"),
         
          (is_between, ":my_troop_no", multiplayer_troops_begin, multiplayer_troops_end),
          (call_script, "script_multiplayer_get_troop_class", ":my_troop_no"),
          (assign, ":class", reg0),
         
#psys are taken from Native, the calculation is done to determine classes' killstreak threshold and bigger psys are spawned when on horseback to be more visible

          (try_begin),
             (le, ":class", multi_troop_class_spearman),
             (gt, "$g_player_controlled_agent_kill_count", 10),
                (try_begin), #on foot
                   (le, ":horse", -1),
                   (particle_system_burst_no_sync, "psys_fireplace_fire_small", pos7, 25),
                (else_try), #on horseback
                   (particle_system_burst_no_sync, "psys_fireplace_fire_big", pos7, 25),
                (try_end),
          (else_try),
             (eq, ":class", multi_troop_class_cavalry),
             (gt, "$g_player_controlled_agent_kill_count", 20),
                (try_begin), #on foot
                   (le, ":horse", -1),
                   (particle_system_burst_no_sync, "psys_fireplace_fire_small", pos7, 25),
                (else_try), #on horseback
                   (particle_system_burst_no_sync, "psys_fireplace_fire_big", pos7, 25),
                (try_end),
          (else_try),
             (ge, ":class", multi_troop_class_archer),
             (gt, "$g_player_controlled_agent_kill_count", 10),
                (try_begin), #on foot
                   (le, ":horse", -1),
                   (particle_system_burst_no_sync, "psys_fireplace_fire_small", pos7, 25),
                (else_try), #on horseback
                   (particle_system_burst_no_sync, "psys_fireplace_fire_big", pos7, 25),
                (try_end),
          (try_end),
         
          ])
 

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
Thanks for sharing your scripts :smile:
A pity that you leave though, you could stay around as a retired modder, like Somebody or Sebastian are doing.
 
Thanks for sharing your scripts :smile:
A pity that you leave though, you could stay around as a retired modder, like Somebody or Sebastian are doing.
You are welcome. Everyone will eventually step from the scene, that is normal. I will not be making anything new anymore, but I will stay to help others around in Q&A section just as I do recently (for some time more).
 
Top Bottom