Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
Is there a way to change the dialog file that your NPC speaks when a certain plot point has been reached? So far I've just been setting conditions for the dialog options but that's creating some really long and confusing dialog files. I tried:

IF
DialogStartRequested(CHARACTER_Dagny, _Player)
AND
GlobalSetEvent("End")
THEN
DialogStartTwoSpeakerDialog("DagnyEnd",CHARACTER_Dagny,_Player);

But it says that DIV call GlobalSetEvent cannot be used as a rule condition.

Joined: Jul 2014
R
addict
Offline
addict
R
Joined: Jul 2014
Events such as GlobalSetEvent can only be in the IF part of the code, not the AND. The solution would be to have that event store a variable in a Database, and then check for that in the AND.

Regarding your question, I would suggest looking at Zixzax in the Story code; I know he is one of the NPCs who changes his dialog file midgame. I believe it works by assigning a new dialog file from a Database to the character after the DialogEnded of their previous dialog fires.

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
I use

CharacterSetVarInteger(CHARACTER_Player1, "VariableName", X)

to track things like this. X is an integer value (1,2,3, etc)

you can set that variable when you want the dialog to change, and check it again in an AND section with to check the integer value and assign dialog accordingly using:

AND
CharacterGetVarInteger(CHARACTER_Player1, "VariableName", X)

Doesn't matter what character you store the variable on. I usually use a player, but it can be any global character on the map.


GlobalEventSet is an action that triggers an IF statement. It doesn't exist passively - meaning as soon as the event is set, the script reacts and fires. The script can't go back and check it later because it only exists when it's set and then it's gone as far as Osiris is concerned. (They can be passively checked in Dialog CONDITION statements though.)

The scripting language CAN passively check Character Variables, which is why I use them.

Last edited by Burgee; 31/12/14 01:32 AM.
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
This script is far more efficient than what I've been using, thanks! For anyone who wants the exact code, this is what I used:

[INIT]
CharacterSetVarInteger(CHARACTER_TestDelete, "TestDeleteDialog", 1);

[KB]
IF
DialogStartRequested(CHARACTER_TestDelete, _Player)
AND
CharacterGetVarInteger(CHARACTER_TestDelete, "TestDeleteDialog", 1)
THEN
DialogStartTwoSpeakerDialog("firstdialog",CHARACTER_TestDelete,_Player);

IF
DialogStartRequested(CHARACTER_TestDelete, _Player)
AND
CharacterGetVarInteger(CHARACTER_TestDelete, "TestDeleteDialog", 2)
THEN
DialogStartTwoSpeakerDialog("seconddialog",CHARACTER_TestDelete,_Player);

IF
GlobalEventSet("StubbornPlayer")
THEN
CharacterSetVarInteger(CHARACTER_TestDelete, "TestDeleteDialog", 2);


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