ObjectToJson(object, int)

From NWN Lexicon
Jump to: navigation, 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.

Transforms the given object into a json structure.

json ObjectToJson(
    object oObject,
    int bSaveObjectState = FALSE


The object to translate into json.
specifies whether to include more detailed info in some cases; see below.


Transforms the given object into a json structure.


The json format is compatible with what niv's nimtools produce. Returns the null json type on errors, or if oObject is not serializable, with JsonGetError filled in. Supported object types: creature, item, trigger, placeable, door, waypoint, encounter, store, area (combined format) If bSaveObjectState is TRUE, local vars, effects, action queue, and transition info (triggers, doors) are saved out (except for Combined Area Format, which always has object state saved out).


This function was added in 1.85.8193.31 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


JSON Functions

author: Shadguy