Difference between revisions of "Osiris/API/ObjectIsInTrigger"
From Divinity Engine Wiki
m (Mention that it fails if trigger is not in the current level) |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
===== Full Definition(s) ===== | ===== Full Definition(s) ===== | ||
− | * query '''ObjectIsInTrigger'''('''''[in]'''(GUIDSTRING)'''''_Object''', ''''[in] | + | * query '''ObjectIsInTrigger'''('''''[in]'''(GUIDSTRING)'''''_Object''', '''''[in]'''(TRIGGERGUID)'''''_Trigger''', '''''[out]'''(INTEGER)'''''_Bool''') |
===== Description ===== | ===== Description ===== | ||
− | Returns whether '''_Object''' is inside '''_Trigger'''. It does not require that '''_Trigger''' has been registered for '''_Object'''. '''_Object''' can be a character, item, or another object such as a trigger or spline. In the non-character/item case, it will | + | Returns whether '''_Object''' is inside '''_Trigger'''. It does not require that '''_Trigger''' has been registered for '''_Object'''. '''_Object''' can be a character, item, or another object such as a trigger or spline. In the non-character/item case, it will check whether the centre/"position" (as shown in the editor) of this other object is in the trigger (o/e/; it will not check whether an entire box trigger is inside the boundaries in another box trigger). |
If '''_Object''' is an item and it is currently inside a container or a character's inventory, the query will check whether the outermost container/character is inside '''_Trigger'''. | If '''_Object''' is an item and it is currently inside a container or a character's inventory, the query will check whether the outermost container/character is inside '''_Trigger'''. | ||
Line 9: | Line 9: | ||
* '''_Bool''': '''1''' if '''_Object''', or its outermost container/owning character, is currently in the '''_Trigger'''. | * '''_Bool''': '''1''' if '''_Object''', or its outermost container/owning character, is currently in the '''_Trigger'''. | ||
===== Notes ===== | ===== Notes ===== | ||
− | * | + | * This is a fairly expensive check. |
===== See Also ===== | ===== See Also ===== | ||
* [[Osiris/API/CharacterEnteredTrigger|CharacterEnteredTrigger]] | * [[Osiris/API/CharacterEnteredTrigger|CharacterEnteredTrigger]] | ||
Line 18: | Line 18: | ||
* Helper [[Osiris/Shared/DB_InRegion|DB_InRegion]] | * Helper [[Osiris/Shared/DB_InRegion|DB_InRegion]] | ||
− | [[Category:Osiris Queries]] | + | [[Category:Osiris Queries|ObjectIsInTrigger]] |
Latest revision as of 21:30, 12 January 2018
Full Definition(s)
- query ObjectIsInTrigger([in](GUIDSTRING)_Object, [in](TRIGGERGUID)_Trigger, [out](INTEGER)_Bool)
Description
Returns whether _Object is inside _Trigger. It does not require that _Trigger has been registered for _Object. _Object can be a character, item, or another object such as a trigger or spline. In the non-character/item case, it will check whether the centre/"position" (as shown in the editor) of this other object is in the trigger (o/e/; it will not check whether an entire box trigger is inside the boundaries in another box trigger).
If _Object is an item and it is currently inside a container or a character's inventory, the query will check whether the outermost container/character is inside _Trigger.
Return Values
- Success/Failure: Default return value. The query will also always fail if _Trigger is not in the current level (even if the trigger is global).
- _Bool: 1 if _Object, or its outermost container/owning character, is currently in the _Trigger.
Notes
- This is a fairly expensive check.