Skip to content

Script reference improvements #727

Description

@CharlesFolz4

In events, scripts can be referenced in events via a numeric script ID
In scripts, external scripts can be referenced via CallCommonScript with a numeric script ID
Init scripts can also reference a ScriptID via InitScriptGoToIfEqual
In C code, scripts can be referenced by calling ScriptManager_Change() with a numeric script ID
These script IDs get converted into a numeric ScriptEntry offset via ScriptContext_LoadAndOffsetID()

Both the script IDs and the ScriptEntry offsets are magic numbers that are not very readable. Translating them into the label of the script that is being called is inconvenient, finding all references is annoying. The manual process of doing this is potentially and unnecessarily error-prone for the user.
A json entry of "script": 2027 is not very readable, nor is a script line of CallCommonScript 0x7FC.

This issue has been run into and initially discussed in #688 and #690. An initial solution was discussed, and it was decided that instead of slotting in a solution that worked for that one case, a more comprehensive solution was preferred. Ideally, there should be some consistent way of linking the scriptID, the ScriptEntry offset, and the name of the label, in some sort of unified value that is consistent, readable, and easily searchable.

So far, the only proposal for this was put forwards by @metallicity here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions