Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Oct 2017
P
apprentice
OP Offline
apprentice
P
Joined: Oct 2017
Hello, I try to make my player give an item to an NPC and it works, but I want to make sure that if the player try to give the item when it does not, a specific dialog is triggered.

Quote
IF
ObjectFlagSet("formagedonner", _speaker, _)
AND
ItemTagIsInCharacterInventory(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406,"CHEESE", 0)
AND
QueryOnlyOnce("fromagementir")
THEN
Proc_StartDialog(1, "fromagementir", CHARACTERGUID_Animals_Rat_A_001_61bac09c-515f-412e-a030-71ee44293fba, _Speaker);


a ItemTagIsInCharacterInventory 0 is good to say there is no item in the inventory one agrees? Or I have to put ANDNOT

thank you in advance

Joined: Sep 2017
M
member
Offline
member
M
Joined: Sep 2017
I am not sure if i got your question correctly but: Yes an 0 indicated no item with that tag in the inventory. Instead of working with Tag "Cheese" you could check for itemtemplate in inventory - Only then your sentance "...is no item in the inventory" is correct because right now you check for tag not item smile

Also make sure at the time when the flag is set you are not already in a conversation since i am not sure what happens if you trigger convo within convo - but honestly if its only about enabling a dialog option you can just set a flag with osiris and enable a check at a question dialog.

Hope that makes sence smile

Last edited by monzua; 08/10/17 01:19 PM.
Joined: Oct 2017
P
apprentice
OP Offline
apprentice
P
Joined: Oct 2017
Thank you for your answer, it helps me.

It is possible by a script to skip dialog for go to a specific flag and continue the dialogu there?

Joined: Oct 2017
P
apprentice
OP Offline
apprentice
P
Joined: Oct 2017
is it possible to do with a flag from the script editor?

I mix flagset, setflag, globalflag, etc ...

Joined: Sep 2017
M
member
Offline
member
M
Joined: Sep 2017
Well you could do something like this: (example no real osiris code as i am on my tablet :))

dialog:
Answer: NPC: Hey you have cheese?
Question: Player: NO (Flags to Set "CheckInventoryForCheese" 1 )

Answer: NPC: Wow you greedy fuck!! I know you have cheese i can smell it (Flags to Check "IsGreedy" 1)
Answer: NPC: Okok i think you are right.... (Flag to Check "IsGreedy" 0)

story:

IF
FlagSet(_Player, "CheckInventoryForCheese")
AND
ItemtemplateIsInInventor(_Player, ITEM_blabla,1)
THEN
SetFlag(_Player,"IsGreedy")


You might look at this for ref: http://larian.com/forums/ubbthreads.php?ubb=showflat&Number=626172#Post626172

does that help?

Last edited by monzua; 08/10/17 09:55 PM.
Joined: Oct 2017
P
apprentice
OP Offline
apprentice
P
Joined: Oct 2017
Hello, tanks for your help
If i try:

Quote
IF
ObjectFlagSet ("nonjenaipas", _Player)
AND
GetItemForItemTemplateInInventory (_player, "CON_Food_Cheese_Piece_A", 1)
THEN
ObjectSetFlag(_Player, "sentfromage");


i have error: intended to be function call an for objectflagset paramater 2 not valid.

If i try

Quote
IF
ObjectFlagSet ("nonjenaipas", CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406, _)
AND
GetItemForItemTemplateInInventory (CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406, "CON_Food_Cheese_Piece_A", ITEMGUID_CON_Food_Cheese_Piece_A_000_4c61af81-86cb-47f1-9508-77b6054019ee)
THEN
ObjectSetFlag(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406, "sentfromage");


it's build, I can speak, but the answer will always be the same, it does not smell the item. As if checking if I have item in inventory does not work

Joined: Oct 2017
P
apprentice
OP Offline
apprentice
P
Joined: Oct 2017
So with what follows it works a little can

Quote
IF
ObjectFlagSet ("nonjenaipas", CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406, _)
AND
ItemTemplateIsInCharacterInventory (CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406, "ITEMGUID_CON_Food_Cheese_Piece_A_405d1af0-5fa9-4e3e-9d7e-0a79f6b5f564", 1)
THEN
ObjectSetFlag(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406, "sentfromage");


The only problem is that the first time I lie and I say I have no cheese, it says "ok, you do not have it, come back if you have it". But if I come back to him, he feels the cheese in the inventory and tells me that I have some.

How can he feel it directly?

Joined: Oct 2017
P
apprentice
OP Offline
apprentice
P
Joined: Oct 2017
I have foud ! i share the line if someone has the same worries a day

Quote
DB_GiveTemplateFromPlayerDialogEvent ("CON_Food_Cheese_Piece_A_405d1af0-5fa9-4e3e-9d7e-0a79f6b5f564", "nonjenaipas" , "sentfromage");

Joined: Sep 2017
M
member
Offline
member
M
Joined: Sep 2017
FYI - the reason the other part didnt work was because you need to put attention to frame delay. smile (Look up larian wiki scripting) its related to how you structure your dialog. smile But anyway it works now with the other approach so thats good.


Moderated by  Larian_KVN 

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