NPC Dialogue trees (.dlg files)

Discussion in 'Negative Energy Plane' started by Dhoom, Sep 25, 2003.

Remove all ads!
  1. Dhoom

    Dhoom BIG Troll Berserker

    Joined:
    Sep 25, 2003
    Messages:
    139
    Likes Received:
    2
    I've got this pretty well mapped out. It's really basic, and refers to protos.tab a lot.

    It makes calls to modules in the utilities.py code, but they're easy to understand.

    The best way to figure it out, is to look at the dialogue files of someone you've talked to before.

    Also, I posted a few posts on the dlg files in the Portrait thread, on Atari Forums.

    THere's seven {} fields...

    1st: The line number
    2nd: If PC is male, display this text (NPC & PC use this field -- PC to display 'response' choices)
    3rd: If PC is female, display this text (NPC use only)
    4th: Some kind of PC INT check... one response is "smart wording", and the other makes your PC sound like a moron. Smart = Positive number, Moron = Neg. Usually 8 and the line below is -7...
    5th: State Variable calls... Item Check, Quest State Check
    6th: PC Response 'If choosen, jump to this line number' (PC use only)
    7th: Function Call... give PC item, set quest state, etc.

    It looks like both 5 and 7 can do any Function... give item, take item, check item, increase/decrease faction, set quest states/toggle states, etc.

    It's REALLY simple.

    I changed BlackJay's "You found my ring! here's xxxx" to give me 10,000 platinum. :D
     
    Last edited: Sep 25, 2003
  2. Dhoom

    Dhoom BIG Troll Berserker

    Joined:
    Sep 25, 2003
    Messages:
    139
    Likes Received:
    2
    To show how easy it is, I did this in less than 5 minutes:

    Changed a line in BlackJays text to different text ("Give me EVERYTHING!"), and the reward is all three choices instead of just one (Arrows, Cloak, and Boots)

    [​IMG]

    [​IMG]
     
  3. Vaevictis666

    Vaevictis666 Established Member

    Joined:
    Sep 25, 2003
    Messages:
    114
    Likes Received:
    0
    And now it hits me (after seeing that before) - the first one is Int 8 or more, the other is 7 or less...
     
  4. Vaevictis666

    Vaevictis666 Established Member

    Joined:
    Sep 25, 2003
    Messages:
    114
    Likes Received:
    0
    Ok your next mission is to figure out what options are necessary to get a specific dialog option as part of a skill check - ie how do you make a dialog option only show up if PC passes a Bluff check?

    Then gimme a list of possible values for #5 and 7 and I should be able to doctor up a dialog tree editor :) Or so could any of our other programmer lurkers...
     
  5. Sol Invictus

    Sol Invictus Beholder Watcher Veteran

    Joined:
    Aug 25, 2003
    Messages:
    325
    Likes Received:
    0
    It looks like we can add better dialogue into the game after all. We should make Black Jay sound like a paranoid freak.
     
  6. Vaevictis666

    Vaevictis666 Established Member

    Joined:
    Sep 25, 2003
    Messages:
    114
    Likes Received:
    0
    The better part is not that we can redo the dialogue, but that we now have the ability (with a bit more knowledge as to func calls etc) to do CUSTOM QUESTS - and that's what it's all about.

    At the very least we'll be able to do up some custom evil quests if need be.
     
  7. Dhoom

    Dhoom BIG Troll Berserker

    Joined:
    Sep 25, 2003
    Messages:
    139
    Likes Received:
    2
    To answer your first question:

    pc.skill_level_get(npc,skill_bluff) >= 2

    Like I said... basic.

    The above code will make line will show up if the difference between the NPC and speaking PC's bluff skill is greater or equal to 2.

    :D

    I'll post a list blow this... it's rather large.
     
  8. Dhoom

    Dhoom BIG Troll Berserker

    Joined:
    Sep 25, 2003
    Messages:
    139
    Likes Received:
    2
    Exactly.

    We can add items to NPCs/Monsters... we can totally redo or edit NPC dialogue... we can create new items in protos.tab...

    There's a ton of stuff we can do, already... and we've just scratched the surface.
    Here's the contents of the test.dlg file...

    {10}{Hello, man.}{Hello, woman.}{}{}{}{}
    {11}{Me really dumb!}{}{-7}{}{20}{}
    {12}{This is a line for non-dumb people.}{}{7}{}{30}{}
    {13}{[exit]}{}{1}{}{0}{}

    {20}{You are a stupid man.}{You are a stupid lady.}{}{}{}{}
    {21}{Yup. Me talk more?}{}{-7}{}{40}{}
    {22}{Yup. Me go.}{}{-7}{}{0}{}

    {30}{So what's up, man?}{So what's up, woman?}{}{}{}{}
    {31}{I have a question.}{}{7}{}{40}{}
    {32}{Nothing. Bye.}{}{7}{}{0}{}

    {40}{Please ask you question, sir.}{Please ask you question, maam.}{}{}{}{}
    {41}{Isn't Tim the greatest?}{}{1}{}{50}{}
    {42}{Never mind.}{}{1}{}{0}{}

    {50}{Yes, he is, and you are wise to see that.}{Yes, he is, and you are wise to see that.}{}{}{}{}
    {51}{May I ask again?}{}{1}{}{40}{}
    {52}{I know, and I am humbled. Good bye.}{}{1}{}{0}{}


    I'm going to get cracking on the all dlg functions.
     
  9. Dhoom

    Dhoom BIG Troll Berserker

    Joined:
    Sep 25, 2003
    Messages:
    139
    Likes Received:
    2
    Oh shit!! I just figured out how to turn on the Brothel! :D

    Change someones dlg file to include:

    game.worldmap_travel_by_dialog(3)

    3 = map number

    If we can figure out what map # the Brothel is, we can add something like this to the guy standing in front of that building nulb:

    {10}{Hey buddy, wanna get your freak on?}{Hey, lady, wanna get your freak on?}{}{}{}{}
    {11}{I'm dumb, but I wanna freak!}{}{-7}{game.worldmap_travel_by_dialog(3)}{0}{}
    {12}{I'm smart, but I wanna freak!.}{}{7}{game.worldmap_travel_by_dialog(3)}{0}{}
    {13}{[exit]}{}{1}{}{0}{}

    That would teleport them into the Brothel, possibly. :D

    Someone should test this out <g>
     
  10. Sol Invictus

    Sol Invictus Beholder Watcher Veteran

    Joined:
    Aug 25, 2003
    Messages:
    325
    Likes Received:
    0
    Suhweet!

    Get a 'lame' prototype version of that dialogue and upload it somewhere. I gotta check it out ;)

    Later on, we should make this really professional-like and add multiple dialogues to the guy, give him some personality and so forth.
     
  11. Sol Invictus

    Sol Invictus Beholder Watcher Veteran

    Joined:
    Aug 25, 2003
    Messages:
    325
    Likes Received:
    0
    I just tested that. It just sends you to Nulb. :(
     
  12. Vaevictis666

    Vaevictis666 Established Member

    Joined:
    Sep 25, 2003
    Messages:
    114
    Likes Received:
    0
    map for first floor is 5057 - give this dialog to the guy lurking out in front of where we think it is, and have him point out a "side entrance" lol
     
  13. Sol Invictus

    Sol Invictus Beholder Watcher Veteran

    Joined:
    Aug 25, 2003
    Messages:
    325
    Likes Received:
    0
    I don't think that works. I just got a CTD after linking 5057 in the Widow in Hommlet's dialogue. I haven't tried with the apprentice yet or anyone in Nulb, so maybe that might work.

    Anyway, we might have to link it via one of the portals rather than the dialogues.
     
  14. Vaevictis666

    Vaevictis666 Established Member

    Joined:
    Sep 25, 2003
    Messages:
    114
    Likes Received:
    0
    try it again with 5056 and see if it sends you to the smithy in nulb.
     
  15. Sol Invictus

    Sol Invictus Beholder Watcher Veteran

    Joined:
    Aug 25, 2003
    Messages:
    325
    Likes Received:
    0
    Nope. That does not work. Thank god it doesn't.
     
Our Host!