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

Background colors on rarity system

bertosso

Member
Joined
Apr 27, 2024
Messages
13
Solutions
1
Reaction score
5
Location
Brasil
Twitch
bertosso
YouTube
KBertosso
Hello,

I installed the rarity system on my server (TFS 1.4.2) and it works well, the itens drop with different rarity and attributtes, but the tooltip does not read the rarity and it does not change the background colors in the inventory/containers.

1747277011162.webp

I checked the others posts here in the forum with people having the same issues but what they did to fix didnt work for me.

I can be really wrong cause i started to work in a server for the first time recently and its all new to me but I think the problem is client sided, gonna leave here some files that i think it is where the problem could be.

I tried it with this other tooltip aswell that was able to read the rarity but still no background color, but for some reason this tooltip cause a bug on my server and the monsters start to have a delay when dying ( take a few seconds to change to the dead sprite) and when i die with a character it just stands there instead of showing the death message)

1747277382195.webp
 

Attachments

Solution
You do not need any source changes in otclient to have the tooltips...
otcv8 has all the necessary soruces already, you just need a few simple changes in otc scripts, the changes needed are already on the forum

The source changes are needed at the TFS side



Add prints in your scripts so that you can spot the moment where the script fails.
What upgrade system do you use?
If you try to call in items.xml your item 'epic sword' instead of 'sword' or I dunno, 'legendary axe', will it trigger the effect?
You're referring to tooltips, but the original question is about showing a colored background or frame depending on the item's rarity.

That feature is not present by default in OTClientV8. The client does not...
hat happens because the visual part of item rarity (like background colors in inventory or containers) isn’t automatic it comes from the client, not the server.

You need to modify the client (specifically the OTClient source) so it receives the rarity information from the server. For example, when the server sends an item, it should include something like getRarity or any way to indicate the item's rarity.

Then the client reads that rarity and applies the corresponding background color or image. Also, in the module that handles containers (game_containers.lua), you’ll need to add logic to update the slot color when an item with rarity is detected.

Without that, the client won’t show any visual change even if the item has rarity on the server.
 
I'm currently working on this system for someone, you still have to distinguish items from each other because you can have two of the same but one will be legendary and the other will be regular and the client has to know which item is which
 

Attachments

  • Messenger_creation_94ECE839-C0F3-4267-AB2E-9503676ABF48.webp
    Messenger_creation_94ECE839-C0F3-4267-AB2E-9503676ABF48.webp
    50.3 KB · Views: 46 · VirusTotal
hat happens because the visual part of item rarity (like background colors in inventory or containers) isn’t automatic it comes from the client, not the server.

You need to modify the client (specifically the OTClient source) so it receives the rarity information from the server. For example, when the server sends an item, it should include something like getRarity or any way to indicate the item's rarity.

Then the client reads that rarity and applies the corresponding background color or image. Also, in the module that handles containers (game_containers.lua), you’ll need to add logic to update the slot color when an item with rarity is detected.

Without that, the client won’t show any visual change even if the item has rarity on the server.
You do not need any source changes in otclient to have the tooltips...
otcv8 has all the necessary soruces already, you just need a few simple changes in otc scripts, the changes needed are already on the forum

The source changes are needed at the TFS side

Hello,

I installed the rarity system on my server (TFS 1.4.2) and it works well, the itens drop with different rarity and attributtes, but the tooltip does not read the rarity and it does not change the background colors in the inventory/containers.

View attachment 92476

I checked the others posts here in the forum with people having the same issues but what they did to fix didnt work for me.

I can be really wrong cause i started to work in a server for the first time recently and its all new to me but I think the problem is client sided, gonna leave here some files that i think it is where the problem could be.

I tried it with this other tooltip aswell that was able to read the rarity but still no background color, but for some reason this tooltip cause a bug on my server and the monsters start to have a delay when dying ( take a few seconds to change to the dead sprite) and when i die with a character it just stands there instead of showing the death message)

View attachment 92480

Add prints in your scripts so that you can spot the moment where the script fails.
What upgrade system do you use?
If you try to call in items.xml your item 'epic sword' instead of 'sword' or I dunno, 'legendary axe', will it trigger the effect?
 
You do not need any source changes in otclient to have the tooltips...
otcv8 has all the necessary soruces already, you just need a few simple changes in otc scripts, the changes needed are already on the forum

The source changes are needed at the TFS side



