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

getBasicSymbolID fails when using m-ba.js #31

Open
sjpinizzotto opened this issue May 23, 2018 · 2 comments
Open

getBasicSymbolID fails when using m-ba.js #31

sjpinizzotto opened this issue May 23, 2018 · 2 comments

Comments

@sjpinizzotto
Copy link

When trying to use utility method armyc2.c2sd.renderer.utilities.SymbolUtilities.getBasicSymbolID, I get the following error:

image

This does not occur in the savm-bc.js

@sjpinizzotto
Copy link
Author

I was converting "SFGPUCI----K---"

@michael-spinelli
Copy link
Contributor

So there's a few things.

  1. when the renderer just has 'm' in from of the dash, we're assuming the need is only for multipoints. UnitDefTable is not loaded in m-b.js so getBasicSymbolID() failed because it can't do a check against the UnitDefTable
  2. we do a check against the UnitDefTable because there are a handful of symbols where an Installation or mobility modifier is a part of the basic symbol code and removing it changes the symbol. If you're not concerned with that check, call getBasicSymbolIDStrict() and it will replace affiliation, status and any modifiers with '*'.

To resolve this

  1. use getBasicSymbolIDStrict() as mentioned above
    or
  2. use a different output version of the renderer. "sm-b.js" perhaps.
    or
  3. load UnitConstantsB.js and/or UnitConstantsC.js along with UnitDefTable manually so that they're available. Then call UnitDefTable.init(); I've not tested that but I think it would work. UnitDefTable will automatically feed off of whichever UnitContants files you've loaded when you call init.

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