Difference between revisions of "OnClick"

From NWN Lexicon
Jump to: navigation, search
(Undo revision 24521 by 208.91.64.206 (talk))
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=OnClick=
+
__NOTOC__This event appears on triggers and placeables. The script attached to this event fires when a trigger is entered by a PC, or when the placeable is clicked on by the player using the left mouse button.
  
This event appears on triggers and placeables. The script attached to this event fires when a trigger is entered by a PC, or when the placeable is clicked on by the player using the left mouse button.
+
====Function(s)====
  
<br />
+
* [[GetPlaceableLastClickedBy | GetPlaceableLastClickedBy() ]] called from a placeable's OnClick event script returns the PC who clicked on the placeable. This function only returns a valid result when called from a placeable's OnClick event script.
 +
* [[GetClickingObject]] can be used for a triggers OnClick event. The function is identical to [[GetEnteringObject]] so either can be used.
  
====Function(s)====
 
  
[[GetPlaceableLastClickedBy | GetPlaceableLastClickedBy() ]] called from a placeable's OnClick event script returns the PC who clicked on the placeable. This function only returns a valid result when called from a placeable's OnClick event script.
+
====Remarks====
  
<br />
+
Most types of area transitions use this event (although a trigger that is setup as the "Area Transition" type can make use of the wizard to do so).
  
====Remarks====
+
If a transition target is set and there is no script to fire it will fire '''NW_G0_Transition''' by default.
  
Most types of area transitions use this event (although a trigger that is setup as the "Area Transition" type can make use of the wizard to do so).<br /><br /> For placeables, the event is triggered immediately as soon as the placeable is clicked. This is in contrast to the [[ OnUsed | OnUsed ]] placeable event which doesn't fire until the clicking player is first made to walk over to the placeable.
+
For placeables, the event is triggered immediately as soon as the placeable is clicked. This is in contrast to the [[ OnUsed | OnUsed ]] placeable event which doesn't fire until the clicking player is first made to walk over to the placeable.
  
<br />
 
  
 
====See Also====
 
====See Also====
Line 24: Line 23:
 
|
 
|
 
[[GetPlaceableLastClickedBy | GetPlaceableLastClickedBy() ]]
 
[[GetPlaceableLastClickedBy | GetPlaceableLastClickedBy() ]]
 +
 +
[[GetClickingObject]]
 
|}
 
|}
  

Latest revision as of 13:50, 12 April 2021

This event appears on triggers and placeables. The script attached to this event fires when a trigger is entered by a PC, or when the placeable is clicked on by the player using the left mouse button.

Function(s)

  • GetPlaceableLastClickedBy() called from a placeable's OnClick event script returns the PC who clicked on the placeable. This function only returns a valid result when called from a placeable's OnClick event script.
  • GetClickingObject can be used for a triggers OnClick event. The function is identical to GetEnteringObject so either can be used.


Remarks

Most types of area transitions use this event (although a trigger that is setup as the "Area Transition" type can make use of the wizard to do so).

If a transition target is set and there is no script to fire it will fire NW_G0_Transition by default.

For placeables, the event is triggered immediately as soon as the placeable is clicked. This is in contrast to the OnUsed placeable event which doesn't fire until the clicking player is first made to walk over to the placeable.


See Also

functions: 

GetPlaceableLastClickedBy()

GetClickingObject


author: NWN Lexicon Group, editor: Mistress, Kookoo, contributor: Axe Murderer