giuinktse7 / LapisItemEditor

An item editor for the OTB format
MIT License
14 stars 10 forks source link

Proto Files Question #7

Closed Codinablack closed 7 months ago

Codinablack commented 7 months ago

On the readme.md you mention to clone Proto3d to generate proto files.

I have tried using this program to update a 13.10 otb to 13.20 with 13.20 assets, and save it as a 13.20 otb. I then changed the version numbers in itemloader and definitions for TFS and recompiled, then ran it. It reads the otb fine now, but I can't get passed the character screen...

I am of the mindset it has something to do with protobuffs and the proto files you were mentioning generating.

Is that what I need? How would I apply the generated proto files to the TFS project to get it to compile correctly? If I should just be able to update the items.otb and that's it, then its not working properly.

giuinktse7 commented 7 months ago

It's possible that the protobuf versions are causing this, although I don't know for certain. It's been a while since I tested the generated otb against TFS. I'll see if I can find someone else that might be able to give you more information regarding this.

The proto generation is for generating source files that can read the protobuf format of whatever Tibia client you used to generate them. These are the source files that are generated this way, and they are used to read the appearances.dat file: Backend/Tibia11/Protobuf/. These files are probably not the issue though - if they were, LapisItemEditor would probably fail when you try to load the appearances.dat file.

Trying to create an items.otb for an older client than the latest one that this tool supports might not work, as it could add otb attributes that your server does not support (Article is one such example). It would perhaps be better if it was selective in the attributes it wrote based on the configured otb version, but there's no such functionality currently. Although it wouldn't take a ton of effort to remove OTB attributes that are newer than the one you are targeting. You can do this in WriteItemTypes. For instance, if your otb version does not support Article, you would remove this part:

if (otbItem.HasArticle)
{
    var bytes = otbItem.Article.ToCharArray();
    writer.WriteAttributeType(OtbItemAttribute.Article, (ushort)bytes.Length);
    writer.WriteBytesWithoutSizeHint(bytes);
}
Codinablack commented 7 months ago

I was able to determine that its not items.otb or proto files. It is a problem with packets. I appreciate the thoroughness of your answer! Much appreciated! This is a great tool you have here and happy to have it, thank you!