Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#558516 12/11/14 03:37 PM
Joined: Nov 2014
Location: NC, USA
jayhawk Offline OP
stranger
OP Offline
stranger
Joined: Nov 2014
Location: NC, USA
So I am trying to get into modding this game, working on one thing at a time. Normally to solve a problem, I can Google how someone else did it, but I can't seem to find a tutorial which helps me learn how to effectively make the Keyword Editor (in conjunction with the Story Editor) make a global character talk. They did it somehow in the official tutorial, but I've spent a long time trying to replicate his steps exactly and it doesn't work out. I saw roguelike use DefaultDialog for a non-global character and that method works fine, but it'd be nice if I could make the characters global, so I can edit those characters more in Osirus.

I don't really know what to do, so I was wondering if someone could make a video tutorial explaining how to make global characters interact with the player in dialogue.

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
Hey Jayhawk. Global characters require a few extra steps for dialogue to work if you're making a standalone mod. They worked in the tutorial videos because those videos are based on modding the main game.

I just posted a walkthrough on this, I'll put it here as well. Let me know if you have any other questions.

Quote

First - you need a global character, and you need to change that global character's name on the "Characters" tab (Red stick figure at the top of the screen). Change it to something you can reference easily. For this example we'll use "QuestGuy".

Once the Character is global, you'll notice his dialogue no longer activates in game. This is fixable.

Open the story editor, and if you haven't already, you need to make a goal called "_Start". In "_Start" put the following:

Init:
CHARACTER_Player1.isPlayer();
CHARACTER_Player2.isPlayer();

KB:
IF
GameEventSet("GAMEEVENT_GameStarted")
THEN
InitStory();
GoalCompleted;

//This assumes you've changed your character names to Player1 and Player2 on the character tab.

Exit: Can remain blank

For a quest NPC, you'll want to open the story editor and create a new item (actually it's called a "goal"). Create your new Goal and name it whatever (I name mine after the Quest NPCs for easy reference. I named mine "QuestGuy". Drag it into the _Start goal so it's a child goal to _Start. _Start should be expandable now to see your child goal.

In your new Child goal "QuestGuy" or whatever you named it, you can leave INIT blank for the time being.

In KB Put the following:

IF
DialogStartRequested(CHARACTER_QuestGuy, _Player)
THEN
DialogStartTwoSpeakerDialog("QuestGuyDialogue",CHARACTER_QuestGuy,_Player);

"QuestGuyDialogue" is the name of whatever you saved your dialogue as in the keyword editor.

All of that will get Dialogue working for you.



The Larian tutorials for dialogue in the Scripting Quests videos will all work now, apply what you need from those videos to your own dialogue.

Edit: you can do all your quest scripting for this character in this same "goal". I just put it below the dialogue call in the KB section.

Last edited by Burgee; 12/11/14 04:40 PM.
Joined: Nov 2014
Location: NC, USA
jayhawk Offline OP
stranger
OP Offline
stranger
Joined: Nov 2014
Location: NC, USA
Thanks! This looks very helpful. I will try this out tonight. If this works it will have cured a bad headache.

Joined: Nov 2014
Location: NC, USA
jayhawk Offline OP
stranger
OP Offline
stranger
Joined: Nov 2014
Location: NC, USA
It is not working for me. Here is everything relevant here from my Story Editor.

Okay, I have

CHARACTER_QFM_Player1.isPlayer();
//CHARACTER_Player2.isPlayer();

in my init for _Start, and

IF
GameEventSet("GAMEEVENT_GameStarted")
THEN
InitStory();
GoalCompleted;

in my KB. I have a child goal called "DithersBlithers". In that init I have

DB_Dialogs(CHARACTER_QFM_Dithers_Blithers, "QFM_Dithers_Blithers");

and in the KB, I have

IF
DialogStartRequested(CHARACTER_QFM_Dithers_Blithers, _Player)
THEN
DialogStartTwoSpeakerDialog("QFM_DithersBlithersDialogue",CHARACTER_QFM_Dithers_Blithers,_Player);

The character named Dithers Blithers is checked Global. Am I screwing up something in the code, or is it something else?

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
If the code compiles correctly then your code isn't the issue. Regardless, I'll break it down in a more step-by-step way for you.

1.)Place a character on your map, check Global on the sidebar. Don't worry about anything else - not even the dialogue box.

