Difference between revisions of "Osiris/Shared/DB GiveNewItemFromTemplateEvent"

From Divinity Engine Wiki
Jump to: navigation, search
(Created page with "===== Full Definition(s) ===== * '''DB_DB_GiveNewItemFromTemplateEvent'''(''(STRING)'''''_template''',''(STRING)'''''_event''') ===== Description ===== Defining this database...")
 
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
===== Full Definition(s) =====
 
===== Full Definition(s) =====
* '''DB_DB_GiveNewItemFromTemplateEvent'''(''(STRING)'''''_template''',''(STRING)'''''_event''')
+
* '''DB_GiveNewItemFromTemplateEvent'''(''(STRING)'''''_template''', ''(STRING)'''''_event''')
 
===== Description =====
 
===== Description =====
 
Defining this database means that if the character/object flag '''_event''' gets set on a character, a new instance of the root template '''_template''' will be created and transferred to said character's inventory.
 
Defining this database means that if the character/object flag '''_event''' gets set on a character, a new instance of the root template '''_template''' will be created and transferred to said character's inventory.
 
===== Notes =====
 
===== Notes =====
 
* This is useful to create an item out of thin air and and transfer it to a character (either a player or an NPC) in a dialog.
 
* This is useful to create an item out of thin air and and transfer it to a character (either a player or an NPC) in a dialog.
 +
* The flag gets cleared immediately after giving the item, so do not check it later to determine whether you already gave the item. Conversely, you can set it again on the same character later on to give a new instance of this item.
 
* Only use this with root templates of items.
 
* Only use this with root templates of items.
 
* Right-click on a root template and select ''Copy TypeGUID_Name_GUID to clipboard'' to obtain the value for the '''_template''' parameter.
 
* Right-click on a root template and select ''Copy TypeGUID_Name_GUID to clipboard'' to obtain the value for the '''_template''' parameter.
Line 10: Line 11:
 
* [[Osiris/API/ItemToInventory|ItemToInventory]]
 
* [[Osiris/API/ItemToInventory|ItemToInventory]]
 
* Helper [[Osiris/Shared/DB_GiveItemToEvent|DB_GiveItemToEvent]]
 
* Helper [[Osiris/Shared/DB_GiveItemToEvent|DB_GiveItemToEvent]]
 +
* Helper [[Osiris/Shared/DB_GiveTemplateFromNpcToPlayerDialogEvent|DB_GiveTemplateFromNpcToPlayerDialogEvent]]
 +
* Helper [[Osiris/Shared/DB_GiveTemplateFromPlayerDialogEvent|DB_GiveTemplateFromPlayerDialogEvent]]
 
* Helper [[Osiris/Shared/DB_HasStoryEvent|DB_HasStoryEvent]]
 
* Helper [[Osiris/Shared/DB_HasStoryEvent|DB_HasStoryEvent]]
 
   
 
   
[[Category:Osiris Shared Mod Helpers]]
+
[[Category:Osiris Shared Mod Helpers|GiveNewItemFromTemplateEvent]]

Latest revision as of 15:50, 19 December 2017

Full Definition(s)
  • DB_GiveNewItemFromTemplateEvent((STRING)_template, (STRING)_event)
Description

Defining this database means that if the character/object flag _event gets set on a character, a new instance of the root template _template will be created and transferred to said character's inventory.

Notes
  • This is useful to create an item out of thin air and and transfer it to a character (either a player or an NPC) in a dialog.
  • The flag gets cleared immediately after giving the item, so do not check it later to determine whether you already gave the item. Conversely, you can set it again on the same character later on to give a new instance of this item.
  • Only use this with root templates of items.
  • Right-click on a root template and select Copy TypeGUID_Name_GUID to clipboard to obtain the value for the _template parameter.
See Also