Difference between revisions of "Osiris/Shared/DB HasStoryEvent"
From Divinity Engine Wiki
m (Mention magic pockets) |
m (link DB_HasTemplateItem) |
||
Line 6: | Line 6: | ||
* This is useful to check in a dialog whether a character actually still has an item before you give it to a player. Note that you should perform the check and give action on the same dialog node, as otherwise the item could still be pick-pocketed in between the check and the transfer | * This is useful to check in a dialog whether a character actually still has an item before you give it to a player. Note that you should perform the check and give action on the same dialog node, as otherwise the item could still be pick-pocketed in between the check and the transfer | ||
* Usually, you will want to check this flag at the party level instead of character level, so that players don't have to transfer the item to a particular character's inventory before they can hand it over to an NPC. [[Osiris/Shared/DB_GiveItemToEvent|DB_GiveItemToEvent]] will automatically get it from the right party member (called "magic pockets"). | * Usually, you will want to check this flag at the party level instead of character level, so that players don't have to transfer the item to a particular character's inventory before they can hand it over to an NPC. [[Osiris/Shared/DB_GiveItemToEvent|DB_GiveItemToEvent]] will automatically get it from the right party member (called "magic pockets"). | ||
+ | * This call only works for item instances. Use [[Osiris/Shared/DB_HasTemplateItem|DB_HasTemplateItem]] in case you want to check whether a character has any item instance of a particular root template. | ||
===== See Also ===== | ===== See Also ===== | ||
* [[Osiris/API/ItemIsInInventory|ItemIsInInventory]] | * [[Osiris/API/ItemIsInInventory|ItemIsInInventory]] | ||
* Helper [[Osiris/Shared/DB_GiveItemToEvent|DB_GiveItemToEvent]] | * Helper [[Osiris/Shared/DB_GiveItemToEvent|DB_GiveItemToEvent]] | ||
+ | * Helper [[Osiris/Shared/DB_HasTemplateItem|DB_HasTemplateItem]] | ||
[[Category:Osiris Shared Mod Helpers]] | [[Category:Osiris Shared Mod Helpers]] |
Revision as of 15:47, 8 October 2017
Full Definition(s)
- DB_HasStoryEvent((ITEMGUID)_Item,(STRING)_HasItemEvent)
Description
Defining this database will result in the character/object flag _HasItemEvent to be set on a character while _Item is in its inventory.
Notes
- This is useful to check in a dialog whether a character actually still has an item before you give it to a player. Note that you should perform the check and give action on the same dialog node, as otherwise the item could still be pick-pocketed in between the check and the transfer
- Usually, you will want to check this flag at the party level instead of character level, so that players don't have to transfer the item to a particular character's inventory before they can hand it over to an NPC. DB_GiveItemToEvent will automatically get it from the right party member (called "magic pockets").
- This call only works for item instances. Use DB_HasTemplateItem in case you want to check whether a character has any item instance of a particular root template.
See Also
- ItemIsInInventory
- Helper DB_GiveItemToEvent
- Helper DB_HasTemplateItem