Skip to content

NPC Creation Questions

IsandirIsandir Member Posts: 458
I've been attempting to create my first NPC as part of DSotSC, and have run into difficulties not because of a lack of information, but rather too much. Numerous tutorials are available, many with conflicting information or varying focuses. (It seems too many of those I find were written between 2003-2009, prior to BG:EE.) I also attempted to follow the excellent guide that @Alkalurops created, while adapting the wording to the more often used +/++, but still have several questions that I'm hoping some of you can address:

1: Does all dialogue--joining/leaving/banter/interjections--go into the same .d file? If so, how is it separated in respect to blocks? (I.e., does it require a new BEGIN each time, etc.?)

2: Does BG:EE use the same item/location/alignment/etc. references as the original BG or as BGII?

3: How would a sample variable look if you wanted to have a conversation point appear based on alignment?

4: In response to Alkalurops' guide, @LiamEsler stated that only one DO command is needed in the dialogue file. Does that mean you simply create a separate section in the file that lists all possible actions based on variables, while referencing the relevant dialogue triggers? Can someone provide an example of what that would look like?

5: Is there a resource available that simply lists each of the commands that can be inserted into dialogue to cause an action? (I.e., leaving the party, turning hostile, etc.) Which of these go into the script file rather than the dialogue file?

6: Is anyone aware of a guide that combines all the different elements of dialogue--joining/leaving/banter/interjections--rather than focusing only on one?

7: As a separate subject, is there a simple guide to item creation similar to the ones I've found for NPC creation?

Thank you all!

Comments

  • AlkaluropsAlkalurops Member Posts: 269
    edited December 2013
    1: Does all dialogue--joining/leaving/banter/interjections--go into the same .d file? If so, how is it separated in respect to blocks? (I.e., does it require a new BEGIN each time, etc.?)
    It doesn't have to. First let me note that there's a difference between a .D and a .DLG file.
    A .DLG file is a "binary code" file and can be read by Baldur's Gate. Roughly speaking, each NPC has at least 1 .DLG file containing the dialog spoken by that creature.
    Because writing binary files is pretty hard for us simple humans, Weimer created a .D file format, which contains "source code" that cannot be understood by Baldur's Gate, but can be compiled into binary .DLG files.
    Each time you start a BEGIN MyDialog you tell WeiDU to start a new MyDialog.DLG file. If your .D file contains 3 of such blocks, you're basically creating 3 new .DLG files in the override folder.
    However, WeiDU is only capable of compiling ONE .D file at a time. Thus, when a conversation transitions from 1 dialog to another (for example: Minsc talks to Jaheira, thus MINSC.DLG => JAHEIRA.DLG), WeiDU needs to know about the existance of *both* dialogs in order to make the connection. Since WeiDU only compiles 1 .D file at a time, this file must contain all interconnected dialogs.
    2: Does BG:EE use the same item/location/alignment/etc. references as the original BG or as BGII?
    Most references are identical to the original BG1. There may be some small adjustments because BG:EE uses the enhanced edition of the TOB engine, but I think the references themselves are the same.
    3: How would a sample variable look if you wanted to have a conversation point appear based on alignment?
    Not entirely sure what you're asking, but:
    IF ~True()~ THEN BEGIN ~SomeState~
        SAY ~something~
    
        IF ~Alignment(Myself, NEUTRAL_EVIL)~ THEN
            REPLY ~Aha! I'm evil!~
            EXIT
    END
    4: In response to Alkalurops' guide, @LiamEsler stated that only one DO command is needed in the dialogue file. Does that mean you simply create a separate section in the file that lists all possible actions based on variables, while referencing the relevant dialogue triggers? Can someone provide an example of what that would look like?
    Sigh... I really should rewrite my tutorial... I wrote it half a year ago when I was in a similar situation like you (new to BG modding, bits and pieces spread over multiple tutorials). LiamEsler is right though, so follow his advice.
    IF ~~ THEN
        REPLY ~some reply~
        DO ~Enemy()
            Panic()
            CallLightning(Myself)~
        EXIT
    Basically: one DO statement with one string. It doesn't have to be multiline, for example: ~Enemy() Panic()~ is valid as well.
    5: Is there a resource available that simply lists each of the commands that can be inserted into dialogue to cause an action? (I.e., leaving the party, turning hostile, etc.) Which of these go into the script file rather than the dialogue file?
    Yes, I think my tutorial lists a few in Appendix I. Anyway:
    Conditions: http://gemrb.org/iesdp/scripting/triggers/bg2triggers.htm
    Actions: http://gemrb.org/iesdp/scripting/actions/bg2actions.htm
    Identifiers: http://gemrb.org/iesdp/files/ids/bg2/index.htm
    Identifiers are used in both triggers and actions. For example, the Alignment trigger takes a value from align.ids
    If you're doing some item/spell modding: http://gemrb.org/iesdp/opcodes/bg2tob.htm

    You can use those in your dialogs and scripts.
    6: Is anyone aware of a guide that combines all the different elements of dialogue--joining/leaving/banter/interjections--rather than focusing only on one?
    Not that I know. I intended to do so in my tutorial, but time... is not on my side.
  • TvrtkoSvrdlarTvrtkoSvrdlar Member Posts: 353
    @Alkalurops, any chance we could get a link to your guide?
  • AlkaluropsAlkalurops Member Posts: 269
    https://docs.google.com/document/d/1ZNVRttHGVV8GOQ-CYWyTMHh-3MErQ1T_KusJkCtYtk0/edit?usp=sharing
    But I intend to rewrite this one day... So take it with a grain of salt.
  • TwaniTwani Member Posts: 640
    I'm in the position of trying to create a mod for BGTutu/BGT/BGEE, and the one thing I've been using as a tutorial is the Branwen NPC mod, downloaded in the One Day NPCs section of Pocket Plane Group. Each new part of dialog, as well as each new line of script, is commented on, so you can open the files in Wordpad/Notepad+++/OpenOffice or even just regular Notepad if you don't mind long lines and create a mod using Branwen as a guide. It's been a major help for stupid, but simple things like when to use chains and when to use say, how to set variables, how to make the character spawn in the world... things everyone else in the world probably has figured out, but I was confused about until reading it.
  • IsandirIsandir Member Posts: 458
    Thank you, @Alkalurops & @Twani. That cleared up several of my questions, and I'll certainly check out the Branwen NPC mod as well. With only two days of modding under my belt, this has made me feel like I'm already making much more headway than in the past. I'll likely have additional questions later, and if I do, I'll post them here.
Sign In or Register to comment.