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

C# help needed about item editor

Evil Puncker

prolonged absenteeism
TFS Developer
Joined
May 30, 2009
Messages
7,907
Solutions
197
Reaction score
3,723
I converted assets from tibia 12 and generated items.otb from the tibia spr/dat I got by using latest item editor

the items.otb got some client ids wrong

spr/dat files are ok because fixing client ids manually (through hex editor) in otb file displays correct sprites
and because both of us (me and @zbizu) have no idea how to fix item editor, we're asking for help because we believe something is wrong with the otb writer

 

kokokoko

Advanced OT User
Joined
Feb 4, 2008
Messages
913
Reaction score
236
I can't see anything in that code that would cause only some client IDs to be incorrect. How many does it get incorrectly? Can you provide some examples of expected ID vs actual ID? Is there any pattern to it, like all the wrong ones being above a certain value?
 

zbizu

Legendary OT User
Joined
Nov 22, 2010
Messages
3,131
Solutions
20
Reaction score
2,280
Location
Poland
GitHub
Zbizu
found only 2 bugged ids so far, not sure what might be causing it
server id​
client id​
expected client id​
in otb as​
expected​
4876​
4874​
0A 13​
4877​
7816​
4875​
88 1E​
0B 13​
4878​
4876​
0C 13​
4879​
4877​
0D 13​
4880​
4878​
0E 13​
4881​
4879​
0F 13​
4882​
24144​
4880​
50 5E​
10 13​

scrolled through ids added between 7.1 and 8.1 and only these are bugged
 

kokokoko

Advanced OT User
Joined
Feb 4, 2008
Messages
913
Reaction score
236
Hmm.. Might be related to the fact that these are item types where the base sprite is empty (no pixels)? There is code in the item editor that creates a hash based on the sprite of an item, and I'm guessing that that code uses the "base sprite" (offset 0) of an item type.

Maybe see if you are able to find a bugged id that does not share its "base sprite" with any other item type (or at least one with a non-empty base sprite).

You could also look at the places in the code where the Item editor generates these hashes (if any, I'm not sure if it's actually still used)
 
OP
Evil Puncker

Evil Puncker

prolonged absenteeism
TFS Developer
Joined
May 30, 2009
Messages
7,907
Solutions
197
Reaction score
3,723
guys, today I gave it a try again, client files 100% okay as you can see from the object builder screenshot bellow:
2021-09-14 02_49_46-Object Builder.png
(note: 23725 (client id) is the last item "brocade tapestry" from 10.98)

but now, look how the generated items.otb looks like:
2021-09-14 02_11_31-ItemEditor 0.5.png
(note: 26831 (server id) item "brocade tapestry" image is missing and the new first item generated that should be that green vortex, is a sand tile!!!!)

I don't even need to say that everything else is wrong, right?
 
OP
Evil Puncker

Evil Puncker

prolonged absenteeism
TFS Developer
Joined
May 30, 2009
Messages
7,907
Solutions
197
Reaction score
3,723
@soul4soul @kokokoko @zbizu
hello guys I've got new information once again, maybe this one is useful...

the last 10.98 item is "brocade tapestry" and next item from next client version should be the "green vortex"

AND when the item otb is generated (updated), the green vortex is 55 (or 56?) IDs higher than it should be...


bad news: there are 55 trash items appearing out of nowhere between (yes these items are not new and doesn't exist in client files)

good news: the item sequence after these 55 items is still the same, in other words, we have consistency


TL;DR: we need to find out why item editor is generating these 55 trash items and fix it (and/or delete them, but item editor doesn't have that option)
 
Top