Fair Strides

DLG Editor

21 posts in this topic

File Name: DLG Editor

File Submitter: Fair Strides

File Submitted: 07 Nov 2015

File Category: Modding Tools

 



DLGEditor is a GUI based dialog viewer and editor for Star Wars: Knights of the
Old Republic and Star Wars: Knights of the Old Republic II: The Sith Lords.
The editor is divided into two panes. The upper pane contains the treeview
portrayal of the dialog with NPCs speaking in red (Entries) and PC replying in
blue (Replies). Upon highlighting the nodes of the tree, detail widgets appear
in the lower pane containing node-specific information which can be edited.

 



Click here to download this file

Share this post


Link to post
Share on other sites

I am wondering the same.

 

What is the difference? Unfortunately this version does not work with my Windows XP.

Share this post


Link to post
Share on other sites

Only difference is the auto-save feature, yes.

Sorry I never responded. I never realized there were posts here...

Share this post


Link to post
Share on other sites

Since we have a support topic for DLG Editor, I thought I could ask my questions here.

At this moment I am trying to figure how to make party members face each other when they interject in dialogues, rather than look at the protagonist. 

At first I thought it was a simple matter of having their name in the Speaker and Listener fields but it doesn't seem to be enough.

Any advice?

Thanks!

 

Share this post


Link to post
Share on other sites

You have to script it. There are examples in vanilla dialogues. I'll see if I can dig one up.

Edit: I believe this is the command you need:

// 143: Cause the caller to face vTarget
void SetFacingPoint(vector vTarget);

Perhaps something like:

ActionDoCommand(SetFacingPoint(GetPosition(GetObjectByTag("CREATURE_TAG"))));

Or a full example from TSL:

// a_turnpcatton
// This script turns the PC to face Atton.
void main()
{

    // Turn PC towards Atton.
    vector vAtton = GetPosition( OBJECT_SELF );
    AssignCommand( GetPCSpeaker(), SetFacingPoint( vAtton ) );
}

 

  • Like 2

Share this post


Link to post
Share on other sites
4 hours ago, Salk said:

At this moment I am trying to figure how to make party members face each other when they interject in dialogues, rather than look at the protagonist. 

At first I thought it was a simple matter of having their name in the Speaker and Listener fields but it doesn't seem to be enough. 

That should be enough in most situations, but it depends on which dialogue and it's even slightly different in each game. In general, though, the speaker will face the listener if that is set, and if not, will face the speaker of the previous node instead. In K1 at least, as far as I recall, a party member will attempt to turn to face the previous speaker in interjections, so you technically don''t need to set anything other than the speakers for each node. I recall one working instance of this on Korriban; if you have HK-47 and Jolee in the party, HK suggests doing something murdery and Jolee turns to him and retorts. But I find speaker/listener to be unreliable overall. It results in some dumb stuff like Vrook teleporting in one of the Council scenes, facing one person and then immediately facing another rather than turning like a person would.

So I would suggest scripting it as well. I would add, though, that you should also use SetLockOrientationInDialog to turn off the usual speaker/listener behavior before you start issuing SetFacingPoint commands. Something like

void main() {

object oPM1 = GetObjectByTag("whatever1", 0);

SetLockOrientationInDialog(oPM1, TRUE);
}

at the start of the scene, then

