Difference between revisions of "SignalEvent"

From NWN Lexicon
Jump to: navigation, search
Line 1: Line 1:
 +
{{DISPLAYTITLE:SignalEvent(object, event)}}__NOTOC__
 
Causes an object to fire a specified event.
 
Causes an object to fire a specified event.
 
 
<nwscript>
 
<nwscript>
 
void SignalEvent(
 
void SignalEvent(
Line 11: Line 11:
 
; oObject
 
; oObject
 
: The Object you want to have run an event.
 
: The Object you want to have run an event.
 
 
; evToRun
 
; evToRun
 
: The event to have the object run. Must be constructed using one of the event functions.
 
: The event to have the object run. Must be constructed using one of the event functions.
  
 
===Description===
 
===Description===
Causes oObject to run evToRun. Allows objects to fire off events in other objects. The events you can run include the default events provided by BioWare as well as user defined events the object has scripted. The event parameter must be an actual event created by one of the many event functions.
+
 
 +
Causes oObject to run evToRun. Allows objects to fire off events in other objects. The events you can run include the default events provided by Bioware as well as user defined events the object has scripted. The event parameter must be an actual event created by one of the many event functions.
  
 
===Remarks===
 
===Remarks===
 +
 
The only events which are valid are:
 
The only events which are valid are:
* [[EventActivateItem]](): calls a modules Activate Item script.
+
* [[EventActivateItem]](): calls a modules [[OnActivateItem]] Item script.
* [[EventConversation]](): which calls an objects conversation script.
+
* [[EventConversation]](): which calls an objects [[OnConversation]] script.
* [[EventSpellCastAt]](): fires an objects On Spell Cast At script.
+
* [[EventSpellCastAt]](): fires an objects [[OnSpellCastAt]] script.
* [[EventUserDefined]](): fires an object/module/area's User Defined Event script.
+
* [[EventUserDefined]](): fires an object/module/area's [[OnUserDefined]] Event script.
  
 
They could be defined, but it is more likely they are put directly into the SignalEvent(), like the example below.
 
They could be defined, but it is more likely they are put directly into the SignalEvent(), like the example below.
Line 49: Line 50:
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
|
 
|
[[EventUserDefined|EventUserDefined]]
+
[[EventUserDefined|EventUserDefined]] [[EventActivateItem]] [[EventConversation]] [[EventSpellCastAt]]
 
|-
 
|-
 
| width="1px" align="right" valign="top" | <font color="gray">constants: </font>
 
| width="1px" align="right" valign="top" | <font color="gray">constants: </font>
Line 55: Line 56:
 
[[ event | Event Constants  ]]
 
[[ event | Event Constants  ]]
 
|}
 
|}
 
{| class="seealso"
 
|}
 
 
  
 
----
 
----
 
<font color="gray">  author: John Shuell, editor: Jasperre, additional contributor(s): Darrell Knapp</font>
 
<font color="gray">  author: John Shuell, editor: Jasperre, additional contributor(s): Darrell Knapp</font>
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:Miscellaneous_Functions]]{{DISPLAYTITLE:SignalEvent(object, event)}}
+
[[Category:Miscellaneous_Functions]]

Revision as of 00:10, 26 December 2020

Causes an object to fire a specified event.

void SignalEvent(
    object oObject,
    event evToRun
);

Parameters

oObject
The Object you want to have run an event.
evToRun
The event to have the object run. Must be constructed using one of the event functions.

Description

Causes oObject to run evToRun. Allows objects to fire off events in other objects. The events you can run include the default events provided by Bioware as well as user defined events the object has scripted. The event parameter must be an actual event created by one of the many event functions.

Remarks

The only events which are valid are:

They could be defined, but it is more likely they are put directly into the SignalEvent(), like the example below.

Version

1.64

Example

// Fire the modules event 100, which could trigger some event such as a cutscene.
void main()
{
    // Get the module
    object oModule = GetModule();
 
    // Signal the user defined event
    SignalEvent(oModule, EventUserDefined(100));
}

See Also

functions: 

EventUserDefined EventActivateItem EventConversation EventSpellCastAt

constants:

Event Constants


 author: John Shuell, editor: Jasperre, additional contributor(s): Darrell Knapp