Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Sep 2017
M
monzua Offline OP
member
OP Offline
member
M
Joined: Sep 2017
HI need some help: To unlock some dialogs if _player hast item in inventory i use ItemTemplateIsInInventory - works great but only for some items ... some dont work dont know why. So i looked at the wiki and found Osiris/API/ItemIsInInventory - so maybe ItemTemplate doesnt support all items and i should rather use Osiris/API/ItemIsInInventory

Can someone tlel me how to use Osiris/API/ItemIsInInventory with an example and do you guys have same issues with ItemtemplateIsInInventory?

thx

Joined: Sep 2017
M
monzua Offline OP
member
OP Offline
member
M
Joined: Sep 2017
ps: looking into shared scripts to find out didnt really help me at all sadly ...

Joined: Sep 2017
M
monzua Offline OP
member
OP Offline
member
M
Joined: Sep 2017
Got it working for people who are interested:

IF
ObjectFlagSet("CheckItemRune",(CHARACTERGUID)_Player,_Instance)
AND
ItemIsInInventory((ITEMGUID)ITEMGUID_LOOT_AtaraxianArtifacts_A_000_2a36a9b7-c5a4-47ea-955d-bcbfa659efa5,1)
THEN
ObjectSetFlag(_Player, "HasItemRune");

Joined: Sep 2017
M
monzua Offline OP
member
OP Offline
member
M
Joined: Sep 2017
one thing i dont get how to solve, it seems whenever i spawn an item / or let the user create an item based an crafting rhis part of the item:

ITEMGUID_LOOT_AtaraxianArtifacts_A_000_2a36a9b7-c5a4-47ea-955d-bcbfa659efa5

the last part changes ... how can i check for a specific item if the id changes again and again?

Joined: Dec 2016
Location: United States
member
Offline
member
Joined: Dec 2016
Location: United States
If it's not a specific instance of an object that you want to check for, you can check inventory for an item template instead:


GetItemForItemTemplateInInventory

or

GetItemForItemTemplateInPartyInventory

you would provide these queries with the "name and guid" string of the root template. For example, if I wanted to check for LOOT_AtaraxianArtifacts_A, I would use this guid string:

"LOOT_AtaraxianArtifacts_A_629fdb6d-a88e-4a62-83a7-c4f4b3655d81"

Last edited by Ameranth; 04/10/17 10:43 PM.
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
I have documented the shared mod helper that you can use for this, along with a few related helpers you can use to create & give new items in dialogs based on root templates rather than item instances: DB_GiveTemplateFromPlayerDialogEvent and DB_GiveTemplateFromNpcToPlayerDialogEvent.

I have also updated and hopefully clarified the documentation about frame delays, which is quite important in this context.

Joined: Sep 2017
M
monzua Offline OP
member
OP Offline
member
M
Joined: Sep 2017
Nice - yeah i noticed that frame delay thing did steal 1 hour of my life lol

aside that great that you updated wiki! thx

Last edited by monzua; 08/10/17 09:25 PM.

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5