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

OTClient Item getName() returns empty

oen432

Legendary OT User
Joined
Oct 3, 2014
Messages
1,909
Solutions
55
Reaction score
2,137
Location
Poland
GitHub
Oen44
Hi,

I just found out that item in UIItem contains getItem() method, not sure if bug or not implemented yet but when using getName() on that item it returns empty string (or even null) but when using getCount() proper number is returned.
 
I guess this question is no longer actual, but you cant expect getName on the item object to return anything useful (from UIItem:getItem() and general Item/Thing), because otclient by default does not know names and other things of items, as far as I know client id and some attributes (from dat) is what otc know by default.
To make this getName return anything useful, you have to load your items.xml to otc. I think it has some methods for this.
 
And slow down client loading time by few seconds.
Probably, which doesn't matter mostly anyway, cause you do it in init, but what I used to do is just send item info when I needed it, like in modules or so.
 
Exactly what I said before :p This is one the best solutions. Same thing I did for item tooltips, send data when player hovers over item.
And cache it, right? No need to spam data each time someone hovers? Or am I wrong?
 
And cache it, right? No need to spam data each time someone hovers? Or am I wrong?
Exactly, it's an easy process if you care only about basic item data, it gets tricky if you have some kind of upgrading and one item (same type, same item id) can be different than the other.
 
Back
Top