From NWN Lexicon
Revision as of 08:38, 19 March 2023 by Shadguy (talk | contribs) (first version)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Nwnee logo.jpg Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.

Generate a VM debug view into the current execution location.

json GetScriptBacktrace(
    int bIncludeStack = TRUE


Include stack info in the output, if TRUE.


Generate a VM debug view into the current execution location.

- Names and symbols can only be resolved if debug information is available (NDB file).
- This call can be a slow call for large scripts.
- Setting bIncludeStack = TRUE will include stack info in the output, which could be a lot of data for large scripts. You can turn it off if you do not need the info.

Returned data format (JSON object):

  "frames": array of stack frames:
    "ip": instruction pointer into code
    "bp", "sp": current base/stack pointer
    "file", "line", "function": available only if NDB loaded correctly
  "stack": abbreviated stack data (only if bIncludeStack is TRUE)
    "type": one of the nwscript object types, OR:
    "type_unknown": hex code of AUX
    "data": type-specific payload. Not all type info is rendered in the interest of brevity. Only enough for you to re-identify which variable this might belong to.


Information icon.png This section of the article is a stub. You can help the NWN Lexicon by expanding it.


This function was added in 1.86.8193.35 of NWN:EE.


Information icon.png This article is in need of examples. You can help the NWN Lexicon by showing how to use this code effectively.

See Also

 author: Shadguy