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

Some enums won't work #168

Closed
Tracked by #170 ...
VitalRus95 opened this issue Aug 17, 2021 · 3 comments
Closed
Tracked by #170 ...

Some enums won't work #168

VitalRus95 opened this issue Aug 17, 2021 · 3 comments

Comments

@VitalRus95
Copy link

I have an issue with the enums for classes from SB Opcode Library. I use an opcode Sound.AddOneOffSound(.0, .0, .0, 13), which is supposed to support an enum called ScriptSound, present in enums.txt. The function itself is described in classes.db the following way: AddOneOffSound,018C,0,0,("x%f" "y%f" "z%f" "soundId: ScriptSound"). But in SB, pressing Ctrl+Space doesn't show ScriptSound prompt, only the constants I use in the script.

@XMDS
Copy link

XMDS commented Aug 18, 2021

@VitalRus95 In fact, I don’t quite understand your description. Is there a screenshot example? The range of the ScriptSound enumeration of the SA Sound command: 1000-1190. They do not start from 0
For:
#141

@VitalRus95
Copy link
Author

VitalRus95 commented Aug 18, 2021

@XMDS, I forgot to mention it's for VC, not for SA. Seemann knows about this issue from Discord, he just asked me to remind him about it here. The problem is that this pop-up menu called by pressing Ctrl+Space doesn't show the necessary enum (I tried opening this prompt window for every parameter in the opcode, thinking that maybe their order was somehow broken, but still no result, it only shows the constants).
изображение

@x87
Copy link
Collaborator

x87 commented Jan 4, 2023

There are three problems with enums.

  1. The enums.txt parser correctly rejects enums whose fields are not valid identifiers (starts with a-z_,contains a-z0-9_). Example: GarageType contained a field called 60Seconds. This was fixed by adding extra validation rules in SBL and fixing wrong names. One should redownload the latest enums.txt.
  2. The enums.txt parser incorrectly rejects enums whose values are negative numbers (e.g. Any=-1 in GangModelOverride). This will be fixed in the core.dll update transform & enum parser fix core#10
  3. The enums.txt parsers stops on the first error and does not try to load the remaining enum definitions. This is why ScriptSound enum from OP does not appear on the list. That enum itself is correct, but preceding errors prevents it from being loaded. This behavior is acceptable, but might be misleading as it does not tell exactly what went wrong.

@x87 x87 added this to the v3.8.3 milestone Jan 4, 2023
@x87 x87 mentioned this issue Jan 4, 2023
6 tasks
@x87 x87 closed this as completed Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants