Skip to content

Some enums won't work #168

Closed
Closed

Description

@VitalRus95

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.

Activity

  1. XMDS commented on Aug 18, 2021

    @XMDS
    Member

    @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

  2. VitalRus95 commented on Aug 18, 2021

    @VitalRus95
    Author

    @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).
    изображение

  3. x87 commented on Jan 4, 2023

    @x87
    Collaborator

    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.
  4. added this to the v3.8.3 milestone on Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions