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
param4:
param5:
param6:
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
param11:
param12 int: PSR gain if the game is won
param13 int: PSR loss if the game is lost (negative number)
param14:
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
Posted (edited)

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
param32
param33
param34
param35 int:
param36 int:
param37 int:
param38
param39
param40 int:
param41 int:
param42 int:
param43
param44
param45 int:
param46 int:
param47 int:
param48
param49
param50 int:
param51 int:
param52 int:
param53
param54
param55 int:
param56 int:
param57 int:
param58
param59
param60 int:
param61 int:
param62 int:
param63
param64
param65 int:
param66 int:
param67 int:
param68
param69 int:
param70
param71 int:
param72
param73 int:
param74
param75 int:
param76
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:
param87
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
    playcount%
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
Posted (edited)

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.
 

Spoiler

    <form
        name="PlayerStatsNormalSeason"
        host="!masterserver"
        method="post"
        target="/client_requester.php"
        statustrigger="PlayerStatsNormalSeasonStatus"
        resulttrigger="PlayerStatsNormalSeasonResult"
        resultparam0="nickname"
        resultparam1="name"
        resultparam2="rank"
        resultparam3="cam_level"
        resultparam4="account_id"
        resultparam5="curr_season_cam_games_played"
        resultparam6="cam_wins"
        resultparam7="cam_losses"
        resultparam8="cam_concedes"
        resultparam9="cam_concedevotes"
        resultparam10="cam_buybacks"
        resultparam11="curr_season_cam_discos"
        resultparam12="cam_kicked"
        resultparam13="smr"
        resultparam14="cam_pub_count"
        resultparam15="cam_amm_solo_rating"
        resultparam16="cam_amm_solo_count"
        resultparam17="cam_amm_team_rating"
        resultparam18="cam_amm_team_count"
        resultparam19="rnk_avg_score"
        resultparam20="cam_herokills"
        resultparam21="cam_herodmg"
        resultparam22="cam_heroexp"
        resultparam23="cam_herokillsgold"
        resultparam24="cam_heroassists"
        resultparam25="cam_deaths"
        resultparam26="cam_goldlost2death"
        resultparam27="cam_secs_dead"
        resultparam28="cam_teamcreepkills"
        resultparam29="cam_teamcreepdmg"
        resultparam30="cam_teamcreepexp"
        resultparam31="cam_teamcreepgold"
        resultparam32="cam_neutralcreepkills"
        resultparam33="cam_neutralcreepdmg"
        resultparam34="cam_neutralcreepexp"
        resultparam35="cam_neutralcreepgold"
        resultparam36="cam_bdmg"
        resultparam37="cam_bdmgexp"
        resultparam38="cam_razed"
        resultparam39="cam_bgold"
        resultparam40="cam_denies"
        resultparam41="cam_exp_denied"
        resultparam42="cam_gold"
        resultparam43="cam_gold_spend"
        resultparam44="cam_exp"
        resultparam45="cam_actions"
        resultparam46="cam_secs"
        resultparam47="cam_consumables"
        resultparam48="cam_wards"
        resultparam49="cam_em_played"
        resultparam50="maxXP"
        resultparam51="last_activity"
        resultparam52="matchIds"
        resultparam53="matchDates"
        resultparam54="favHero1"
        resultparam55="favHero2"
        resultparam56="favHero3"
        resultparam57="favHero4"
        resultparam58="favHero5"
        resultparam59="favHero1Time"
        resultparam60="favHero2Time"
        resultparam61="favHero3Time"
        resultparam62="favHero4Time"
        resultparam63="favHero5Time"
        resultparam64="xp2nextLevel"
        resultparam65="xpPercent"
        resultparam66="percentEM"
        resultparam67="k_d_a"
        resultparam68="avgGameLength"
        resultparam69="avgXP_min"
        resultparam70="avgDenies"
        resultparam71="avgCreepKills"
        resultparam72="avgNeutralKills"
        resultparam73="avgActions_min"
        resultparam74="avgWardsUsed"
        resultparam75="create_date"
        resultparam76="favHero1_2"
        resultparam77="favHero2_2"
        resultparam78="favHero3_2"
        resultparam79="favHero4_2"
        resultparam80="favHero5_2"
        resultparam81="favHero1id"
        resultparam82="favHero2id"
        resultparam83="favHero3id"
        resultparam84="favHero4id"
        resultparam85="favHero5id"
        resultparam86="error"
        resultparam87="cam_level"
        resultparam88="selected_upgrades"
        resultparam89="acc_games_played"
        resultparam90="cs_games_played"
        resultparam91="acc_discos"
        resultparam92="cs_discos"
        resultparam93="cam_bloodlust"
        resultparam94="cam_doublekill"
        resultparam95="cam_triplekill"
        resultparam96="cam_quadkill"
        resultparam97="cam_annihilation"
        resultparam98="cam_ks3"
        resultparam99="cam_ks4"
        resultparam100="cam_ks5"
        resultparam101="cam_ks6"
        resultparam102="cam_ks7"
        resultparam103="cam_ks8"
        resultparam104="cam_ks9"
        resultparam105="cam_ks10"
        resultparam106="cam_ks15"
        resultparam107="cam_smackdown"
        resultparam108="cam_humiliation"
        resultparam109="cam_nemesis"
        resultparam110="cam_retribution"
        resultparam111="total_level_exp"
        resultparam112="cam_time_earning_exp"
        resultparam113="level"
        resultparam114="level_exp"
        resultparam115="discos"
        resultparam116="possible_discos"
        resultparam117="games_played"
        resultparam118="account_type"
        resultparam119="standing"
        resultparam120="level_percent"
        resultparam121="max_exp"
        resultparam122="min_exp"
        resultparam123="mid_games_played"
        resultparam124="mid_discos"
        resultparam125="total_games_played"
        resultparam126="total_discos"
        resultparam127="event_id"
        resultparam128="events"
        resultparam129="uncs_discos"
        resultparam130="unrnk_discos"
        resultparam131="uncs_games_played"
        resultparam132="unrnk_games_played"
        resultparam133="rift_games_played"
        resultparam134="rift_discos"
        resultparam135="current_level"
        resultparam136="highest_level_current"
        resultparam137="season_id"
        resultparam138="current_ranking"
        resultparam139="rnk_games_played"
        resultparam140="curr_season_cam_cs_games_played"
        resultparam141="rnk_discos"
        resultparam142="curr_season_cam_cs_discos"
        resultparam143="prev_seasons_cam_games_played"
        resultparam144="prev_seasons_cam_cs_games_played"
        resultparam145="prev_seasons_cam_discos"
        resultparam146="prev_seasons_cam_cs_discos"
        resultparam147="highest_ranking"
        resultparam148="con_reward"
    />

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:

Spoiler

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

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

Spoiler

        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')
        end

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`:
 

Spoiler

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:

Spoiler

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
    end

    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

    Player_Stats_V2:SetGeneralInfo(generalInfo)

    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']
    end

    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)
    else
    end
end

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:

Spoiler

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)
end

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...