Jump to content

Question about 'watches' and 'triggers'.

Recommended Posts

Hi all.

I've dabbled in some basic mods before, but I'm looking to get a better understanding of where trigger parameters come from when they are being set as the `watch=` attribute.

Just to use an egregious example, in the old `game_lobby.package` some code watches for `watch="LobbyPlayerInfo{index}"`.

It seems like this has as many as 77+ parameters (`param0` through `param77` or more) just based on the references throughout the various UI widgets.

What I'm struggling to understand is where these parameters come from and how they are passed. I suspect it's probably from some Lua scripts, but using `grep` I have not been able to determine where these params come from and how to know what value(s) they represent.

According to the old documentation (http://web.archive.org/web/20150314214322/http://honwiki.net/wiki/XAML_reference#Full_Lists) it outlines some of the parameters for that trigger, but it's not complete.

{index}: the index of the player, 0 to 4 is legion, 5 to 9 is hellbourne

param0 int: -1 is no player, 0 to * is the number of the player using that slot
param1 string: name of the player using the slot
param2: color of the slot in 'R G B A' format
param3 bool: True if the player is the host
param7 string: name of the color of the slot
param8 bool: True if you are in this slot.
param9 int: player ID
param10 int: PSR
param12 int: PSR gain if the game is won
param13 int: PSR loss if the game is lost (negative number)
param15 bool: Slot is locked true/false
param16 bool: Player Team - true if the player is on Hellborne, false if on Legion.
param17 bool: True if you are the host.
param18 bool: True if this slot is the top slot for its team.
param19 bool: True if the player is an S2 employee
param20 bool: True if the player is a prepaid account

How does one determine what these parameter(s) are and where to come from? Is it best to hunt these down in code somewhere, or can this be reverse engineered by issuing some console command to simulate the trigger output?

I guess one idea would be to forward all the arguments to a custom Lua function using a `...` to pass the variable argument list. And then in Lua print them out. But that seems pretty crude.

Any info on this topic would be greatly appreciated.

Link to post
Share on other sites

Using the Lua approach, this is what I deduced so far. But i'm still not sure where the arguments are sent from the populate these params. And a lot of the params are unclear as to their purpose.


param0 int: Number between 0-9 corresponding to position in the game lobby. Or -1 if no player.
param1 string: Username, including clan tag, of the player in that slot
param2 color: Color of the slot in 'R G B A' format
param3 bool: True if the player is the host
param4 bool:
param5 bool:
param6 bool:
param7 string: Name of the color of the slot (e.g. 'blue').
param8 bool: True if you are in this slot.
param9 int: Player ID
param10 float: PSR
param11 bool:
param12 float: PSR gain if the game is won
param13 float: PSR loss if the game is lost
param14 float:
param15 bool: Slot is locked (true/false)
param16 bool: Player Team - true if the player is on Hellbourne, false if on Legion
param17 bool: True if you are the host
param18 bool: True if this slot is the top slot for this team.
param19 bool: True if the player is an S2/Frostburn employee.
param20 bool: True if the player is a prepaid (verified) account.
param21 bool: True if the game is autobalance
param22 int: Number of wins
param23 int: Number of losses
param24 int:
param25 int:
param26 int:
param27 int:
param28 int:
param29 float: Average experience per minute
param30 float: Average gold per minute
param31 float: Average wards per game
param35 int:
param36 int:
param37 int:
param40 int:
param41 int:
param42 int:
param45 int:
param46 int:
param47 int:
param50 int:
param51 int:
param52 int:
param55 int:
param56 int:
param57 int:
param60 int:
param61 int:
param62 int:
param65 int:
param66 int:
param67 int:
param69 int:
param71 int:
param73 int:
param75 int:
param77 int:
param78 bool:
param79 string: Relative path to symbol icon .tga file
param80 string: Relative path to name color icon .tga file
param81 string: Name color hex code
param82 string: Relative path to account icon .tga file
param83 bool:
param84 bool:
param85 string: Name glow color hex code
param86 int:
param88 bool:


Edited by happyasthma
Link to post
Share on other sites

I got most of them


 0: Client number
 1: Display name
 2: Color
 3: Is host
 4: Can be kicked
 5: Is referee
 6: Can be made host
 7: Name color
 8: Is you
 9: Account id
10: Rank (mmr)
11: Is ranked?
12: Rank on win
13: Rank on lose
14: ? (float?)
15: Is locked
16: Can join team
17: Are you host
18: Is local player in this team
19: Is staff
20: Bought when game was buy to play?
21: Is autobalance
22: Account wins
23: Account losses
24: Account doisconnects
25: Account kills
26: Account assists
27: Account deaths
28: "0" unused
29: Account xp/min
30: Account gold/min
31: Account wards/min
for match in <last 7 matches>:
    path to hero icon
    "^884Win" or "^522Lose"
    match kills
    match deaths
    match assists
for hero in <5 most played>:
    path to hero icon
79: Chat symbol
80: Name color icon
81: Name color (again?)
82: Account icon
83: Chat name glow
84: Is Bot
85: Chat name glow color
86: ? (number?)
87: ?
88: Chat name background glow ???

Edited by Anakonda
  • Like 1
Link to post
Share on other sites

@Anakonda- Thanks for filling in some of the blanks. How were you able to determine these? Just reverse engineering?

I'd love to identify the list of available watches from the system and document their parameters. As this would allow for much more innovative mod creation.

There is a very stale and incomplete list that I salvaged from the old wiki: http://web.archive.org/web/20150314214322/http://honwiki.net/wiki/XAML_reference#Full_Lists. But I'm not sure the best way to fill in all the missing pieces.

Link to post
Share on other sites

This just seems to show usages of the trigger as a `watch`. It doesn't show where the underlying trigger is triggered from (or at least a `grep` didn't turn up anything meaningful for me). And it also didn't help identify what each `paramX` represents.