2.)Open the CHARACTERS tool (red stick figure on the toolbar) Find your new Global character (you can click on his model for easy location on the list). He'll be named something weird. Click on his name and change it to something you can reference. For this example: "QuestGuy". This step is hugely important.

3.)Place both of your PLAYER CHARACTERS if you haven't. Check Global and IsPlayer in the sidebar. Open the CHARACTERS tool again, and for the sake of this example, name them Player1 and Player2.

---NOTE that naming the characters via "DisplayName" on the sidebar is not the same as changing them in the CHARACTERS tool. ---

4.) Write and save any basic dialogue for test purposes. Name it "QuestDialogue" for the sake of this example.

5.)Open the story editor. Press "New" and name the new goal "_Start". In "_Start" put the following:

INIT:
CHARACTER_Player1.isPlayer();
CHARACTER_Player2.isPlayer();

KB:
IF
GameEventSet("GAMEEVENT_GameStarted")
THEN
InitStory();
GoalCompleted;


---Note that CHARACTER_Player1 and CHARACTER_Player2 reference the names you named the player in the CHARACTER tool.---

5.) Create another new Goal in the story editor. Name this one "QuestGuy" (name doesn't matter). In that one:

INIT:

KB:
IF
DialogStartRequested(CHARACTER_QuestGuy, _Player)
THEN
DialogStartTwoSpeakerDialog("QuestDialogue",CHARACTER_QuestGuy,_Player);


Click Generate Definitions & Build - Should be error free.

And you should be good to go.


Joined: Oct 2014
Location: Hogwarts
member
Offline
member
Joined: Oct 2014
Location: Hogwarts
I tried to implement this code but the "chat" interaction button does not appear over the NPC's head. The only potential issue I noticed in your code is that there is a space between QuestGuy, and _Player. I think it should be:

KB:
IF
DialogStartRequested(CHARACTER_QuestGuy,_Player)
THEN
DialogStartTwoSpeakerDialog("QuestDialogue",CHARACTER_QuestGuy,_Player);

But when I tried that, it still didn't work. The code does build successfully so I'm not certain what's causing the issue.

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
Your NPC needs to have something in his "Default Dialogue" field on his sidebar so the game knows to allow you to request dialogue. Usually I just type "Default" into it, the script will assign the correct dialogue when it's time.

This is most likely your issue, because I've run into it myself and I was stumped for a while - lol

Make sure that's done as well. Most NPCs have something there without making a change, but some don't. If the code compiles you're well on your way.

As for the code, I copy pasted it directly from my own mod that does work, so the issue wasn't with the code. In fact, switching the orders around will cause issues (it will compile, but you'll have bugs - maybe not for a space, but any other way will cause issues!)

Last edited by Burgee; 14/11/14 04:34 PM.
Joined: Oct 2014
Location: Hogwarts
member
Offline
member
Joined: Oct 2014
Location: Hogwarts
Okay, I finally got the global dialog to work. I deleted all my other scripts and wrote the code myself rather than copying it. Not sure what caused the issue, but thanks! Good video. Keep em coming laugh

Request: Could you make a tutorial on argumentative dialog between 2 Player Characters that offers the reason, charm, and intimidate options in response to an NPC dialog?

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
The character arguing minigame is beyond me for now. I haven't really tried to put it into effect yet so I haven't dug around to learn how... sorry.

Joined: Nov 2014
Location: NC, USA
jayhawk Offline OP
stranger
OP Offline
stranger
Joined: Nov 2014
Location: NC, USA
The default dialogue field might be the reason my global characters aren't talking. Thanks for adding that detail.

EDIT: It works! That was the small thing that made everything fall to pieces. Thanks for your help!

Last edited by jayhawk; 16/11/14 12:40 AM. Reason: update

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