Drake53/War3Net

get_ValueAsBool error when building map

Closed this issue · 5 comments

Hi, I get this error when I try to build my map:

image

image

Seems that it cannot conert the "ubdg" unit modification into a boolean.

Here is my repo if you'd like to reproduce the error on your end. Just need to run the Launcher and hit 3.
https://github.com/YakaryBovine/AzerothWarsCSharp/tree/jass-transpiled

ValueAsBool/etc doesn't actually convert the value, it only checks if the 'object Value' property is a bool. However, as you can also see from the Type property, it's actually an int. So it actually seems more like an issue with your war3map.w3u file which has saved an ubdg property as int, even though according to unitmetadata.slk this property should be a bool.

Cool, that makes sense. It wouldn't be the first time this map has had broken data. I'll just confirm before I close.

Ok, I don't think the problem is on my end. You can reproduce the issue on a new map like so:

  1. Place a Way Gate on the map.
  2. Place a region on the map.
  3. Make the region the destination of the Way Gate.
    image
  4. Change the Way Gate unit type's Is a Building field to false.
    image

Forgot this was a thing: Drake53/War3Api#14
Should be fixed in v5.4.2: 4f6ac27

Yep, that fixed it and I can now build again. Thankyou!