SetEventScript(object, int, string)

From NWN Lexicon
Revision as of 21:28, 17 May 2018 by Squatting Monk (talk | contribs) (OnDeath confirmed to work as well)
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.
Sets the given event script for the given object and handler.
int SetEventScript(
    object oObject,
    int nHandler,
    string sScript
);

Parameters

oObject
The object to get the event script from.
nHandler
An EVENT_SCRIPT_* constant matching the event to set the script on.
sScript
The script to attach to the event.

Description

Sets the given event script for the given object and handler.

Returns 1 on success, 0 on failure.

Will fail if oObject is invalid or does not have the requested handler.

Remarks

While this can set creature events for the PC, the only events that actually work on PCs are OnConversation, OnDeath, OnHeartbeat, and OnUserDefined.

Version

1.74.8164

See Also

functions: GetEventScript()
constants: EVENT_SCRIPT_* Constant Group