Add prints in your scripts so that you can spot the moment where the script fails.
What upgrade system do you use?
If you try to call in items.xml your item 'epic sword' instead of 'sword' or I dunno, 'legendary axe', will it trigger the effect?
You're referring to tooltips, but the original question is about showing a colored background or frame depending on the item's rarity.

That feature is not present by default in OTClientV8. The client does not automatically display a visual background based on rarity that part needs to be handled manually in the src.

So while tooltips are supported, rarity-based background visuals are not included by default.
Post automatically merged:

I found a post that might help you with what you're looking for:

🔗 OTClientV8 - ItemTooltip + rarity frames + custom color on item name

It explains how to add rarity frames and custom item name colors in OTClientV8 tooltips.

Hope it helps!
 
Last edited:
Solution
You're referring to tooltips, but the original question is about showing a colored background or frame depending on the item's rarity.

That feature is not present by default in OTClientV8. The client does not automatically display a visual background based on rarity that part needs to be handled manually in the src.

So while tooltips are supported, rarity-based background visuals are not included by default.
Post automatically merged:

I found a post that might help you with what you're looking for:

🔗 OTClientV8 - ItemTooltip + rarity frames + custom color on item name

It explains how to add rarity frames and custom item name colors in OTClientV8 tooltips.

Hope it helps!

I had tried this link before and it did not work but i probably did something wrong, cause i tried it again now and the frames are working.

1747455970543.webp

