Skip to content

Feature request: MWSE functions for reading a reference's local script (xIsScripted, xGetLocalVar) #10

@Nakashio

Description

@Nakashio

New MWSE functions (called on a long/reference):

  • entity->xGetLocalScript returns scriptid (long/string) of entity's local script or 0 if entity has no local script attached. Possibly returns -1 or similar if it's outright impossible for the entity to have a script attached (invalid reference or reference of a type which can't have a script). Renders adding an xIsScripted function obsolete as it includes it.

  • entity->xGetLocalVar varname (long/string) (returns long - separate function for floats?) : retrieves the value of the local var varname in entity's local script.
    Possibility to support varname as both MWSE string (long) and hardcoded string literal?
    This will probably require a complementary entity->xGetIsLocalVarDefined varname function (or a 2nd return value from xGetLocalVar) to differentiate the case when the local script of reference doesn't actually have varname defined (the status itself of the local var being defined or not can be important to get with special local shorts such as companion, nolore, nohello)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions