OnPlayerTarget
The script attached to this event fires when EnterTargetingMode is activated.
Trigger
When EnterTargetingMode is used and the player either selects a target or manually exits targeting mode.
Function(s)
- GetLastPlayerToSelectTarget - The player that has targeted something
- GetTargetingModeSelectedPosition - The vector in the current area targeted by the player
- GetTargetingModeSelectedObject - The object targeted by the player
Remarks
Note: Currently you must use SetEventScript(GetModule(), EVENT_SCRIPT_MODULE_ON_PLAYER_TARGET, "script_name"). You cannot set this in the module properties yet.
There is no default script for this event, and therefore the default behaviour for this event is to do nothing at all.
Once set however and EnterTargetingMode is called the player can target an appropriate thing or location. This event will fire if the player targets an object or manually exits targeting mode.
This then can do something related to what occured; some ideas:
- Conversation option to "pick an item to upgrade" allows the player to open the inventory next to the conversation, and select an item from it
- A speakstring (hidden/whispered) of a player is captured, and causes this event to fire, eg; to have a visual effect appear at the chosen location
- Another event, such as using an item or spell (eg; "Use Item (On Self)"), activates this to target the effects of said item
To do multi-select, or once a target is checked and is invalid, you could easily have this event call EnterTargetingMode again meaning it fires again.
Known Bugs
Version
Example
See Also
functions: |
EnterTargetingMode GetLastPlayerToSelectTarget GetTargetingModeSelectedPosition GetTargetingModeSelectedObject |