This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
building:scripts:events:variable_based [2019/03/11 04:18] Mavrixio |
building:scripts:events:variable_based [2019/03/11 04:42] Mavrixio |
||
---|---|---|---|
Line 16: | Line 16: | ||
void UnregisterVariableEvent(object oObject, string sEvent, string sScript); | void UnregisterVariableEvent(object oObject, string sEvent, string sScript); | ||
</code> | </code> | ||
+ | |||
+ | ===== Accessing the Parameters ===== | ||
+ | - The registered scripts will run in the same context as the calling script so for example: EVENT_USE is called by [[https://nwn.sinfar.net/res_nss_edit.php?name=pc_ev_useitem|pc_ev_useitem]] so you can still get the item with GetEventParamObject(0). | ||
+ | - A variable event can also have its own parameters, they can be accessed with the following methods: \\ <code> | ||
+ | array GetCurrentVariableEventParams();</code> | ||
+ | - You can get the object on which the variable event was registered (it may not be the caller) and the currently running variable event (in case that you decide to register the same script to many events) with the following functions:<code>object GetCurrentVariableEventTarget(); | ||
+ | string GetCurrentVariableEvent();</code> | ||
===== Creating / Running a Variable Based Event ===== | ===== Creating / Running a Variable Based Event ===== |