• 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!

TFS 1.4.2 Onlook Backpack dont show descrip if range

Mr Noxi

Noxus Otserver
Joined
May 13, 2010
Messages
272
Solutions
3
Reaction score
94
Location
Sweden
Heyo

Question

Am on the path to add attributes to my items but for some reason, i cannot read item description if is not 1 sqm from player.

Even tho i have <attribute key="showattributes" value="1" /> applied to the item.

If anyone has any clues i'd be very happy :]

Using OtcV8 if thats any help.

1672663112998.png
 
I suggest you to try debuging it by importing to your notepad++/sublime/vscode entire folder with data and server sources.
Click magic CTRL+SHIFT+F (Search in project files) and find "showattributes", then.. there is hard part.. you must read with understanding :) Hope it helps!

Also, if you have any item on top of the actual item with description problem (like those yellow sparkles that preventing player from moving the item), maybe the problem is with them? I don't know, you have to try, read, debug, repeat.. Trust in yourself and try something. It's always worth trying ;)
 
Last edited:
I will see if i find anything, dout it tho since its only some items that dont get attribute info on them.

I know what u mean about the "Something Sparkling" but its not that, i have tried for long time to find clues or similar threads but there aint one that i managed to find anyway ^^

I tried with diffrent types of backpacks, bags etc but the issue remains the same.

For eg some items dont even need the showattributes code line for the attri description while some needs the line. Not sure what seperates them. Maybe Backpacks was never meant to have an attribute or something idk.
 
search for lookDistance
I suppose u mean if lookDistance <= 1 then perhaps in lib/core/items.lua?

I tried this fix but did not help at all unfort, not sure if the changes are correct, i tried <= 2 to 7 without any sucess.

Maybe am missing something? sorry not the biggest brain here ^^
 
I don't have this issue, Using 1.4.2 and OTCv8 too so it might be one of your custom changes.

Edit: Sorry I noticed that it happens but not with all backpacks, I was testing with a different backpack the first time.
backpack test.gif
 
Last edited:
I tried removing showattributes and/or adding it to all of them.
XML:
<item id="10521" article="a" name="moon backpack">
        <attribute key="weight" value="1800" />
        <attribute key="containerSize" value="20" />
        <attribute key="showattributes" value="1" />
        <attribute key="slotType" value="backpack" />
</item>
<item id="2000" article="a" name="red backpack">
        <attribute key="weight" value="1800" />
        <attribute key="containerSize" value="20" />
        <attribute key="speed" value="100" />
        <attribute key="maxhitpoints" value="50" />
        <attribute key="maxmanapoints" value="50" />
        <attribute key="showattributes" value="1" />
        <attribute key="slotType" value="backpack" />
</item>
<item id="1998" article="a" name="green backpack">
        <attribute key="weight" value="1800" />
        <attribute key="containerSize" value="20" />
        <attribute key="slotType" value="backpack" />
</item>
 
In TFS 1.2 (however i don't think that this changed much in newer tfs'es, so..), in item.cpp in function Item::getDescription
you have this piece of code (at nearly ending of function), this code is responsible for description of normal items that aren't signs and other hardcoded things (correct me if i wrong)
so far as I can see in sources there are few hardcoded things, all you need is to edit "lookDistance" in this piece of code, for example change lookDistance <= 1 to lookDistance <= 5 and compile.. why you not reading server sources tho?
C++:
// line 1384 or so.. (i have custom modifications but it should be somewhere near ending of function)
    if (item) {
        const std::string& specialDescription = item->getSpecialDescription();
        if (!specialDescription.empty()) {
            s << std::endl << specialDescription;
        } else if (lookDistance <= 1 && !it.description.empty()) { // here lookDistance <= 5 for testing purposes
            s << std::endl << it.description;
        }
    } else if (lookDistance <= 1 && !it.description.empty()) { // here lookDistance <= 5 for testing purposes
        s << std::endl << it.description;
    }
// ...

RL5Iq9P.png
Voila, all you have to do it's to follow the damn Sources, CJ.
About attributes and other things you have to search for piece of code where "showAttributes" is handled, read it and change as you like.. there are many things in TFS done in different way, pretty much most common way, however, it's open sourced so you have possibility to edit everything, so...

In new TFS, if you wan't to do it in LUA way, you should look in lib/core/item.lua or in onLook (in player probably) in data/events but remember - LUA is just an C++ "overlay", so you will overwrite existing things from C++.
 
Last edited:
Back
Top