Larian Banner
Previous Thread
Next Thread
Print Thread
Dialogue before a battle and other questions #636848
12/11/17 08:29 PM
12/11/17 08:29 PM
Joined: Nov 2017
Posts: 9
T
Tyreliande Offline OP
stranger
Tyreliande  Offline OP
stranger
T

Joined: Nov 2017
Posts: 9
Hi guys.

I'm trying to understand how to start a dialog (once it's created with the editor) when a player enters a trigger of a character.
And once the dialogue is launched, I also look for how a battle can start if a player does not choose the right answer, or that his perception is not good enough.
Finally, do you know the script for the search of the bag of the player after a crime or the loot of an object not allowed by a pnj (guardian for exemple)?

Thank you in advance for your answers !

Re: Dialogue before a battle and other questions [Re: Tyreliande] #636850
12/11/17 09:13 PM
12/11/17 09:13 PM
Joined: Oct 2017
Posts: 78
United Kingdom
Branvex Offline
journeyman
Branvex  Offline
journeyman

Joined: Oct 2017
Posts: 78
United Kingdom
To start a dialog when player enters a trigger you could use this in a story script:

Code:
IF
CharacterEnteredTrigger(_Player,_EventTriggerName)
THEN
SelectAndStartDialog(_Player,_NPCName);

Or
Code:
Proc_StartDialog(0,"DialogName",_NPCName,_Player);


To a start combat if a player choses wrong answer you could do (after you set the flag in a dialog node)

Code:
IF
DialogEnded("DialogName", _)
AND
DB_IsPlayer(_Player)
AND
ObjectGetFlag(_Player, "FlagName", 1)
THEN
SetFaction(_NPCNAME,"Evil NPC");

Re: Dialogue before a battle and other questions [Re: Branvex] #636855
12/11/17 10:26 PM
12/11/17 10:26 PM
Joined: Nov 2017
Posts: 9
T
Tyreliande Offline OP
stranger
Tyreliande  Offline OP
stranger
T

Joined: Nov 2017
Posts: 9
Thank you for this quick answer ! however it is obligatorily in a story this script not in an addon?

Last edited by Tyreliande; 12/11/17 10:26 PM.
Re: Dialogue before a battle and other questions [Re: Tyreliande] #636856
12/11/17 10:47 PM
12/11/17 10:47 PM
Joined: Oct 2017
Posts: 78
United Kingdom
Branvex Offline
journeyman
Branvex  Offline
journeyman

Joined: Oct 2017
Posts: 78
United Kingdom
Not sure what ya mean. For these scripts use the "story editor" in the editor. Can do this in an add-on project or in a standalone adventure project.

https://docs.larian.game/Story_editor

E.g. open the story editor, go to the "Start" category on the left, click "Add sub item", type a name for your goal, then you can put your scripts in the KB section (mostly). Then File > "Generate Definitions, Build and Reload".

Re: Dialogue before a battle and other questions [Re: Branvex] #636857
12/11/17 11:20 PM
12/11/17 11:20 PM
Joined: Nov 2017
Posts: 9
T
Tyreliande Offline OP
stranger
Tyreliande  Offline OP
stranger
T

Joined: Nov 2017
Posts: 9
ok, you answered my question correctly. I opened a standalone adventure project. Thanks again for all this very useful information!

Re: Dialogue before a battle and other questions [Re: Tyreliande] #636977
13/11/17 09:50 PM
13/11/17 09:50 PM
Joined: Nov 2017
Posts: 9
T
Tyreliande Offline OP
stranger
Tyreliande  Offline OP
stranger
T

Joined: Nov 2017
Posts: 9
One man i follow on youtube makes a video for this scipt.
I would like to share it : https://youtu.be/IbPmuXBm8Xg

Re: Dialogue before a battle and other questions [Re: Tyreliande] #637451
19/11/17 12:37 PM
19/11/17 12:37 PM
Joined: Nov 2017
Posts: 9
T
Tyreliande Offline OP
stranger
Tyreliande  Offline OP
stranger
T

Joined: Nov 2017
Posts: 9
I try to create a dialogue with a node persuasion. When I start the dialogue, the divinity engine sends this message: This is not valid! I do not see where it does not fit. Then when I try the dialogue, the persuation fails systematically whereas it is to settle in easy, why?


Click to reveal..

Re: Dialogue before a battle and other questions [Re: Tyreliande] #637459
19/11/17 02:40 PM
19/11/17 02:40 PM
Joined: Oct 2017
Posts: 45
NH, USA
R
RestingLichFace Offline
apprentice
RestingLichFace  Offline
apprentice
R

Joined: Oct 2017
Posts: 45
NH, USA
Sorry, my French isn't what it used to be. However, there is a line connecting the left-side of the Question Asking if he has food and water to the right side of the failed persuasion answer. This line is not valid, and is why it is complaining. If I interpret this correctly, you want to have the option of no show up with the yes option (the end node). To do that, simply move the end connected to the "Asking for water and food" FROM the node's left side TO the node's right side.

Automatic persuasion fail says either the dummy you are testing with has garbage for stats, or maybe you didn't finish setting up the persuasion check. The math behind persuasion checks is non-intuitive: Here's the math.

You have difficulty settings, Each test produces a number I'm going to call P, by P = a + b, where a is a number dependent on your difficulty settings, and b is an offset, determined by the level of the speaker. Whether you pass or not depends on your persuasion level and this P, I'll explain in a bit.

I forget the ranges for b, but levels 1-3 force b=1. A can be always, easy, normal, hard, or impossible, which correspond respectively to (-infinity), -1, 0, 1, (infinity).

Example, level 3 scrub calls you a name, and you want to intimidate with a STR persuasion check. He is a scrub, so lets call it an easy check. That makes P = -1 + 1 = 0.

You outright fail persuasion if your persuasion level is less than P, and outright succeed if your persuasion level is greater than P. The interesting part is when your persuasion level is equal to P, in which case you only succeed in the persuasion if the character's STAT associated with the persuasion is higher than the NPC you are comparing against.

Last edited by RestingLichFace; 19/11/17 03:03 PM.

Projects: Tomb of Horrors: Tomb of Horrors
Re: Dialogue before a battle and other questions [Re: Tyreliande] #637907
28/11/17 10:59 AM
28/11/17 10:59 AM
Joined: Nov 2017
Posts: 9
T
Tyreliande Offline OP
stranger
Tyreliande  Offline OP
stranger
T

Joined: Nov 2017
Posts: 9
Ok thx for this good explain ! I have another question now. How i can add a dialog for a race for example (dwarf, elfe, humain) or keyword (noble, soldier, etc) ? When i try, all of my player can see all choices, even if the player does not belong to the category. When i add a question i see option rules, but i don't know how set it. (sorry for my bad english again)

Re: Dialogue before a battle and other questions [Re: Tyreliande] #637909
28/11/17 11:16 AM
28/11/17 11:16 AM
Joined: Mar 2016
Posts: 500
Belgium
T
Tinkerer Offline

addict
Tinkerer  Offline

addict
T

Joined: Mar 2016
Posts: 500
Belgium
You have to add flag checks to the question nodes. Those flag checks should check for the appropriate TAGs (SOLDIER, ELF, ...). The "[DWARF]" etc at the start of a text line does not influence any checking, it's just there to give the player information about the fact that this node is specific for DWARFs.


Moderated by  Dom_Larian, Larian_Koala 

Powered by UBB.threads™ PHP Forum Software 7.6.2