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
);


Parameters

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


Description

Transforms the given object into a json structure.


Remarks

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).


Version

This function was added in 1.85.8193.31 of NWN:EE.


Example

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

functions:

JSON Functions



author: Shadguy