Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run War3Api.Generator.Object #3

Closed
YakaryBovine opened this issue Oct 11, 2021 · 2 comments
Closed

Unable to run War3Api.Generator.Object #3

YakaryBovine opened this issue Oct 11, 2021 · 2 comments

Comments

@YakaryBovine
Copy link
Contributor

Would you please be able to provide some guidance on running this project? I have done the following:

  1. Cloned the solution
  2. Copied the relevant files from my Warcraft 3 installation CASC into the API folder
  3. Ran War3Api.Generator.Object/Progam.cs
  4. Received the unhandled exception
"System.Exception: 'Key WESTRING_CAMERAPROPS_PREVIEW_ASPECT_RATIO_GRID already added:
Was 'Preview &Aspect Ratio Grid'
Tried to add 'Preview Aspect Ratio''"

I don't know how to interpret this error.

@Drake53
Copy link
Owner

Drake53 commented Oct 11, 2021

You technically don't have to copy your files to the API folder, you can also set the InputAbsolute path directly to the location where you extracted the CASC.
The exception is caused by the fact that multiple translation string keys (WESTRING_...) were found with different values. This is a problem if you want to add these to a dictionary. If the keys have the same values this problem is ignored, but when they are different it throws an exception.
I am assuming you are using patch 1.32, since this doesn't happen for me when I use the game data from patch 1.31.
To avoid this issue just remove the exception from the code, then it will simply add the first keyvaluepair it finds to the dictionary, and other kvps with the same key will be ignored.

@YakaryBovine
Copy link
Contributor Author

Thankyou, that makes sense. I failed to mention that removing the exception did seem to resolve the issue but I wasn't sure if it would break something else. You're correct that I'm on patch 1.32; I don't really understand why its editor string files have duplicate keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants