Kind of a glitch in Score.lua

Post here if you want to help developing something for FAF.

Kind of a glitch in Score.lua

Postby Koecher » 25 Aug 2013, 19:36

Hey ZePilot,

I've just randomly noticed that you used the same variable name twice in the same function for different things in the score.lua file, depending if its the normal FAF file oder score.lua used for GW.
Currently this isnt a problem (as ofc just one of both files is used), but depending on what else you're going to do with the GW files, it might become one I think.

In the normal FAF score.lua there is:
Code: Select all
      local playerName = line.name:GetText()
      local playerRating = sessionInfo.Options.Ratings[playerName]
      if (playerRating) then
         playerNameLine = playerName..' ['..math.floor(playerRating+0.5)..']'


while in the GW score.lua is:

Code: Select all
            local playerName = data.nickname
            local playerRank = sessionInfo.Options.Ranks[playerName]
            if (playerRank) then
                playerName = ranks[data.faction][playerRank+1] .. " " .. playerName
            end           


No idea if you've done this by accident or on purpose, just wanted to give a heads up on that.
User avatar
Koecher
Contributor
 
Posts: 264
Joined: 24 Apr 2012, 17:46
Has liked: 4 times
Been liked: 20 times
FAF User Name: Koecher

Re: Kind of a glitch in Score.lua

Postby johnie102 » 04 Sep 2013, 21:29

Isn't it that Rating refers to the trueskill rating (median - 3* deviation) while Rank refers to one of eight available ranks in GW?
That is at least what I can tell from the code you posted below.
johnie102
Avatar-of-War
 
Posts: 128
Joined: 27 Dec 2012, 22:26
Has liked: 0 time
Been liked: 2 times
FAF User Name: johnie102

Re: Kind of a glitch in Score.lua

Postby Ze_PilOt » 04 Sep 2013, 21:41

Exactly yes.
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: Kind of a glitch in Score.lua

Postby Koecher » 05 Sep 2013, 00:36

johnie102 wrote:Isn't it that Rating refers to the trueskill rating (median - 3* deviation) while Rank refers to one of eight available ranks in GW?


Thats not what I wanted to mention. Just wanne tell than in both "local playerName" is used, with the same variable name for different "jobs". So if the 2 different score files are merged some day for some reasons, it'll perhaps give a problem. Thats what I wanted do mention ;)
User avatar
Koecher
Contributor
 
Posts: 264
Joined: 24 Apr 2012, 17:46
Has liked: 4 times
Been liked: 20 times
FAF User Name: Koecher

Re: Kind of a glitch in Score.lua

Postby johnie102 » 05 Sep 2013, 21:12

Koecher wrote:
johnie102 wrote:Isn't it that Rating refers to the trueskill rating (median - 3* deviation) while Rank refers to one of eight available ranks in GW?


Thats not what I wanted to mention. Just wanne tell than in both "local playerName" is used, with the same variable name for different "jobs". So if the 2 different score files are merged some day for some reasons, it'll perhaps give a problem. Thats what I wanted do mention ;)


Ah yes. I see :)
It's still ok as far as I can see. In GW the rank of the person should be part of the full name, while the rating of a person definately isn't part of the name of the person and shouldn't be in the playername.
johnie102
Avatar-of-War
 
Posts: 128
Joined: 27 Dec 2012, 22:26
Has liked: 0 time
Been liked: 2 times
FAF User Name: johnie102


Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest