Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Jul 2019
stranger
OP Offline
stranger
Joined: Jul 2019
Hey guys!

So, I just started making mods today and I had some questions in regards to the Dialog Editor I was wondering if anyone could help me.

1. How would I go about killing someone after a node was finished? Like, maybe the node says "You stab them" and they die.

2. After the initial greeting how do I change how a NPC will greet the player after already speaking to them? And to add on to this question is there a way to have multiple instances an NPC could greet a player depending on what chain of nodes they went through? For example, maybe they piss off the NPC so the next time the player tries to talk the NPC will just spit on the ground.

3. I have it so when a NPC dies a demon will spawn out from that NPC's body. How would I force the Players to initiate Dialog with the Demon before a fight breaks out?


And that's about it. Any help on any of these questions would be greatly appreciated! :D

Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
Originally Posted by Limpinator
Hey guys!

So, I just started making mods today and I had some questions in regards to the Dialog Editor I was wondering if anyone could help me.

First of all, make sure you have read https://docs.larian.game/Dialog_editor . I contains extensive documentation about the dialog editor.

Quote

1. How would I go about killing someone after a node was finished? Like, maybe the node says "You stab them" and they die.

Killing a character that is in a dialog will end the dialog. This means you have two options:
1) first remove them from the dialog and then kill them, or
2) wait till the dialog is over and then kill them

Both the removing from dialog and killing has to be done from script. You cannot do this directly in the dialog editor. The way to communicate between the dialog editor and script is by setting flags and then checking these flags in script:
* https://docs.larian.game/Osiris/API/ObjectFlagSet/https://docs.larian.game/Osiris/API/ObjectGetFlag
* https://docs.larian.game/Osiris/API/GlobalFlagSet/https://docs.larian.game/Osiris/API/GlobalGetFlag

There are also User and Party flags, but they're less relevant here.

Quote

2. After the initial greeting how do I change how a NPC will greet the player after already speaking to them? And to add on to this question is there a way to have multiple instances an NPC could greet a player depending on what chain of nodes they went through? For example, maybe they piss off the NPC so the next time the player tries to talk the NPC will just spit on the ground.

This is again achieved by setting a (character) flag on the player speaker in the dialog once they reach a particular node, and then checking the flag on greeting nodes. Make sure to also read https://docs.larian.game/Dialog_editor#Node_Selection

Quote

3. I have it so when a NPC dies a demon will spawn out from that NPC's body. How would I force the Players to initiate Dialog with the Demon before a fight breaks out?

1) Create an alignment for the demon, make it neutral towards the "Hero" alignment (which is what players have), and assign it to the demon (via the sidebar properties)
2) give the demon the StartEventOnSight behaviour script (via the sidebar properties) and edit the property that specifies that a character event should be sent when someone is spotted (don't know the name by heart, but it's something like ObjectSpottedEvent)
3) in story, have an event handler like this:
Code
IF
ObjectEvent(_Player, "EventDefinedInScriptProperties")
AND
NOT QRY_StartDialog(1, "Demon_Dialog", S_MY_Demon_GUID, _Player)
THEN
// If we failed to start the dialog for whatever reason, start spotting for players again
ObjectSetEvent(S_MY_Demon_GUID, "RestartSpotting");

IF
DialogEnded("Demon_Dialog", _ID)
THEN
// 0 means "hostile"
// This will set the relation of the alignment of S_MY_Demon "hostile" to the players.
// That is why it is so important to give him a custom alignment, because if he is
// e.g. "Neutral NPC", then from now on ever "Neutral NPC" will be permanently
// hostile to the players
ProcSetRelationToPlayers(S_MY_Demon_GUID, 0);

Joined: Jul 2019
stranger
OP Offline
stranger
Joined: Jul 2019
Hey man thanks for the insane reply!

I just have one major question..Where exactly do I write all this code? For example, that remove from dialogue one which reads..

"call DialogRemoveActorFromDialog([in](INTEGER)_InstanceID, [in](CHARACTERGUID)_Player, [out](INTEGER)_Success)"


Where would I place this line of code? On the node itself? And is there a guide somewhere that states what to type in place of whats in the () and []?

Sorry if these are really noobish questions.

Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
That is Osiris script, which you have to write in the story editor. The wiki has Osiris reference documentation, but you first may want to have a look at a couple of community tutorial videos like this one, and also at the community Osiris tutorial page.

Joined: Jul 2019
stranger
OP Offline
stranger
Joined: Jul 2019
Oh man thanks a ton! These videos is EXACTLY what I was looking for! laugh

Man I have no idea how to thank you but you are amazing.

Oh, I guess I do have one little tiny question and I don't wanna make a whole new thread for it if you don't mind..


Is there a way to "black out" a certain section of the map?

For example, lets say I want to show an entrance to a cave or area and to give the illusion I just have a solid black plain and place it in the entrance. That way it's not just going into the terrain itself.

**EDIT**

NVM I got it!

All I did find a solid black brush and just painted over it.

Last edited by Limpinator; 19/07/19 09:47 PM.

Moderated by  Larian_KVN 

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