• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Looking double on item description onlook

wafuboe

Member
Joined
Dec 24, 2010
Messages
881
Solutions
2
Reaction score
22
I just recently installed this syustem to my tfs 1.3 server and by far its running ok but when i look at anything i get a double description


Example>
35027

I made this changes in player.lua i think that i mess up i have go backwards but nothing seems to solve this.

player.lua event
replace
Code:
Code:
function Player:onLook(thing, position, distance)
   local description = "You see " .. thing:getDescription(distance)
to

Code:
function Player:onLook(thing, position, distance)
   local description = "You see " .. thing:getDescription(distance)
   description = stat_onLook(thing, description)

replace

Code:
function Player:onLookInTrade(partner, item, distance)
self:sendTextMessage(MESSAGE_INFO_DESCR, "You see " .. item:getDescription(distance))
end

to

Code:
function Player:onLookInTrade(partner, item, distance)
   local description = item:getDescription(distance)
   description = stat_onLook(item, description)
   self:sendTextMessage(MESSAGE_INFO_DESCR, "You see " .. description)
end

here is my player.lua


i appreciatedyourhelp thank you!
 
Solution
I just recently installed this syustem to my tfs 1.3 server and by far its running ok but when i look at anything i get a double description


Example>
View attachment 35027

I made this changes in player.lua i think that i mess up i have go backwards but nothing seems to solve this.

player.lua event
replace
Code:
Code:
function Player:onLook(thing, position, distance)
   local description = "You see " .. thing:getDescription(distance)
to

Code:
function Player:onLook(thing, position, distance)
   local description = "You see " .. thing:getDescription(distance)
   description = stat_onLook(thing, description)

replace...
I just recently installed this syustem to my tfs 1.3 server and by far its running ok but when i look at anything i get a double description


Example>
View attachment 35027

I made this changes in player.lua i think that i mess up i have go backwards but nothing seems to solve this.

player.lua event
replace
Code:
Code:
function Player:onLook(thing, position, distance)
   local description = "You see " .. thing:getDescription(distance)
to

Code:
function Player:onLook(thing, position, distance)
   local description = "You see " .. thing:getDescription(distance)
   description = stat_onLook(thing, description)

replace

Code:
function Player:onLookInTrade(partner, item, distance)
self:sendTextMessage(MESSAGE_INFO_DESCR, "You see " .. item:getDescription(distance))
end

to

Code:
function Player:onLookInTrade(partner, item, distance)
   local description = item:getDescription(distance)
   description = stat_onLook(item, description)
   self:sendTextMessage(MESSAGE_INFO_DESCR, "You see " .. description)
end

here is my player.lua


i appreciatedyourhelp thank you!
You're very impatient, i said i would help you with this issue as i did with the others in another support thread. I need to review the library because i suspect that it contains a call to getDescription causing this double assignment of the description on the item.

I can't review 2k lines of code on a smart phone and that library looks like it could use a re-write
 
Solution
no hurry i just wanted to give you more info, i totally understand if i looked kind of annoying i apologize is not my intention i appreciate your time and effort c:
 
wafu you would have to post the stat_onLook library, code, w/e. Probably installed somewhere in a global library file.
 
Never mind I saw it.

change

Code:
[LIST=1]
[*]function stat_onLook(thing, description)
[*]        if not STATS_SYSTEM_CONFIG.reqLvlBasedOnUpgrade then
[*]                return description
[*]        end
[*]       
[*]        local v, d = description:match('%It can only be wielded properly by (.-)% of level (.-)% or higher')
[*]        if v then
[*]                local lv = d:match('%d+')
[*]                local nlv = thing:getStatReqLevel()
[*]                return description:gsub(description:match(v .. " of level " .. d), v .. " of level " .. nlv)
[*]        end
[*]        return description
[*]end
[/LIST]

to

Code:
function stat_onLook(thing, description)
        if not STATS_SYSTEM_CONFIG.reqLvlBasedOnUpgrade then
                return description
        end
       
        local v, d = description:match('%It can only be wielded properly by (.-)% of level (.-)% or higher')
        if v then
                local lv = d:match('%d+')
                local nlv = thing:getStatReqLevel()
                description:gsub(description:match(v .. " of level " .. d), v .. " of level " .. nlv)
        end
        return description
end

and see if it fixes it.
 
Never mind I saw it.

change

Code:
[LIST=1]
[*]function stat_onLook(thing, description)
[*]        if not STATS_SYSTEM_CONFIG.reqLvlBasedOnUpgrade then
[*]                return description
[*]        end
[*]      
[*]        local v, d = description:match('%It can only be wielded properly by (.-)% of level (.-)% or higher')
[*]        if v then
[*]                local lv = d:match('%d+')
[*]                local nlv = thing:getStatReqLevel()
[*]                return description:gsub(description:match(v .. " of level " .. d), v .. " of level " .. nlv)
[*]        end
[*]        return description
[*]end
[/LIST]

to

Code:
function stat_onLook(thing, description)
        if not STATS_SYSTEM_CONFIG.reqLvlBasedOnUpgrade then
                return description
        end
      
        local v, d = description:match('%It can only be wielded properly by (.-)% of level (.-)% or higher')
        if v then
                local lv = d:match('%d+')
                local nlv = thing:getStatReqLevel()
                description:gsub(description:match(v .. " of level " .. d), v .. " of level " .. nlv)
        end
        return description
end

and see if it fixes it.

i try but it's still the same no error in console
i changed what you told me on my data/stats.lua
 
So what was the solution? Oh nevermind. I am going back to bed :)
i search on the profile of another person with the same problem ofthe thread
god blessthis effective search system
 
nevermind actually i have the problems on player apparently

looking yourself and at anothers looks double

12:38 You see yourself. You are a knight.yourself. You are a knight.
 
Back
Top