I was hoping to figure out how to determine those.

Link to post
Share on other sites

Engine triggers most of them. You can also manually trigger from console.

If the trigger has watches in lua the function argumets are often named helpfully otherwise you need to figure it from the usage or testing by manually triggering it.


  • Like 1
Link to post
Share on other sites

To circle back to this topic, it does indeed seem like you cannot easily determine the actual values of the parameters. But here's some knowledge and debugging ideas to help future folks.

Triggers may be triggered manually in UI code (packages, interfaces, Lua), but most of the time they are triggered by the Game Engine.

For example, `LobbyPlayerInfo{index}` is one of these examples. 

However, particularly with the `newui` a lot of the network requests are done by "submitting a form". They configure a form that acts as an API endpoint to the HoN PHP API. A good example is `PlayerStatsNormalSeason` from `resources0\ui\fe2\newui\player_stats_v2.package`.

This actually lists out all of the resultparams with descriptive names. This is not always the case, but this is a great place to go to identify the parameters. Also pay close attention to the `resulttrigger`. This is the trigger that occurs after the trigger is triggered. You can listen to this yourself with `watch` or search through to see where else it's used in the UI code.



These forms can be submitted from Lua code using `SubmitForm()`. So that's one thing to grep for. But you can also trigger these yourself.

For example in `SubmitInitialForms()` local function in `player_stats_v2.lua` you can see a bunch of forms submitted. Which you can think of as calling the HoN API:


    SubmitForm('PlayerStatsMastery', 'f', 'show_stats', 'nickname', StripClanTag(_currentNickName), 'cookie', Client.GetCookie(), 'table', 'mastery')
    SubmitForm(action.form, 'f', action.f, 'nickname', action.nickname, 'cookie', action.cookie, 'table', action.table)
    SubmitForm('PlayerStatsMVPAwards', 'f', 'get_player_award_summ', 'nickname', StripClanTag(_currentNickName), 'cookie', Client.GetCookie())
    SubmitForm('GetSeasons', 'f', 'get_seasons', 'nickname', StripClanTag(_currentNickName), 'cookie', Client.GetCookie())

Here's an example that I call myself in a mod that I recently wrote:


        function Player_Stats_V2:FetchSeasonNormalRecentMatchData(nickName)
            -- Issue the form submission to fetch the most recent 7 matches. This triggers `PlayerStatsMatchListResult` trigger.
            SubmitForm('PlayerStatsMatchList', 'f', 'match_history_overview', 'nickname', StripClanTag(nickName), 'cookie', Client.GetCookie(), 'table', 'campaign' , 'num', '7', 'current_season', '1')

You can also `grep` the Lua code to see where this form is handled. In the `newui` this is almost always in Lua. So for example the handler for this is set in `resources0\ui\scripts\newui\player_stats_v2.lua`:


widget:RegisterWatch('PlayerStatsNormalSeasonResult', function(_, ...) Player_Stats_V2:OnPlayerStatsNormalSeasonResult(...) end)

You can see whenever this watch triggers, it calls `Player_Stats_V2:OnPlayerStatsNormalSeasonResult(...)`.

If you go to that implementation, you can often see how the existing Lua code parses some of these parameters:


function Player_Stats_V2:OnPlayerStatsNormalSeasonResult(...)
    if not bNormalSeasonStatsRetrieved then
        _seasonStatsNormal['nickname']                            = arg[1] or '0'
        _seasonStatsNormal['name']                              = arg[2] or '0'
        _seasonStatsNormal['rank']                              = arg[3] or '0'
        _seasonStatsNormal['cam_level']                         = arg[4] or '0'
        _seasonStatsNormal['account_id']                        = arg[5] or '0'
        _seasonStatsNormal['curr_season_cam_games_played']      = arg[6] or '0'
        _seasonStatsNormal['cam_wins']                          = arg[7] or '0'
        _seasonStatsNormal['cam_losses']                        = arg[8] or '0'
        _seasonStatsNormal['cam_concedes']                      = arg[9] or '0'
        _seasonStatsNormal['cam_concedevotes']                  = arg[10] or '0'
        _seasonStatsNormal['cam_buybacks']                      = arg[11] or '0'
        _seasonStatsNormal['curr_season_cam_discos']            = arg[12] or '0'
        _seasonStatsNormal['cam_kicked']                        = arg[13] or '0'
        _seasonStatsNormal['smr']                               = arg[14] or '0'
        _seasonStatsNormal['cam_pub_count']                     = arg[15] or '0'
        _seasonStatsNormal['cam_amm_solo_rating']               = arg[16] or '0'
        _seasonStatsNormal['cam_amm_solo_count']                = arg[17] or '0'
        _seasonStatsNormal['cam_amm_team_rating']               = arg[18] or '0'
        _seasonStatsNormal['cam_amm_team_count']                = arg[19] or '0'
        _seasonStatsNormal['rnk_avg_score']                     = arg[20] or '0'
        _seasonStatsNormal['cam_herokills']                     = arg[21] or '0'
        _seasonStatsNormal['cam_herodmg']                       = arg[22] or '0'
        _seasonStatsNormal['cam_heroexp']                       = arg[23] or '0'
        _seasonStatsNormal['cam_herokillsgold']                 = arg[24] or '0'
        _seasonStatsNormal['cam_heroassists']                   = arg[25] or '0'
        _seasonStatsNormal['cam_deaths']                        = arg[26] or '0'
        _seasonStatsNormal['cam_goldlost2death']                = arg[27] or '0'
        _seasonStatsNormal['cam_secs_dead']                     = arg[28] or '0'
        _seasonStatsNormal['cam_teamcreepkills']                = arg[29] or '0'
        _seasonStatsNormal['cam_teamcreepdmg']                  = arg[30] or '0'
        _seasonStatsNormal['cam_teamcreepexp']                  = arg[31] or '0'
        _seasonStatsNormal['cam_teamcreepgold']                 = arg[32] or '0'
        _seasonStatsNormal['cam_neutralcreepkills']             = arg[33] or '0'
        _seasonStatsNormal['cam_neutralcreepdmg']               = arg[34] or '0'
        _seasonStatsNormal['cam_neutralcreepexp']               = arg[35] or '0'
        _seasonStatsNormal['cam_neutralcreepgold']              = arg[36] or '0'
        _seasonStatsNormal['cam_bdmg']                          = arg[37] or '0'
        _seasonStatsNormal['cam_bdmgexp']                       = arg[38] or '0'
        _seasonStatsNormal['cam_razed']                         = arg[39] or '0'
        _seasonStatsNormal['cam_bgold']                         = arg[40] or '0'
        _seasonStatsNormal['cam_denies']                        = arg[41] or '0'
        _seasonStatsNormal['cam_exp_denied']                    = arg[42] or '0'
        _seasonStatsNormal['cam_gold']                          = arg[43] or '0'
        _seasonStatsNormal['cam_gold_spend']                    = arg[44] or '0'
        _seasonStatsNormal['cam_exp']                           = arg[45] or '0'
        _seasonStatsNormal['cam_actions']                       = arg[46] or '0'
        _seasonStatsNormal['cam_secs']                          = arg[47] or '0'
        _seasonStatsNormal['cam_consumables']                   = arg[48] or '0'
        _seasonStatsNormal['cam_wards']                         = arg[49] or '0'
        _seasonStatsNormal['cam_em_played']                     = arg[50] or '0'
        _seasonStatsNormal['maxXP']                             = arg[51] or '0'
        _seasonStatsNormal['last_activity']                     = arg[52] or '0'
        _seasonStatsNormal['matchIds']                          = arg[53] or '0'
        _seasonStatsNormal['matchDates']                        = arg[54] or '0'
        _seasonStatsNormal['favHero1']                          = arg[55] or '0'
        _seasonStatsNormal['favHero2']                          = arg[56] or '0'
        _seasonStatsNormal['favHero3']                          = arg[57] or '0'
        _seasonStatsNormal['favHero4']                          = arg[58] or '0'
        _seasonStatsNormal['favHero5']                          = arg[59] or '0'
        _seasonStatsNormal['favHero1Time']                      = arg[60] or '0'
        _seasonStatsNormal['favHero2Time']                      = arg[61] or '0'
        _seasonStatsNormal['favHero3Time']                      = arg[62] or '0'
        _seasonStatsNormal['favHero4Time']                      = arg[63] or '0'
        _seasonStatsNormal['favHero5Time']                      = arg[64] or '0'
        _seasonStatsNormal['xp2nextLevel']                      = arg[65] or '0'
        _seasonStatsNormal['xpPercent']                         = arg[66] or '0'
        _seasonStatsNormal['percentEM']                         = arg[67] or '0'
        _seasonStatsNormal['k_d_a']                             = arg[68] or '0'
        _seasonStatsNormal['avgGameLength']                     = arg[69] or '0'
        _seasonStatsNormal['avgXP_min']                         = arg[70] or '0'
        _seasonStatsNormal['avgDenies']                         = arg[71] or '0'
        _seasonStatsNormal['avgCreepKills']                     = arg[72] or '0'
        _seasonStatsNormal['avgNeutralKills']                   = arg[73] or '0'
        _seasonStatsNormal['avgActions_min']                    = arg[74] or '0'
        _seasonStatsNormal['avgWardsUsed']                      = arg[75] or '0'
        _seasonStatsNormal['create_date']                       = arg[76] or '0'
        _seasonStatsNormal['favHero1_2']                        = arg[77] or '0'
        _seasonStatsNormal['favHero2_2']                        = arg[78] or '0'
        _seasonStatsNormal['favHero3_2']                        = arg[79] or '0'
        _seasonStatsNormal['favHero4_2']                        = arg[80] or '0'
        _seasonStatsNormal['favHero5_2']                        = arg[81] or '0'
        _seasonStatsNormal['favHero1id']                        = arg[82] or '0'
        _seasonStatsNormal['favHero2id']                        = arg[83] or '0'
        _seasonStatsNormal['favHero3id']                        = arg[84] or '0'
        _seasonStatsNormal['favHero4id']                        = arg[85] or '0'
        _seasonStatsNormal['favHero5id']                        = arg[86] or '0'
        _seasonStatsNormal['error']                             = arg[87] or '0'
        _seasonStatsNormal['cam_level']                         = arg[88] or '0'
        _seasonStatsNormal['selected_upgrades']                 = arg[89] or '0'
        _seasonStatsNormal['acc_games_played']                  = arg[90] or '0'
        _seasonStatsNormal['cs_games_played']                   = arg[91] or '0'
        _seasonStatsNormal['acc_discos']                        = arg[92] or '0'
        _seasonStatsNormal['cs_discos']                         = arg[93] or '0'
        _seasonStatsNormal['cam_bloodlust']                     = arg[94] or '0'
        _seasonStatsNormal['cam_doublekill']                    = arg[95] or '0'
        _seasonStatsNormal['cam_triplekill']                    = arg[96] or '0'
        _seasonStatsNormal['cam_quadkill']                      = arg[97] or '0'
        _seasonStatsNormal['cam_annihilation']                  = arg[98] or '0'
        _seasonStatsNormal['cam_ks3']                           = arg[99] or '0'
        _seasonStatsNormal['cam_ks4']                           = arg[100] or '0'
        _seasonStatsNormal['cam_ks5']                           = arg[101] or '0'
        _seasonStatsNormal['cam_ks6']                           = arg[102] or '0'
        _seasonStatsNormal['cam_ks7']                           = arg[103] or '0'
        _seasonStatsNormal['cam_ks8']                           = arg[104] or '0'
        _seasonStatsNormal['cam_ks9']                           = arg[105] or '0'
        _seasonStatsNormal['cam_ks10']                          = arg[106] or '0'
        _seasonStatsNormal['cam_ks15']                          = arg[107] or '0'
        _seasonStatsNormal['cam_smackdown']                     = arg[108] or '0'
        _seasonStatsNormal['cam_humiliation']                   = arg[109] or '0'
        _seasonStatsNormal['cam_nemesis']                       = arg[110] or '0'
        _seasonStatsNormal['cam_retribution']                   = arg[111] or '0'
        _seasonStatsNormal['total_level_exp']                   = arg[112] or '0'
        _seasonStatsNormal['cam_time_earning_exp']              = arg[113] or '0'
        _seasonStatsNormal['level']                             = arg[114] or '0'
        _seasonStatsNormal['level_exp']                         = arg[115] or '0'
        _seasonStatsNormal['discos']                            = arg[116] or '0'
        _seasonStatsNormal['possible_discos']                   = arg[117] or '0'
        _seasonStatsNormal['games_played']                      = arg[118] or '0'
        _seasonStatsNormal['account_type']                      = arg[119] or '0'
        _seasonStatsNormal['standing']                          = arg[120] or '0'
        _seasonStatsNormal['level_percent']                     = arg[121] or '0'
        _seasonStatsNormal['max_exp']                           = arg[122] or '0'
        _seasonStatsNormal['min_exp']                           = arg[123] or '0'
        _seasonStatsNormal['mid_games_played']                  = arg[124] or '0'
        _seasonStatsNormal['mid_discos']                        = arg[125] or '0'
        _seasonStatsNormal['total_games_played']                = arg[126] or '0'
        _seasonStatsNormal['total_discos']                      = arg[127] or '0'
        _seasonStatsNormal['event_id']                          = arg[128] or '0'
        _seasonStatsNormal['events']                            = arg[129] or '0'
        _seasonStatsNormal['uncs_discos']                       = arg[130] or '0'
        _seasonStatsNormal['unrnk_discos']                      = arg[131] or '0'
        _seasonStatsNormal['uncs_games_played']                 = arg[132] or '0'
        _seasonStatsNormal['unrnk_games_played']                = arg[133] or '0'
        _seasonStatsNormal['rift_games_played']                 = arg[134] or '0'
        _seasonStatsNormal['rift_discos']                       = arg[135] or '0'
        _seasonStatsNormal['current_level']                     = arg[136] or '0'
        _seasonStatsNormal['highest_level_current']             = arg[137] or '0'
        _seasonStatsNormal['season_id']                         = arg[138] or '0'
        _seasonStatsNormal['current_ranking']                   = arg[139] or '0'
        _seasonStatsNormal['rnk_games_played']                  = arg[140] or '0'
        _seasonStatsNormal['curr_season_cam_cs_games_played']   = arg[141] or '0'
        _seasonStatsNormal['rnk_discos']                        = arg[142] or '0'
        _seasonStatsNormal['curr_season_cam_cs_discos']         = arg[143] or '0'
        _seasonStatsNormal['prev_seasons_cam_games_played']     = arg[144] or '0'
        _seasonStatsNormal['prev_seasons_cam_cs_games_played']  = arg[145] or '0'
        _seasonStatsNormal['prev_seasons_cam_discos']           = arg[146] or '0'
        _seasonStatsNormal['prev_seasons_cam_cs_discos']        = arg[147] or '0'
        _seasonStatsNormal['highest_ranking']                    = arg[148] or '0'
        _seasonStatsNormal['con_reward']                        = arg[149] or ''

        bNormalSeasonStatsRetrieved = true

    local generalInfo = {}
    generalInfo.nickname             = _seasonStatsNormal['nickname'] or ''
    generalInfo.clanname            = _seasonStatsNormal['name'] or ''
    generalInfo.accountid             = tonumber(_seasonStatsNormal['account_id']) or -1
    generalInfo.lastmatchdate         = _seasonStatsNormal['last_activity'] or ''
    generalInfo.createdate             = _seasonStatsNormal['create_date'] or ''
    generalInfo.selected_upgrade    = _seasonStatsNormal['selected_upgrades'] or ''
    generalInfo.level                 = _seasonStatsNormal['level'] or ''
    generalInfo.level_exp             = tonumber(_seasonStatsNormal['level_exp']) or 0
    generalInfo.matches             = tonumber(_seasonStatsNormal['total_games_played']) or 0
    generalInfo.disconnects         = tonumber(_seasonStatsNormal['total_discos']) or 0
    generalInfo.standing            = tonumber(_seasonStatsNormal['standing']) or 0


    local statsInfo = {}
    if true then
        statsInfo.account_id                    = _seasonStatsNormal['account_id']
        statsInfo.season_id                     = _seasonStatsNormal['season_id']
        statsInfo.mmr                            = _seasonStatsNormal['smr']
        statsInfo.current_level                 = _seasonStatsNormal['current_level']
        statsInfo.level_exp                     = _seasonStatsNormal['level_exp']
        statsInfo.level_percent                    = _seasonStatsNormal['level_percent']
        statsInfo.current_ranking                = _seasonStatsNormal['current_ranking']
        statsInfo.highest_level_current            = _seasonStatsNormal['highest_level_current']
        statsInfo.highest_ranking                = _seasonStatsNormal['highest_ranking']
        statsInfo.favHero1                        = _seasonStatsNormal['favHero1']
        statsInfo.favHero2                        = _seasonStatsNormal['favHero2']
        statsInfo.favHero3                        = _seasonStatsNormal['favHero3']
        statsInfo.favHero4                        = _seasonStatsNormal['favHero4']
        statsInfo.favHero5                        = _seasonStatsNormal['favHero5']
        statsInfo.favHero1Time                    = _seasonStatsNormal['favHero1Time']
        statsInfo.favHero2Time                    = _seasonStatsNormal['favHero2Time']
        statsInfo.favHero3Time                    = _seasonStatsNormal['favHero3Time']
        statsInfo.favHero4Time                    = _seasonStatsNormal['favHero4Time']
        statsInfo.favHero5Time                    = _seasonStatsNormal['favHero5Time']
        statsInfo.favHero1_2                    = _seasonStatsNormal['favHero1_2']
        statsInfo.favHero2_2                    = _seasonStatsNormal['favHero2_2']
        statsInfo.favHero3_2                    = _seasonStatsNormal['favHero3_2']
        statsInfo.favHero4_2                    = _seasonStatsNormal['favHero4_2']
        statsInfo.favHero5_2                    = _seasonStatsNormal['favHero5_2']
        statsInfo.total_games_played            = _seasonStatsNormal['total_games_played']
        statsInfo.cur_games_played                 = _seasonStatsNormal['curr_season_cam_games_played']
        statsInfo.total_discos                  = _seasonStatsNormal['total_discos']
        statsInfo.cur_discos                       = _seasonStatsNormal['curr_season_cam_discos']
        statsInfo.avgCreepKills                 = _seasonStatsNormal['avgCreepKills']
        statsInfo.avgDenies                     = _seasonStatsNormal['avgDenies']
        statsInfo.avgGameLength                 = _seasonStatsNormal['avgGameLength']
        statsInfo.avgXP_min                     = _seasonStatsNormal['avgXP_min']
        statsInfo.avgActions_min                = _seasonStatsNormal['avgActions_min']
        statsInfo.avgNeutralKills               = _seasonStatsNormal['avgNeutralKills']
        statsInfo.avgWardsUsed                  = _seasonStatsNormal['avgWardsUsed']
        statsInfo.k_d_a                         = _seasonStatsNormal['k_d_a']
        statsInfo.wins                            = _seasonStatsNormal['cam_wins']
        statsInfo.losses                        = _seasonStatsNormal['cam_losses']
        statsInfo.herokills                        = _seasonStatsNormal['cam_herokills']
        statsInfo.deaths                           = _seasonStatsNormal['cam_deaths']
        statsInfo.heroassists                      = _seasonStatsNormal['cam_heroassists']
        statsInfo.exp                              = _seasonStatsNormal['cam_exp']
        statsInfo.gold                             = _seasonStatsNormal['cam_gold']
        statsInfo.secs                             = _seasonStatsNormal['cam_secs']
        statsInfo.smackdown                        = _seasonStatsNormal['cam_smackdown']
        statsInfo.humiliation                      = _seasonStatsNormal['cam_humiliation']
        statsInfo.ks3                              = _seasonStatsNormal['cam_ks3']
        statsInfo.ks4                              = _seasonStatsNormal['cam_ks4']
        statsInfo.ks5                              = _seasonStatsNormal['cam_ks5']
        statsInfo.ks6                              = _seasonStatsNormal['cam_ks6']
        statsInfo.ks7                              = _seasonStatsNormal['cam_ks7']
        statsInfo.ks8                              = _seasonStatsNormal['cam_ks8']
        statsInfo.ks9                              = _seasonStatsNormal['cam_ks9']
        statsInfo.ks10                             = _seasonStatsNormal['cam_ks10']
        statsInfo.ks15                             = _seasonStatsNormal['cam_ks15']
        statsInfo.doublekill                       = _seasonStatsNormal['cam_doublekill']
        statsInfo.triplekill                       = _seasonStatsNormal['cam_triplekill']
        statsInfo.quadkill                         = _seasonStatsNormal['cam_quadkill']
        statsInfo.annihilation                     = _seasonStatsNormal['cam_annihilation']
        statsInfo.bloodlust                        = _seasonStatsNormal['cam_bloodlust']
        statsInfo.con_reward                    = _seasonStatsNormal['con_reward']

    if _currentTab == 'overview' and bHeroMasteryRetrieved then
        println('^gSetting overview season info from normal season result!^*')
        SetOverviewSeasonInfo(statsInfo, true)

    elseif _currentTab == 'stats' then
        SetPlayerStatsStatsInfo(statsInfo, false, true, false)

        local tip_colors = {}
        local tip_numbers = {}
        tip_colors.public = '^w'
        tip_colors.normal = '^w'
        tip_colors.casual = '^w'
        tip_colors.season_normal = '^r'
        tip_colors.season_casual = '^w'
        tip_colors.pre_season_normal = '^w'
        tip_colors.pre_season_casual = '^w'
        tip_colors.midwars = '^w'

        tip_numbers.public = _seasonStatsNormal['acc_games_played']
        tip_numbers.normal = _seasonStatsNormal['rnk_games_played']
        tip_numbers.casual = _seasonStatsNormal['cs_games_played']
        tip_numbers.season_normal = _seasonStatsNormal['curr_season_cam_games_played']
        tip_numbers.season_casual = _seasonStatsNormal['curr_season_cam_cs_games_played']
        tip_numbers.pre_season_normal = _seasonStatsNormal['prev_seasons_cam_games_played']
        tip_numbers.pre_season_casual = _seasonStatsNormal['prev_seasons_cam_cs_games_played']
        tip_numbers.midwars = _seasonStatsNormal['mid_games_played']
        SetTipMatchesPlayed(tip_colors, tip_numbers)

        tip_numbers.public = _seasonStatsNormal['acc_discos']
        tip_numbers.normal = _seasonStatsNormal['rnk_discos']
        tip_numbers.casual = _seasonStatsNormal['cs_discos']
        tip_numbers.season_normal = _seasonStatsNormal['curr_season_cam_discos']
        tip_numbers.season_casual = _seasonStatsNormal['curr_season_cam_cs_discos']
        tip_numbers.pre_season_normal = _seasonStatsNormal['prev_seasons_cam_discos']
        tip_numbers.pre_season_casual = _seasonStatsNormal['prev_seasons_cam_cs_discos']
        tip_numbers.midwars = _seasonStatsNormal['mid_discos']
        SetTipDisconnects(tip_colors, tip_numbers)

If you know what trigger you want to watch, you could also edit an existing Lua function that handles it. Or create your own.

Inside of that method, the parameters are contained in `arg` so you can just iterate them all:


for i = 1, arg.n do
    -- NOTE: Lua uses 1-based indexing. But package and interface files use 0-based indexing. So keep that in mind.
    println('arg[' .. i .. '] = ' .. arg)

Then just manually execute the code to simulate the trigger (which will execute your Lua code). And then go to the console to view the output you just printed. Or use the HoN UI to trigger the similar action that will cause the existing code to issue that trigger.

Edited by happyasthma
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...