Drake53 / War3Net

A .NET implementation of Warcraft III related libraries.
MIT License
124 stars 27 forks source link

Map.Open does not read object names or tooltips #43

Closed YakaryBovine closed 1 year ago

YakaryBovine commented 1 year ago

When I use Map.Open, the resulting UnitObjectData collection does not contain the names, tooltips, models, icons, etc of my custom units. The issue extends to all object types aside from Doodad, and seems to apply to all fields in which the user can type a string.

I am able to see the issue using this code, which fails to display the mentioned fields:

      var map = Map.Open(baseMapPath);
      var unitObjectData = map.UnitObjectData;
      foreach (var newUnit in unitObjectData.NewUnits)
      foreach (var mod in newUnit.Modifications)
        Console.WriteLine(mod.Value);

I'm using the latest Warcraft 3 version. Please let me know if you need any more information.

Drake53 commented 1 year ago

One of the Reforged patches (I think it was 1.33) changed object data to be split into two separate files, you should be able to find this data in Map.UnitSkinObjectData.

YakaryBovine commented 1 year ago

Thankyou, that makes sense. I'll double-check and confirm soon.

YakaryBovine commented 1 year ago

The data was indeed in there. Thanks again.