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.
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/GlobalGetFlagThere are also User and Party flags, but they're less relevant here.
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
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:
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);