EventConversation

From NWN Lexicon
Jump to: navigation, search



EventConversation()

Returns an event of type Conversation.

Description

Returns a conversation event which can be used as the argument in the SignalEvent() function to trigger the object's OnConverstation event.



Remarks

EventConverstaion() only creates the event. SignalEvent() must be used to cause the event to trigger.


Version

1.22

Example

// Example 1 - The following code creates an event and then uses the SignalEvent() function to cause the OnConversation event to trigger.
 
void main()
{
  event evConversation;
  object oNPC = GetLastPerceived();
  if (oNPC != OBJECT_INVALID)
  {
    evConversation = EventConversation();
    SignalEvent(oNPC, evConversation);
  }
}
 
// Example 2 - How to use EventConversation within the 
// SignalEvent function without casting an event variable.  
// This is how EventConversation() is most it typically used.
 
  SignalEvent(oNPC, EventConversation());

See Also

functions: 

SignalEvent



 author: Brett Lathrope