void main() {

object oPM2 = GetObjectByTag("whatever2", 0);

AssignCommand(OBJECT_SELF, SetFacingPoint(GetPosition(oPM2));

}

for the node you want them to turn on. And you'll want to SetLockOrientationInDialog back to false at the end of the scene.

You might also need to add a delay, but I forget if you do. I remember adding a delay of 0.1 seconds when scripting animations in K1, but I don't remember if it applies here too.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you, DarthParametric and JC!

Very precious advice, as usual. I was very confused because, like you, I do remember situations where the Speaker/Listener combo works as it should.

Having to resort to scripts for the many party interjections seems a bit too much even for me though. Since there is no quick reliable solution using the DLG Editor and the problem is so wide spread, I will tolerate this minor issues.

Thanks for providing a possible solution, I may be tempted, one day, to go for it even if it means checking hundreds of files.

Cheers!

Share this post


Link to post
Share on other sites

How this whole Speaker/Listener business works isn't simple, I once did extensive testing and wrote a guide about it. A lot depends on the exact syntax of how the conversation was started in the script. This was for TSL only though, K1 may be and probably is a little different.

If you give me a specific example I may be able to tell you why it's not working.

  • Like 1

Share this post


Link to post
Share on other sites

Hello, bead-V.

Thanks for your answer.

I read your very interesting guide and indeed it may be possible that most of your finds also apply to KotOR. About giving an example, I was just talking of the file dan14_mdroid.dlg found in the danm14_ab module. There is a banter there that should happen between Cart and Bastila (E47 and E48) but they don't seem to be facing each other at all there and I was trying to figure out how things work.

Cheers!

Share this post


Link to post
Share on other sites

Ah, I see what you mean. In any case, this doesn't seem like an issue with the Speaker/Listener functionality, but an issue with the party members trying to reorient on the PC even during dialog. If you turn on solo mode for example, the issue goes away. I also removed the function that makes the PC move, but that made no difference. I'm gonna do some more tests, because it seems like sometimes it does work.

However, you could probably use the solo mode trick to fix the issue. You'd make two scripts:

a_disablesolo:

void main(){
	SetLocalBoolean(GetArea(OBJECT_SELF), 10, GetSoloMode());
	SetSoloMode(TRUE);
}

a_reenablesolo:

void main(){
	SetSoloMode(GetLocalBoolean(GetArea(OBJECT_SELF), 10));
}

Then you'd just need to add these two scripts to all the dialogs where it happens. And just a disclaimer, I'm not 100% sure this would work, but it could.

EDIT:

Well, I checked the script that fires the banter dialog, and all it seems to do is ClearAllActions() on all the party members. I checked that with the Matale cutscene and it worked. So you can package this up as a script like this:

a_clearactparty:

void main(){
    int n = 0;
    for(n = 0; n < 3; n++){
        AssignCommand(GetPartyMemberByIndex(n), ClearAllActions());
    }
}

And just make sure it fires somewhere in the dialog before the lines with the party members.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks a lot, bead-v!

I am wondering if a simple ClearAllActions() could be forced at higher level so that it wouldn't need to be used for each separate dialogue.

Share this post


Link to post
Share on other sites

You could do it for the main onDialog script, but that wouldn't eliminate all the cases. Whenever the dialog is fired from any other script, you'd need to either edit the dialog to add the ClearAllActions() script as suggested above or edit the script that fires it.

EDIT:
But here's another thing that seems to work. I modified the party member heartbeat script to do this:

if(GetIsConversationActive() && GetCurrentAction() == ACTION_FOLLOWLEADER) ClearAllActions();


The heartbeat script only fires every 4s or so, so it may not always work immediately, but it is a pretty general solution.

k_hen_heartbt01-DialogOrientationFix.zip

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks again!

I think that solution may be even more desirable.

I will test this and see if it is reliable enough. ;)

By the way, I noticed that something similar was already present in the original k_hen_heartbt01.nss but that it was commented out together with many other lines:

    else if(GetSoloMode() && GetCurrentAction(OBJECT_SELF) == ACTION_FOLLOWLEADER)
    {
        ClearAllActions();
    }

I hope it was not cut because it'd cause problems.

Cheers!

Share this post


Link to post
Share on other sites
44 minutes ago, Salk said:

By the way, I noticed that something similar was already present in the original k_hen_heartbt01.nss but that it was commented out together with many other lines:

So that's a bit different, because it clears the action if the party member happens to be in Solo mode, not in dialog as in our case. But the reason why that part of the code's commented out is because that's probably the old code for the script before it was all moved to k_ai_master and run from there.

Fingers crossed!

  • Like 1

Share this post


Link to post
Share on other sites

bead-v,

would you know if it is possible to make a small addition to your code so that we may also make the party members face the current speaker? 

I attempted this:

 

  if(GetIsConversationActive()) {
    SetFacingPoint(GetPosition(GetLastSpeaker()));
        if (GetCurrentAction() == ACTION_FOLLOWLEADER) {
            ClearAllActions();
        }
    }    

but I failed because GetLastSpeaker() doesn't really do what I hoped  (the party members face PLAYER, rather than the current speaker). I would need to address what you in your guide define SPEAKER.

Share this post


Link to post
Share on other sites

Yeah, GetLastSpeaker() works in a weird way that's not obvious to me from a few tests. In any case, I don't think it can be used in this way. And even if it could, there's no way of checking whether this an actual speaking node or just a cutscene node, so you'd likely get partymembers turning weird directions during cutscenes. You'd also want a few more checks in there, like Solo mode, distance, etc... But I'd say with the functions we have at our disposal, this isn't doable at a decent level.

  • Like 1

Share this post


Link to post
Share on other sites

bead-v,

while testing this method I noticed how sometimes the party members seem to turn away but I could not make it happen consistently so I was tentatively trying to remedy this by adding the following after ClearAllActions():

        SetFacingPoint(GetPosition(GetPCSpeaker()));

so that the new k_hen_heartbt01.nss is:

void resetorientation();

void resetorientation() {
        SetFacingPoint(GetPosition(GetPCSpeaker()));
        ExecuteScript("k_ai_master", OBJECT_SELF, KOTOR_HENCH_EVENT_ON_HEARTBEAT);
}

void main()
{
    if(GetIsConversationActive() && GetCurrentAction() == ACTION_FOLLOWLEADER) {
        ClearAllActions();
        resetorientation();
    }
    else {
        ExecuteScript("k_ai_master", OBJECT_SELF, KOTOR_HENCH_EVENT_ON_HEARTBEAT);
    }
}

Do you see a glaring problem with this? 

I wouldn't want to break anything although I doubt there could be any critical negative consequences.

Cheers!

Share this post


Link to post
Share on other sites

Naah, you can't break anything. It should be fine, I think. It only fires once per dialog... but the best way to find out is to test it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now