Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Support [prefix] and [suffix] properties when using existing nip files #903

Open
hutber opened this issue Jun 18, 2022 · 3 comments
Open

Comments

@hutber
Copy link

hutber commented Jun 18, 2022

I have been trying to use the pickits I know very well already from: https://github.com/blizzhackers/pickits/tree/master/d2nt

but I get the error below when trying

$ ./main.exe
[0.8.0 2022-06-18 21:34:38,360] DEBUG      Loading config
[0.8.0 2022-06-18 21:34:39,309] WARNING    Unknown property lookup: "prefix" [name] == smallcharm && [quality] == magic && [prefix                                                                      ] == 1407 && [suffix] > 0  NipSections.PROP
[0.8.0 2022-06-18 21:34:39,310] WARNING    Unknown property lookup: "suffix" [name] == smallcharm && [quality] == magic && [prefix                                                                      ] == 1407 && [suffix] > 0  NipSections.PROP
Traceback (most recent call last):
  File "nip\actions.py", line 208, in _load_nip_expressions
  File "nip\transpile.py", line 439, in load_nip_expression
  File "nip\transpile.py", line 421, in generate_expression_object
  File "nip\transpile.py", line 402, in prepare_nip_expression
  File "nip\transpile.py", line 289, in validate_nip_expression_syntax
nip.lexer.NipSyntaxError: NIP_0x13:Invalid token 'prefix' in property section:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "game_controller.py", line 6, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "bot.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "health_manager.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "inventory\belt.py", line 6, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "inventory\personal.py", line 24, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "nip\actions.py", line 237, in <module>
  File "nip\actions.py", line 210, in _load_nip_expressions
IndexError: list index out of range
[72532] Failed to execute script 'main' due to unhandled exception!


@jagarop
Copy link
Collaborator

jagarop commented Jun 22, 2022

would help if you attach the specific pickit file you having problem with.

@Ezro Ezro added the question Question should be asked on the discord channel label Jun 25, 2022
@Ezro Ezro changed the title Unable to use pickits from blizzhackers Support [prefix] property when using existing nip files Jun 25, 2022
@Ezro Ezro changed the title Support [prefix] property when using existing nip files Support [prefix] and [suffix] properties when using existing nip files Jun 25, 2022
@Ezro Ezro added bug Something isn't working and removed question Question should be asked on the discord channel labels Jun 25, 2022
@Ezro
Copy link
Collaborator

Ezro commented Jun 25, 2022

Example nip line containing prefix and suffix

Todo: find map of prefix and suffix values

@Ezro
Copy link
Collaborator

Ezro commented Jun 25, 2022

After chatting with @Riddle1001 about it, we're still trying to figure out how to map from 1407 -> meaningful value.

So far, the closest mapping (from data/local/lng/strings/item-nameaffixes.json) looks something like this, but id 1407 wasn't found:

{
    "id": 20904,
    "Key": "Shimmering",
    "enUS": "Shimmering",
    "zhTW": "閃耀",
    "deDE": "[ms]schimmernder[fs]schimmernde[ns]schimmerndes[pl]schimmernde",
    "esES": "[fs]reluciente[ms]reluciente[fp]relucientes[mp]relucientes",
    "frFR": "[ms]miroitant[mp]miroitants[fs]miroitante[fp]miroitantes",
    "itIT": "[ms]Splendente[fs]Splendente[mp]Splendenti[fp]Splendenti",
    "koKR": "반작이는",
    "plPL": "[fs]Lśniąca[ms]Lśniący[nl]Lśniące",
    "esMX": "[ms]resplandeciente[fs]resplandeciente[mp]resplandecientes[fp]resplandecientes",
    "jaJP": "揺らめく",
    "ptBR": "[ms]Reluzente[mp]Reluzentes[fs]Reluzente[fp]Reluzentes",
    "ruRU": "[ms]мерцающий[fs]мерцающая[ns]мерцающее[pl]мерцающие",
    "zhCN": "光彩"
}

That's to say that it's unknown if the value listed (20904) would map to [prefix]==20904 or not.

Additionally, the idea of using strings was mentioned and could be supported without much issue, but we would still need to figure out the id mapping. e.g.,

[prefix]==Shimmering && [suffix]=Vita

@Ezro Ezro added enhancement and removed bug Something isn't working labels Jun 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants