Osiris/Shared/DB HasItemTemplateScriptFlag: Difference between revisions

From Divinity Engine Wiki
Jump to navigation Jump to search
(Documented DB_HasItemTemplateScriptFlag (not yet available in released versions of the game))
 
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
===== Description =====
===== Description =====
This functionality can be used in dialogs to check whether a participant has a certain number of items of a particular template in their inventory:
This functionality can be used in dialogs to check whether a participant has a certain number of items of a particular template in their inventory:
* '''_TemplateVarIndex''': can onlu be 1 at this time. Determines which of the '''GEN_CheckHasItemTemplate_*''' dialog variables gets set, and hence which of the '''GEN_CheckHasItemTemplate''' script flags you can use to check whether a dialog participant (see '''_SpeakerIndex''') has items of the specified item template in their inventory.
* '''_TemplateVarIndex''': can be 1 - 5 at this time. Determines which which of the '''GEN_CheckHasItemTemplate/_2/_3/...''' script flags you can use to check whether a dialog participant (see '''_SpeakerIndex''') has items of the specified item template in their inventory.
* '''_Dialog''': the name of the dialog that this DB should influence.
* '''_Dialog''': the name of the dialog that this DB should influence.
* '''_ItemTemplate''': the item template to check for. Format: name_UUID (no '''ITEMGUID_''' prefix!)
* '''_ItemTemplate''': the item template to check for. Format: name_UUID (no '''ITEMGUID_''' prefix!)
* '''_SpeakerIndex''': This sets the speaker dialog variable used by '''GEN_CheckHasItemTemplate'''/'''..''' and hence must refer to a speaker index in the dialog. It determines which speaker will be checked for having a sufficient number of items of the specified template.
* '''_SpeakerIndex''': This sets the speaker dialog variable used by '''GEN_CheckHasItemTemplate'''/'''..''' and hence must refer to a speaker index in the dialog. It determines which speaker will be checked for having a sufficient number of items of the specified template.
* '''_Amount''': the number of items to check for. If unspecified, defaults to 1.
* '''_Amount''': the number of items to check for. If unspecified, defaults to 1.
===== Notes =====
===== Notes =====
* Unlike [[Osiris/Shared/DB_HasTemplateItem|DB_HasTemplateItem]], this works for both players and NPCs.
* Unlike [[Osiris/Shared/DB_HasTemplateItem|DB_HasTemplateItem]], this works for both players and NPCs.
Line 14: Line 15:
===== See Also =====
===== See Also =====
* [[Osiris/API/CharacterGetItemTemplateCount|CharacterGetItemTemplateCount]]
* [[Osiris/API/CharacterGetItemTemplateCount|CharacterGetItemTemplateCount]]
* [[Osiris/Shared/DB_HasTemplateItem|DB_HasTemplateItem]]
* [[Osiris/API/ItemAddedToCharacter|ItemAddedToCharacter]]
* [[Osiris/API/ItemAddedToCharacter|ItemAddedToCharacter]]
* [[Osiris/API/ItemTemplateIsInCharacterInventory|ItemTemplateIsInCharacterInventory]]
* [[Osiris/API/ItemTemplateIsInCharacterInventory|ItemTemplateIsInCharacterInventory]]
* [[Osiris/API/ItemTemplateIsInUserInventory|ItemTemplateIsInUserInventory]]
* [[Osiris/API/ItemTemplateIsInUserInventory|ItemTemplateIsInUserInventory]]
* [[Osiris/API/ItemIsInInventory|ItemIsInInventory]]
* [[Osiris/API/ItemIsInInventory|ItemIsInInventory]]
* Helper [[Osiris/Shared/DB_HasStoryEvent|DB_HasStoryEvent]]
* Helper [[Osiris/Shared/DB_GiveTemplateFromNpcToPlayerDialogEvent|DB_GiveTemplateFromNpcToPlayerDialogEvent]]
* Helper [[Osiris/Shared/DB_GiveTemplateFromNpcToPlayerDialogEvent|DB_GiveTemplateFromNpcToPlayerDialogEvent]]
* Helper [[Osiris/Shared/DB_GiveTemplateFromPlayerDialogEvent|DB_GiveTemplateFromPlayerDialogEvent]]
* Helper [[Osiris/Shared/DB_GiveTemplateFromPlayerDialogEvent|DB_GiveTemplateFromPlayerDialogEvent]]
* Helper [[Osiris/Shared/DB_HasStoryEvent|DB_HasStoryEvent]]
* Helper [[Osiris/Shared/DB_HasTemplateItem|DB_HasTemplateItem]]


[[Category:Osiris Shared Mod Helpers|HasItemTemplateScriptFlag]]
[[Category:Osiris Shared Mod Helpers|HasItemTemplateScriptFlag]]

Latest revision as of 12:03, 6 March 2018

Full Definition(s)
  • DB_HasItemTemplateScriptFlag((INTEGER)_TemplateVarIndex, (STRING)_Dialog, (STRING)_ItemTemplate, (INTEGER)_SpeakerIndex);
  • DB_HasItemTemplateScriptFlag((INTEGER)_TemplateVarIndex, (STRING)_Dialog, (STRING)_ItemTemplate, (INTEGER)_SpeakerIndex, (INTEGER)_Amount);
Description

This functionality can be used in dialogs to check whether a participant has a certain number of items of a particular template in their inventory:

  • _TemplateVarIndex: can be 1 - 5 at this time. Determines which which of the GEN_CheckHasItemTemplate/_2/_3/... script flags you can use to check whether a dialog participant (see _SpeakerIndex) has items of the specified item template in their inventory.
  • _Dialog: the name of the dialog that this DB should influence.
  • _ItemTemplate: the item template to check for. Format: name_UUID (no ITEMGUID_ prefix!)
  • _SpeakerIndex: This sets the speaker dialog variable used by GEN_CheckHasItemTemplate/.. and hence must refer to a speaker index in the dialog. It determines which speaker will be checked for having a sufficient number of items of the specified template.
  • _Amount: the number of items to check for. If unspecified, defaults to 1.
Notes
  • Unlike DB_HasTemplateItem, this works for both players and NPCs.
  • This functionality is not yet available in currently released versions of the game.
See Also