But it gives me one bug that i gonna need to find the fix when making this changes: Added tooltips for inventory items · OTCv8/forgottenserver@7f5b4fb (https://github.com/OTCv8/forgottenserver/commit/7f5b4fbc08711124dec86b0fcd7bfd78dd1165c4)

The tooltip works fine

1747456054321.webp

But when i kill monsters this happens:
Gyazo Screen Video (https://gyazo.com/6718684b07ec166d03be7c523b3d8f90)
and when dying the characters just stands there
1747456348888.webp

The error i got on client is this one:
ERROR: ProtocolGame parse message exception (1398 bytes, 167 unread, last opcode is 0x00 (0), prev opcode is 0xa1 (161)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)

I will mark your answer as a solution since it fixed what i asked for, now just gotta fix this errors that i got :P

Thanks everyone who helped here.
 
You're referring to tooltips, but the original question is about showing a colored background or frame depending on the item's rarity.

That feature is not present by default in OTClientV8. The client does not automatically display a visual background based on rarity that part needs to be handled manually in the src.

So while tooltips are supported, rarity-based background visuals are not included by default.
Post automatically merged:

I found a post that might help you with what you're looking for:

🔗 OTClientV8 - ItemTooltip + rarity frames + custom color on item name

It explains how to add rarity frames and custom item name colors in OTClientV8 tooltips.

Hope it helps!
Frames is just a few lines in one .lua file 😑 what the heck are you on. Do you even know what source is. I Feel like its gpt answer - to some extent accurate but in the end dumb as f





Tell people to edit source when its not needed and they end up having character standing still after death


What do you have in packet.log?
 
Last edited:
I had tried this link before and it did not work but i probably did something wrong, cause i tried it again now and the frames are working.

View attachment 92527

But it gives me one bug that i gonna need to find the fix when making this changes: Added tooltips for inventory items · OTCv8/forgottenserver@7f5b4fb (https://github.com/OTCv8/forgottenserver/commit/7f5b4fbc08711124dec86b0fcd7bfd78dd1165c4)

The tooltip works fine

View attachment 92528

But when i kill monsters this happens:
Gyazo Screen Video (https://gyazo.com/6718684b07ec166d03be7c523b3d8f90)
and when dying the characters just stands there
View attachment 92529

The error i got on client is this one:
ERROR: ProtocolGame parse message exception (1398 bytes, 167 unread, last opcode is 0x00 (0), prev opcode is 0xa1 (161)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)

I will mark your answer as a solution since it fixed what i asked for, now just gotta fix this errors that i got :P

Thanks everyone who helped here.

change

void NetworkMessage::addItem(uint16_t id, uint8_t count, bool withDescription)

to

void NetworkMessage::addItem(uint16_t id, uint8_t count, bool withDescription /* = false */)

and compile
Post automatically merged:

Let's try this first
 
change

void NetworkMessage::addItem(uint16_t id, uint8_t count, bool withDescription)

to

void NetworkMessage::addItem(uint16_t id, uint8_t count, bool withDescription /* = false */)

and compile
Post automatically merged:

Let's try this first
Tried this but still the same problem.

What do you have in packet.log?
When killing monsters:
ProtocolGame parse message exception (879 bytes, 72 unread, last opcode is 0xd1 (209), prev opcode is 0x6a (106), proto: 1098): InputMessage eof reached

When dying:
ERROR: ProtocolGame parse message exception (5110 bytes, 155 unread, last opcode is 0x00 (0), prev opcode is 0xa1 (161)): InputMessage eof reached

It only happens if i make the TFS changes for the tooltip, but if I dont make those changes the client doesnt show the frames by only using the lua correctly, to make a test I changed the lua with an else white background in the end and all itens showed white in any rarity, it only get the different rarity with the tooltip working aswell.

But its probably something else that i have in the server/client that is bugging with others systems, cause the same happened when i tried to add dodge on the server, the dodge worked but the same 2 bugs show up.

I have another error on packet.log that happens right when i log in, its been there for some time but it didnt bug anything (that i found out at least) so i didnt try to fix it yet, gonna leave here just for information in case it might be related.
ERROR: ProtocolGame parse message exception (14652 bytes, 0 unread, last opcode is 0x32 (50), prev opcode is 0x32 (50)): InputMessage eof reached

Unfortunately I will be leaving in a few hours and gonna be out of city for some days, I gonna be able to work in this again just when i come back.
 
When I implemented tooltips I had to make sure I only sent tooltips for items that needed it. I also had to make the client ignore tooltips for items without them. I don't know if this is your problem or not but I do know if you are sending too much information all types of bugs will start popping up.
Post automatically merged:

Frames is just a few lines in one .lua file 😑 what the heck are you on. Do you even know what source is. I Feel like its gpt answer - to some extent accurate but in the end dumb as f





Tell people to edit source when its not needed and they end up having character standing still after death


What do you have in packet.log?
src edits are required for what he wants to do. In older tfs versions it wasn't especially if you used otcv8 version of it but if you are using more up-to-date tfs sources you will have to modify them.
 
src edits are required for what he wants to do. In older tfs versions it wasn't especially if you used otcv8 version of it but if you are using more up-to-date tfs sources you will have to modify them.
We're talking about otc source, theres no need to edit them for frames.
this is nonsense:
You need to modify the client (specifically the OTClient source) so it receives the rarity information from the server. For example, when the server sends an item, it should include something like getRarity or any way to indicate the item's rarity.
As I mentioned, needed are tfs source edits for frames to work, not client.
At client side its just 20 lines or so of code to add.

You people are unbelivable

Tried this but still the same problem.


When killing monsters:
ProtocolGame parse message exception (879 bytes, 72 unread, last opcode is 0xd1 (209), prev opcode is 0x6a (106), proto: 1098): InputMessage eof reached

When dying:
ERROR: ProtocolGame parse message exception (5110 bytes, 155 unread, last opcode is 0x00 (0), prev opcode is 0xa1 (161)): InputMessage eof reached

It only happens if i make the TFS changes for the tooltip, but if I dont make those changes the client doesnt show the frames by only using the lua correctly, to make a test I changed the lua with an else white background in the end and all itens showed white in any rarity, it only get the different rarity with the tooltip working aswell.

But its probably something else that i have in the server/client that is bugging with others systems, cause the same happened when i tried to add dodge on the server, the dodge worked but the same 2 bugs show up.

I have another error on packet.log that happens right when i log in, its been there for some time but it didnt bug anything (that i found out at least) so i didnt try to fix it yet, gonna leave here just for information in case it might be related.
ERROR: ProtocolGame parse message exception (14652 bytes, 0 unread, last opcode is 0x32 (50), prev opcode is 0x32 (50)): InputMessage eof reached

Unfortunately I will be leaving in a few hours and gonna be out of city for some days, I gonna be able to work in this again just when i come back.
try to change (increase) max packet size, i think its in const.h
 
We're talking about otc source, theres no need to edit them for frames.
this is nonsense:

As I mentioned, needed are tfs source edits for frames to work, not client.
At client side its just 20 lines or so of code to add.

You people are unbelivable


try to change (increase) max packet size, i think its in const.h
Yes, just send more information instead of doing it right. Unbelievable.
 
By removing the killtracker from the server the bug when killing monsters was solved, so it is some conflict between the two systems. (killtracker worked fine before making the src changes for the tooltip)
I still haven't solved the one when the character dies and stays still.
 
Back
Top