Difference between revisions of "Osiris API Tips Queries"
(Blanked the page) |
|||
Line 1: | Line 1: | ||
− | + | <div> | |
+ | <h3>Queries</h3> | ||
+ | <p>Queries request information about the state of the world from Osiris. They can be used in the part of a rule that checks conditions. Queries almost always succeed, except if you pass an initialised value as an <b><i>[out]</i></b> parameter and it does not match the value the query would returns. Below, this will be called the <b>Default Return Value</b>. If a query can also fail under other circumstances, this will be mentioned.<br> | ||
+ | </p> | ||
+ | <p><br> | ||
+ | </p> | ||
+ | <div> | ||
+ | <div> | ||
+ | <h4 style="font-size:1.1em;color:rgb(36,53,93)">CharacterGetEquippedItem</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b>CharacterGetEquippedItem</b>(<i><b>[in]</b>(CHARACTERGUID)</i><b>_Character</b>,<i><b> [in]</b>(STRING)</i><b>_Slotname</b>,<i><b> [out]</b></i>(<i>GUIDSTRING</i>)<b>_ItemGUID</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | </div> | ||
+ | <p>Returns in <b>_ItemGUID</b> the item equipped by <b>_Character</b> in slot <b>_Slotname</b>, if any.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b><b><b>Success/Failure</b>: </b></b>Fails if <b>_Character</b> does not exist, or if no item is equipped in <b>_Slotname</b>.<br> | ||
+ | </li> | ||
+ | <li><b>_ItemGuid</b>: The item equipped by <b>_Character</b> in <b>_Slotname.</b><br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li>The valid values for <b>_Slotname</b> are: <b>Helmet</b>, <b>Amulet</b>, <b>Breast</b>, <b>Belt</b>, <b>Gloves</b>, <b>Leggings</b>, <b>Boots</b>, <b>Weapon</b>, <b>Shield</b>, <b>Ring</b>, <b>Ring2</b>.<br> | ||
+ | </li></ul> | ||
+ | <p><u>See also</u></p> | ||
+ | <ul><li><b>CharacterUnequipItem</b><br> | ||
+ | </li></ul> | ||
+ | <div> | ||
+ | <h4>CharacterGetHenchmanPresetPrice</h4> | ||
+ | <div style="font-size:13.3333px"> | ||
+ | <p style="font-size:13.3333px"><u>Full definitions</u></p> | ||
+ | <ul style="font-size:13.3333px"><li>query <b>CharacterGetHenchmanPresetPrice</b>(<i><b>[in]</b></i>(STRING)<b>_Preset</b>,<b> </b><i style="font-size:13.3333px"><b>[in]</b>(CHARACTERGUID)</i><b style="font-size:13.3333px">_Character</b><span style="font-size:13.3333px">, <b><i>[out]</i></b><i>(INTEGER)</i><b>_Price</b></span>)</li></ul> | ||
+ | <u style="font-size:13.3333px">Description</u><br style="font-size:13.3333px"> | ||
+ | <p style="font-size:13.3333px">Returns the price of the preset scaled to the level of <b>_Character</b>.<br> | ||
+ | </p> | ||
+ | <p style="font-size:13.3333px"><u>Return values</u></p> | ||
+ | <ul style="font-size:13.3333px"><li><b>_Price</b>: The price of the preset scaled to the level of <b>_Character.</b><br> | ||
+ | </li></ul> | ||
+ | <p style="font-size:13.3333px"><u>Notes</u></p> | ||
+ | <ul style="font-size:13.3333px"><li>Presets come from the folder <b>".../DOS2/Data/Mods/Shared/CharacterCreation/HenchmanPresets/"</b></li> | ||
+ | <li>Presets can be customized using the following documentation: <b>link</b></li></ul> | ||
+ | <div> | ||
+ | <p style="font-size:13.3333px"><u>See also</u></p> | ||
+ | <ul style="font-size:13.3333px"><li><b>CharacterApplyHenchmanPreset</b><br> | ||
+ | </li></ul> | ||
+ | </div> | ||
+ | </div> | ||
+ | </div> | ||
+ | <div> | ||
+ | <div> | ||
+ | <h4>CharacterIsAlly</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b>CharacterIsAlly</b>(<i><b>[in]</b>(CHARACTERGUID)</i><b>_Character</b>,<i><b> </b></i><i><b><i><b>[in]</b></i></b><i>(CHARACTERGUID)</i></i><b><b>_OtherCharacter</b></b><i><b>,<i><b> </b></i>[out]</b></i>(INTEGER)<b>_Bool</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | <p>Returns whether <b>_Character</b> is an ally of <b>_OtherCharacter</b>.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b><b><b>Success/Failure</b>:</b></b> Default return value.<br> | ||
+ | </li> | ||
+ | <li><b>_Bool</b>: <b>1</b> if <b>_Character</b> and <b>_OtherCharacter </b>are allies, <b>0</b> if not<b>.</b><br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li>Also works outside combat.</li> | ||
+ | <li>If <b>_Character</b> or <b>_OtherCharacter</b> is dead or dying, the result solely depends on the characters' alignments (factions). If they are alive, it is also influenced by temporary hostile relations, e.g. induced by attacking a neutral character.<br> | ||
+ | </li></ul> | ||
+ | <p><u>See also</u></p> | ||
+ | <ul><li><b>CharacterIsNeutral</b></li> | ||
+ | <li><b>CharacterIsEnemy<br> | ||
+ | </b></li></ul> | ||
+ | <h4>CharacterIsEnemy</h4> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li>See <b>CharacterIsAlly</b> for detailed information, except that this query returns whether the characters are enemies.<br> | ||
+ | </li></ul> | ||
+ | <p><u>See also</u></p> | ||
+ | <ul><li><b>CharacterIsAlly</b></li> | ||
+ | <li><b>CharacterIsEnemy<br> | ||
+ | </b></li></ul> | ||
+ | <h4>CharacterIsNeutral</h4> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li>See <b>CharacterIsAlly</b> for detailed information, except that this query returns whether the characters are neutral.<br> | ||
+ | </li></ul> | ||
+ | <p><u>See also</u></p> | ||
+ | <ul><li><b>CharacterIsAlly</b></li> | ||
+ | <li><b>CharacterIsEnemy<br> | ||
+ | </b></li></ul> | ||
+ | <h4>CharacterIsPartyFollower</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b>CharacterIsPartyFollower</b>(<i><b>[in]</b>(CHARACTERGUID)</i><b>_Character</b>,<i><b> </b></i><i><b>[out]</b></i>(INTEGER)<b>_Bool</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | </div> | ||
+ | <p>Returns whether <b>_Character</b> is a character that follows a player character around. An NPC can be instructed to do so through <b>CharacterFollowCharacter</b>.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b><b><b>Success/Failure</b>: </b></b>Fails if <b>_Character</b> does not exist<b>.</b><br> | ||
+ | </li> | ||
+ | <li><b>_Bool</b>: <b>1</b> if <b>_Character</b> is a party follower, <b>0</b> if not<b>.</b><br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li><b>CharacterIsPlayer</b> will also return true for party followers.<br> | ||
+ | </li></ul> | ||
+ | <p><u>See also</u></p> | ||
+ | <ul><li><b>CharacterIsPlayer</b></li> | ||
+ | <li><b>CharacterFollowCharacter</b></li></ul> | ||
+ | <h4>CharacterIsPlayer</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b>CharacterIsPlayer</b>(<i><b>[in]</b>(CHARACTERGUID)</i><b>_Character</b>,<i><b> </b></i><i><b>[out]</b></i>(INTEGER)<b>_Bool</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | </div> | ||
+ | <p>Returns whether <b>_Character</b> is <i>player-controlled</i>.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b><b><b>Success/Failure</b>: </b></b>Fails if <b>_Character</b> does not exist<b>.</b><br> | ||
+ | </li> | ||
+ | <li><b>_Bool</b>: <b>1</b> if <b>_Character</b> is <i>player-controlled</i>, <b>0</b> if not<b>.</b><br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li>Apart from avatars and recruited companions, <i>player-controlled</i> characters also include summons and followers.</li></ul> | ||
+ | <p><u>See also</u></p> | ||
+ | <ul><li><b>CharacterIsPartyFollower</b></li> | ||
+ | <li><b>CharacterIsSummon</b></li> | ||
+ | <li><b>CharacterFollowCharacter</b></li></ul> | ||
+ | <h4>CharacterIsSummon</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b>CharacterIsSummon</b>(<i><b>[in]</b>(CHARACTERGUID)</i><b>_Character</b>,<i><b> </b></i><i><b>[out]</b></i>(INTEGER)<b>_Bool</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | <p>Returns whether <b>_Character</b> is a summon. Summon can be <i>player-controlled</i> or not.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b><b><b>Success/Failure</b>: </b></b>Fails if <b>_Character</b> does not exist<b>.</b><br> | ||
+ | </li> | ||
+ | <li><b>_Bool</b>: <b>1</b> if <b>_Character</b> is a summon, <b>0</b> if not<b>.</b><br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li><br> | ||
+ | </li> | ||
+ | <li>Summons can also be distinguished by the fact that hey have the <b>SUMMON</b> tag.</li> | ||
+ | <li>If you wish to know whether a summon is <i>player-controlled</i>, also check <b>CharacterIsPlayer</b>.<br> | ||
+ | </li></ul> | ||
+ | <p><u>See also</u></p> | ||
+ | <ul><li><b>CharacterIsPlayer</b></li></ul> | ||
+ | <h4>GetClosestAlivePlayer</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <span style="font-family:arial,sans-serif"><b>GetClosestAlivePlayer</b></span>(<i><b>[in]</b>(GUIDSTRING)</i><b>_Target</b>, <i><b>[out]</b>(CHARACTERGUID)</i><b>_Player</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | </div> | ||
+ | <div> | ||
+ | <p>Gets the closest player to <b>_Target</b> that is alive and stores it in <b>_Player</b>.</p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b><b><b><b>Success/Failure</b>: </b></b></b>Fails if no living player is found.<br> | ||
+ | </li> | ||
+ | <li><b>_Player</b>: The found player character.<br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li>Be careful if you check for extra conditions on the returned player: if any of those conditions fail, no other players will be considered.</li> | ||
+ | <li>If you want to start a dialog, use <b><span style="font-family:arial,sans-serif">ProcGetClosestAvailableCharacterTo</span></b></li></ul> | ||
+ | <p><u>See also</u></p> | ||
+ | <ul><li>Helper <b><span style="font-family:arial,sans-serif">ProcGetClosestAvailableCharacterTo</span></b></li></ul> | ||
+ | <div> | ||
+ | <div> | ||
+ | <h4>GetDistanceTo</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <span style="font-family:arial,sans-serif"><b>GetDistanceTo</b></span>(<i><b>[in]</b>(GUIDSTRING)</i><b>_Object1</b>, <i><b>[in]</b>(GUIDSTRING)</i><b>_Object2</b>, <i><b>[out]</b>(REAL)</i><b>_Dist</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | </div> | ||
+ | <p>Calculates the distance between <b>_Object1</b> and <b>_Object2</b>.</p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b>Success/Failure</b>: Fails if <span style="font-family:arial,sans-serif">if either <b>_Object1</b> or _<b>Object2</b> is in a container or in an inventory. Use <b>ItemIsInInventory</b> to check for this.</span></li> | ||
+ | <li><b>_Dist</b>: The distance in metres.</li></ul> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li><span style="font-family:arial,sans-serif">/</span><br> | ||
+ | </li></ul> | ||
+ | <p><u>See also<br> | ||
+ | </u></p> | ||
+ | <ul><li><b>ItemIsInInventory</b><br> | ||
+ | </li></ul> | ||
+ | <h4>GetInventoryOwner</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b>GetInventoryOwner</b>(<i><b>[in]</b>(ITEMGUID)</i><b>_Item</b>, <i><b>[out]</b>(GUIDSTRING)</i><b>_Owner</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | <p>Returns the inventory/container that holds <b>_Item</b> in <b>_Owner</b>.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b>Success/Failure</b>: Fails if <b>_Item</b> is not in anyone's inventory nor in a container.<br> | ||
+ | </li> | ||
+ | <li><b>_Owner</b>: The character or item in whose inventory the item currently resides.<br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes<br> | ||
+ | </u></p> | ||
+ | <ul><li>This call returns the outermost container. I.e., if a character has crate in their inventory, and the crate contains a pouch with the item, this call will return the character.<br> | ||
+ | </li></ul> | ||
+ | <p><u>See also<br> | ||
+ | </u></p> | ||
+ | <ul><li><b>ItemIsInInventory</b><br> | ||
+ | </li></ul> | ||
+ | <h4>GetRandomPositionInTrigger</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b>GetRandomPositionInTrigger</b>(<i><b>[in]</b>(TRIGGERGUID)</i><b>_Trigger</b>, <i><b>[out]</b>(REAL)</i><b>_X</b>, <i><b>[out]</b>(REAL)</i><b>_Y</b>, <i><b>[out]</b>(REAL)</i><b>_Z</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | <p>Returns a random position <i>that is valid on the AI-grid</i> inside <b>_Trigger</b>.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b>Success/Failure</b>: Default return value.<br> | ||
+ | </li> | ||
+ | <li><b>_Trigger</b>: A box trigger inside which the random position should be gotten.<br> | ||
+ | </li> | ||
+ | <li><b>_X</b>, <b>_Y</b>, <b>_Z</b>: the coordinates of the random position<br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes<br> | ||
+ | </u></p> | ||
+ | <ul><li>This routine will first get a random position in the trigger, and if this random position is not valid on the AI-grid, the coordinates will be snapped to a nearby valid position on the AI-grid.</li> | ||
+ | <li>This call does not work for polytriggers</li></ul> | ||
+ | <p><u>See also<br> | ||
+ | </u></p> | ||
+ | <ul><li>/<br> | ||
+ | </li></ul> | ||
+ | <h4>HasActiveStatus</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b>HasActiveStatus</b>(<i><b>[in]</b>(GUIDSTRING)</i><b>_Target</b>, <i><b>[in]</b>(STRING)</i><b>_Status</b>,<i><b> [out]</b>(INTEGER)</i><b>_Bool</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | <p>Returns whether <b>_Target</b> is currently under the influence of <b>_Status</b>.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b>Success/Failure</b>: Default return value.<br> | ||
+ | </li> | ||
+ | <li><b>_Bool</b>: 0 if <b>_Target</b> is currently not under the influence of <b>_Status</b>, 1 if it is.<br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes<br> | ||
+ | </u></p> | ||
+ | <ul><li>/</li></ul> | ||
+ | <p><u>See also<br> | ||
+ | </u></p> | ||
+ | <ul><li><b>HasAppliedStatus</b><br> | ||
+ | </li></ul> | ||
+ | <h4>HasAppliedStatus</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b>HasAppliedStatus</b>(<i><b>[in]</b>(GUIDSTRING)</i><b>_Target</b>, <i><b>[in]</b>(STRING)</i><b>_Status</b>,<i><b> [out]</b>(INTEGER)</i><b>_Bool</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | <p>Returns whether <b>_Status</b> has been applied to <b>_Target</b>. <b>_Target</b> may or may not yet actually be under its influence.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b><b>Success/Failure</b>: </b>Default return value.</li> | ||
+ | <li><b>_Bool</b>: 0 if <b>_Status</b> has not been applied to <b>_Target</b>, 1 if it has been.<br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li>In virtually all cases, use <b>HasActiveStatus</b> instead. The main purpose of this query is for crime reactions, and is only needed due to frame delays between code and Osiris.<br> | ||
+ | </li></ul> | ||
+ | <p><u>See also<br> | ||
+ | </u></p> | ||
+ | <ul><li><b>HasActiveStatus</b><br> | ||
+ | </li></ul> | ||
+ | <h4>IsSpeakerReserved<br> | ||
+ | </h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b>IsSpeakerReserved</b>(<i><b>[in]</b>(GUIDSTRING)</i><b>_Speaker</b>, <i><b>[out]</b>(INTEGER)</i><b>_success</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | <p>Returns whether <b>_Speaker</b> is already in a dialog.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b><b>Success/Failure</b>: </b>Default return value.</li> | ||
+ | <li><b>_success</b>: <b>0</b> if <b>_Speaker</b> is currently not in a dialog, <b>1</b> otherwise.<br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li>/</li></ul> | ||
+ | <p><u>See also<br> | ||
+ | </u></p> | ||
+ | <ul><li><b>DialogStartRequested</b></li> | ||
+ | <li><b>Proc_StartDialog<br> | ||
+ | </b></li></ul> | ||
+ | <h4>ItemIsInInventory</h4> | ||
+ | <p><u>Full definitions</u></p> | ||
+ | <ul><li>query <b><span style="font-family:arial,sans-serif">Item</span>IsInInventory</b>(<i><b>[in]</b>(ITEMGUID)</i><b>_Item</b>, <i><b>[out]</b>(INTEGER)</i><b>_Bool</b>)</li></ul> | ||
+ | <u>Description</u><br> | ||
+ | </div> | ||
+ | <p>Returns whether <b>_Item</b> is in an inventory. This includes both character and container inventories.<br> | ||
+ | </p> | ||
+ | <p><u>Return values</u></p> | ||
+ | <ul><li><b><b>Success/Failure</b>: </b>Default return value.</li> | ||
+ | <li><b>_Bool</b>: 0 if <b>_Item</b> is not in an inventory (as defined above), 1 if it is.<br> | ||
+ | </li></ul> | ||
+ | <p><u>Notes</u></p> | ||
+ | <ul><li>/</li></ul> | ||
+ | <p><u>See also<br> | ||
+ | </u></p> | ||
+ | <ul><li><b>GetInventoryOwner</b></li></ul> | ||
+ | <div> | ||
+ | <hr> | ||
+ | </div> |
Revision as of 11:08, 2 August 2017
Contents
- 1 Queries
- 1.1 CharacterGetEquippedItem
- 1.2 CharacterGetHenchmanPresetPrice
- 1.3 CharacterIsAlly
- 1.4 CharacterIsEnemy
- 1.5 CharacterIsNeutral
- 1.6 CharacterIsPartyFollower
- 1.7 CharacterIsPlayer
- 1.8 CharacterIsSummon
- 1.9 GetClosestAlivePlayer
- 1.10 GetDistanceTo
- 1.11 GetInventoryOwner
- 1.12 GetRandomPositionInTrigger
- 1.13 HasActiveStatus
- 1.14 HasAppliedStatus
- 1.15 IsSpeakerReserved
- 1.16 ItemIsInInventory
Queries
Queries request information about the state of the world from Osiris. They can be used in the part of a rule that checks conditions. Queries almost always succeed, except if you pass an initialised value as an [out] parameter and it does not match the value the query would returns. Below, this will be called the Default Return Value. If a query can also fail under other circumstances, this will be mentioned.
CharacterGetEquippedItem
Full definitions
- query CharacterGetEquippedItem([in](CHARACTERGUID)_Character, [in](STRING)_Slotname, [out](GUIDSTRING)_ItemGUID)
Description
Returns in _ItemGUID the item equipped by _Character in slot _Slotname, if any.
Return values
- <b><b>Success/Failure: </b></b>Fails if _Character does not exist, or if no item is equipped in _Slotname.
- _ItemGuid: The item equipped by _Character in _Slotname.
</ul>
- The valid values for _Slotname are: Helmet, Amulet, Breast, Belt, Gloves, Leggings, Boots, Weapon, Shield, Ring, Ring2.
- CharacterUnequipItem
- query CharacterGetHenchmanPresetPrice([in](STRING)_Preset, [in](CHARACTERGUID)_Character, [out](INTEGER)_Price)
- _Price: The price of the preset scaled to the level of _Character.
- Presets come from the folder ".../DOS2/Data/Mods/Shared/CharacterCreation/HenchmanPresets/"
- Presets can be customized using the following documentation: link
- CharacterApplyHenchmanPreset
- query CharacterIsAlly([in](CHARACTERGUID)_Character, <i><b>[in]</b>(CHARACTERGUID)</i><b>_OtherCharacter</b>,<i><b> [out]</b></i>(INTEGER)_Bool) </ul>
- <b><b>Success/Failure:</b></b> Default return value.
- _Bool: 1 if _Character and _OtherCharacter are allies, 0 if not.
</ul>
- Also works outside combat.
- If _Character or _OtherCharacter is dead or dying, the result solely depends on the characters' alignments (factions). If they are alive, it is also influenced by temporary hostile relations, e.g. induced by attacking a neutral character.
- CharacterIsNeutral
- CharacterIsEnemy
- See CharacterIsAlly for detailed information, except that this query returns whether the characters are enemies.
- CharacterIsAlly
- CharacterIsEnemy
- See CharacterIsAlly for detailed information, except that this query returns whether the characters are neutral.
- CharacterIsAlly
- CharacterIsEnemy
- query CharacterIsPartyFollower([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool)
- <b><b>Success/Failure: </b></b>Fails if _Character does not exist.
- _Bool: 1 if _Character is a party follower, 0 if not.
</ul>
- CharacterIsPlayer will also return true for party followers.
- CharacterIsPlayer
- CharacterFollowCharacter
- query CharacterIsPlayer([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool)
- <b><b>Success/Failure: </b></b>Fails if _Character does not exist.
- _Bool: 1 if _Character is player-controlled, 0 if not.
</ul>
- Apart from avatars and recruited companions, player-controlled characters also include summons and followers.
- CharacterIsPartyFollower
- CharacterIsSummon
- CharacterFollowCharacter
- query CharacterIsSummon([in](CHARACTERGUID)_Character, [out](INTEGER)_Bool)
- <b><b>Success/Failure: </b></b>Fails if _Character does not exist.
- _Bool: 1 if _Character is a summon, 0 if not.
</ul>
- Summons can also be distinguished by the fact that hey have the SUMMON tag.
- If you wish to know whether a summon is player-controlled, also check CharacterIsPlayer.
- CharacterIsPlayer
- query GetClosestAlivePlayer([in](GUIDSTRING)_Target, [out](CHARACTERGUID)_Player)
- <b><b><b>Success/Failure: </b></b></b>Fails if no living player is found.
- _Player: The found player character.
</ul>
- Be careful if you check for extra conditions on the returned player: if any of those conditions fail, no other players will be considered.
- If you want to start a dialog, use ProcGetClosestAvailableCharacterTo
- Helper ProcGetClosestAvailableCharacterTo
- query GetDistanceTo([in](GUIDSTRING)_Object1, [in](GUIDSTRING)_Object2, [out](REAL)_Dist)
- Success/Failure: Fails if if either _Object1 or _Object2 is in a container or in an inventory. Use ItemIsInInventory to check for this.
- _Dist: The distance in metres.
- /
- ItemIsInInventory
- query GetInventoryOwner([in](ITEMGUID)_Item, [out](GUIDSTRING)_Owner)
- Success/Failure: Fails if _Item is not in anyone's inventory nor in a container.
- _Owner: The character or item in whose inventory the item currently resides.
- This call returns the outermost container. I.e., if a character has crate in their inventory, and the crate contains a pouch with the item, this call will return the character.
- ItemIsInInventory
- query GetRandomPositionInTrigger([in](TRIGGERGUID)_Trigger, [out](REAL)_X, [out](REAL)_Y, [out](REAL)_Z)
- Success/Failure: Default return value.
- _Trigger: A box trigger inside which the random position should be gotten.
- _X, _Y, _Z: the coordinates of the random position
- This routine will first get a random position in the trigger, and if this random position is not valid on the AI-grid, the coordinates will be snapped to a nearby valid position on the AI-grid.
- This call does not work for polytriggers
- /
- query HasActiveStatus([in](GUIDSTRING)_Target, [in](STRING)_Status, [out](INTEGER)_Bool)
- Success/Failure: Default return value.
- _Bool: 0 if _Target is currently not under the influence of _Status, 1 if it is.
- /
- HasAppliedStatus
- query HasAppliedStatus([in](GUIDSTRING)_Target, [in](STRING)_Status, [out](INTEGER)_Bool)
- <b>Success/Failure: </b>Default return value.
- _Bool: 0 if _Status has not been applied to _Target, 1 if it has been.
</ul>
- In virtually all cases, use HasActiveStatus instead. The main purpose of this query is for crime reactions, and is only needed due to frame delays between code and Osiris.
- HasActiveStatus
- query IsSpeakerReserved([in](GUIDSTRING)_Speaker, [out](INTEGER)_success)
- <b>Success/Failure: </b>Default return value.
- _success: 0 if _Speaker is currently not in a dialog, 1 otherwise.
</ul>
- /
- DialogStartRequested
- Proc_StartDialog
- query ItemIsInInventory([in](ITEMGUID)_Item, [out](INTEGER)_Bool)
- <b>Success/Failure: </b>Default return value.
- _Bool: 0 if _Item is not in an inventory (as defined above), 1 if it is.
</ul>
- /
- GetInventoryOwner
Notes
See also
CharacterGetHenchmanPresetPrice
Full definitions
Description
Returns the price of the preset scaled to the level of _Character.
Return values
Notes
See also
CharacterIsAlly
Full definitions
Description
Returns whether _Character is an ally of _OtherCharacter.
Return values
Notes
See also
CharacterIsEnemy
Notes
See also
CharacterIsNeutral
Notes
See also
CharacterIsPartyFollower
Full definitions
Description
</div>
Returns whether _Character is a character that follows a player character around. An NPC can be instructed to do so through CharacterFollowCharacter.
Return values
Notes
See also
CharacterIsPlayer
Full definitions
Description
</div>
Returns whether _Character is player-controlled.
Return values
Notes
See also
CharacterIsSummon
Full definitions
Description
Returns whether _Character is a summon. Summon can be player-controlled or not.
Return values
Notes
See also
GetClosestAlivePlayer
Full definitions
Description
</div>
Gets the closest player to _Target that is alive and stores it in _Player.
Return values
Notes
See also
GetDistanceTo
Full definitions
Description
Calculates the distance between _Object1 and _Object2.
Return values
Notes
See also
GetInventoryOwner
Full definitions
Description
Returns the inventory/container that holds _Item in _Owner.
Return values
Notes
See also
GetRandomPositionInTrigger
Full definitions
Description
Returns a random position that is valid on the AI-grid inside _Trigger.
Return values
Notes
See also
HasActiveStatus
Full definitions
Description
Returns whether _Target is currently under the influence of _Status.
Return values
Notes
See also
HasAppliedStatus
Full definitions
Description
Returns whether _Status has been applied to _Target. _Target may or may not yet actually be under its influence.
Return values
Notes
See also
IsSpeakerReserved
Full definitions
Description
Returns whether _Speaker is already in a dialog.
Return values
Notes
See also
ItemIsInInventory
Full definitions
Description
Returns whether _Item is in an inventory. This includes both character and container inventories.
Return values
Notes
See also