Skip to content

Creating New Dialogs (and also BAMs and projectiles)

semiticgoddesssemiticgoddess Member Posts: 14,903
I've finally figured out how to use WeiDu to set up proper strings for spells, items, and critters, and also copy over files to the override folder. And I know how to use Near Infinity to create spells, items, critters, .2da files, and stores. But there are some things I don't get.

For one, I don't know how to create a completely new dialog from scratch and give it new strings. I've found tutorials for editing existing dialogs, and I can create custom dialogs with pre-existing strings, but I can't create a simple dialog to open a new store.

Less importantly, I'd like to learn how to create custom BAMs. I can copy BAMs from IWD2, and I can create my own image files, but I don't know how to get from BMP to BAM.

Finally, I have no idea how to create new projectiles. All I know is that getting them to work requires adding an IDS entry, which I don't know how to do. And I've no idea how to edit them.

Can anyone tell me how to do any of these things?
CrevsDaak

Comments

  •  TheArtisan TheArtisan Member Posts: 3,277
    edited January 2017
    For dialogue:

    To add new dialog to the game you need to write a .d file and compile it to the game using WeiDU with your .tp2 file. If you wanted to create a storekeeper dialog for instance, it'd look something like this, using xxSTORE as an example name for the dialog file.
    BEGIN xxSTORE IF ~~ THEN BEGIN xxSTORE1 SAY ~Hello! Would you like to take a look at my stock?~ ++ ~Yes, let's see what you have.~ DO ~StartStore("xxSTORE",LastTalkedToBy())~ EXIT ++ ~Not right now.~ EXIT END
    This only works if the only people talking are the PC and the storekeeper. If you wanted a party member to interject, you'd have to use CHAIN instead:
    BEGIN xxSTORE CHAIN IF ~True()~ THEN xxSTORE xxSTORE1 ~Hello! Would you like to take a look at my stock?~ == IMOEN2 IF ~InParty("IMOEN")~ THEN ~Wow! Look at all the things they have, <CHARNAME>!~ END ++ ~Yes, let's see what you have.~ DO ~StartStore("xxSTORE",LastTalkedToBy())~ EXIT ++ ~Not right now.~ EXIT
    Don't forget to connect the dialog to the character you want to say the above.

    Now, if you want to ADD to an existing character's dialogue, DO NOT use BEGIN at the start of the file, or else you'll override any dialog they already had. Instead, you want to use EXTEND_TOP or EXTEND_BOTTOM, which adds to their existing dialogue. Let's say you want to add an extra line of dialogue to Ribald to access your custom store:
    EXTEND_BOTTOM RIBALD 0 ++ ~I'm looking for something special. Got anything else for sale?~ EXTERN RIBALD xxRibald1 END CHAIN RIBALD xxRibald1 ~I may have some unusual items in the back. Would you like to have a look?~ END ++ ~Sure.~ EXTERN RIBALD xxRibald2 ++ ~Nah.~ EXTERN RIBALD xxRibald3 CHAIN RIBALD xxRibald2 ~Come with me then.~ DO ~StartStore("xxSTORE",LastTalkedToBy())~ EXIT CHAIN RIBALD xxRibald3 ~Alright.~ EXIT
    This would add an extra dialogue option to the bottom of Ribald's dialogue without overriding anything.

    Regardless of how you write the dialogue, you need to compile it to the game via your .tp2 file. The command looks like this:
    COMPILE ~xxMOD/dialogue/xxSTORE.d~
    My advice for further details - look at Kulyok's Branwen mod at Pocket Plane Group. Almost everything is fully annotated and explains how to deal with different ways of adding new dialogue.

    BAMS and projectiles aren't really my field of expertise. My attempts at successfully creating original BAMs are often hit or miss.
    semiticgoddess
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Artemius_I: I've tried it out and I got it to create the dialog, and I then applied the dialog to a creature, but the creature won't talk--which it used to do when using my previous dialog file.

    WeiDu refused to read the file until I renamed the would-be dialog from (AL)003 to DIAL003, because the parentheses caused a problem. That never happened to any of my other files before, with or without WeiDu, but it seems .d files can't handle extra parentheses.

    Anyway, the dialog I want to create looks like this, the one I created before this thread:

    but with different strings. The one above is fully functional.

    I managed to create a new dialog with new strings, but the tree doesn't show up properly, which I think is the problem here.

    What I don't know is how to fix that problem.

    This is what I added to the TP2 file:
    COMPILE ~AlchemistKit/dlg/DIAL003.d~

    This is what I added to the dlg folder mentioned above:
    DIAL003 (the .d file)

    This is what I added to the .d file mentioned above:
    BEGIN DIAL003

    IF ~~ THEN BEGIN DIAL003
    SAY ~Begin Alchemist Workshop?~
    ++ ~Begin.~ DO ~StartStore("(AL)003",LastTalkedToBy())~ EXIT
    ++ ~Exit.~ EXIT

    END



    All of that went through WeiDu just fine; it didn't get stuck anywhere along the way.
  • kjeronkjeron Member Posts: 2,367
    @semiticgod
    Replace: "IF ~~ THEN BEGIN DIAL003"
    With: "IF ~~ THEN BEGIN 0"
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @kjeron: No such luck. WeiDu ran it just fine, like it did the previous one, but the result was the same: a branchless tree in Near Infinity and a speechless critter when I tested the dialog in-game.
  • kjeronkjeron Member Posts: 2,367
    @semiticgod One more:
    Replace: IF ~~ THEN BEGIN DIAL003
    With: IF ~True()~ THEN BEGIN DIAL003
    semiticgoddess
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Artemius_I @kjeron: Success! The dialog now works fine. It starts properly, has custom strings, and leads to the correct store. My new kit mod is effectively complete! Thank you guys; I have no idea how long it would have taken me to figure this out on my own.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    If anyone has advice on creating BAMs or projectiles, that would also be extremely helpful. @Demivrgvs, do you have any advice for creating projectiles?
  • GrammarsaladGrammarsalad Member Posts: 2,582
    edited January 2017
    The EEs have really opened projectiles, but because you can do so much with them it is difficult to write a how to about editing them and creating new ones. Let me know what you want to do, and i can better help you there.

    As for adding projectiles and using them in spells, it's actually really easy.
    ADD_PROJECTILE      ~path/proname.PRO~
    COPY ~path/spell.spl~ ~override~
     LPF ALTER_SPELL_HEADER INT_VAR projectile = %proname% END
    semiticgoddess
  • argent77argent77 Member Posts: 3,431
    edited January 2017
    You need a BAM editor to create (or edit) BAMs. You can either use an independent editor such as BAM Workshop or BAM Workshop 2, or the built-in editors in DLTCEP or Near Infinity. Instruction how to use the BAM converter in NI can be found in the Near Infinity Wiki. I would suggest to open existing BAMs in the editor first and play around with them to get a feeling what has to be done.

    I agree with @Grammarsalad that projectiles are difficult to create. There are many fields to set which are badly documented (if at all). Your best bet is probably to use an existing projectile and modify it bit by bit until it fits your need.
    Post edited by argent77 on
    Grammarsaladsemiticgoddess
  • GrammarsaladGrammarsalad Member Posts: 2,582
    edited January 2017
    argent77 said:

    You need a BAM editor to create (or edit) BAMs. You can either use an independent editor such as BAM Workshop or BAM Workshop 2, or the built-in editors in DLTCEP or Near Infinity. Instruction how to use the BAM converter in NI can be found in the Near Infinity Wiki. I would suggest to open existing BAMs in the editor first and play around with them to get a feeling what has to be done.

    I agree with @Grammarsalad that projectiles are difficult to create. There are many fields to set which are badly documented (if at all). Your best bet is probably to use an existing projectile and modify it bit by bit until it fits your need.

    Yeah, what i generally do it start with a projectile that works kinda like what i want, and then make small changes.

    For example, I created a spell called "storm wall" that was basically a wall of electricity. When a creature passes through it, they take electricity damage. First, I started with the wall of moonlight spell. Then i changed the bam used by the projectile to the one used by the lightning bolt spell, but with the bam rotated 90 degrees. Then i made relevant changes to the spell ( e.g. electricity damage and protection from the spell for one round as otherwise the spell deals an insane amount of damage per second(?))

    Anyway, the thing looks awesome, like a wall crackling with electrical energy, though I made very few changes to the projectile itself.

    My primary suggestion is to experiment, experiment, experiment
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Grammarsalad: Success with the first new projectile! I now have a green orb that bounces off the walls, like the Force of Nature spell from Nox.
    DemivrgvsGrammarsaladCrevsDaak
  • DemivrgvsDemivrgvs Member Posts: 315
    It looks like I'm late to the party but yeah, it's pretty much what @Grammarsalad said: experiment, experiment, experiment ;)
    GrammarsaladArdanisCrevsDaak
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Grammarsalad @Demivrgvs: A related question. How do I add a projectile to a spell?

    I already know how to add one to an item. This is how my TP2 added a custom projectile to a custom item:

    ADD_PROJECTILE ~AlchemistKitBG2EE/pro/USALG06.PRO~
    COPY ~AlchemistKitBG2EE/itm/(AL)057.ITM~ ~override/(AL)057.ITM~
    WRITE_SHORT 0x09c ~%USALG06%~
    SAY NAME1 @36g
    SAY NAME2 @36g
    SAY DESC @36g

    This is what I tried to do to add a different custom projectile to a custom spell:

    ADD_PROJECTILE ~AlchemistKitBG2EE/pro/USALPG1.PRO~
    COPY ~AlchemistKitBG2EE/spl/(AL)064B.SPL~ ~override/(AL)064B.SPL~
    WRITE_SHORT 0x09c ~%USALPG1%~

    I also tried:

    ADD_PROJECTILE ~AlchemistKitBGEE/pro/USALPG1.PRO~
    COPY ~AlchemistKitBGEE/spl/(AL)064B.SPL~ ~override/(AL)064B.SPL~
    LPF SPELL_ALTER_HEADER INT_VAR projectile = USALPG1 END

    I keep getting the same error message from WeiDu, saying the projectile STAT value of 20 was a problem (it's the standard message when I've failed to copy projectiles properly).

    The projectile in question is just a clone of Cloudkill, with the number of hits reduced from 10 to 4 to reduce the duration.
  •  TheArtisan TheArtisan Member Posts: 3,277
    edited April 2017
    @semiticgod

    This method works for me:
    ADD_PROJECTILE ~modname/spells/projname.PRO~
    COPY ~modname/spells/spellname.spl~ ~override~
    READ_LONG 0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    SET "delta" = 0
    FOR (index = 0; index < abil_num; index = index + 1) BEGIN
    WRITE_SHORT (%abil_off% + (0x28 * %index%) + 0x26) ~%projname%~
    END
    semiticgoddess
  • GrammarsaladGrammarsalad Member Posts: 2,582
    edited April 2017

    The EEs have really opened projectiles, but because you can do so much with them it is difficult to write a how to about editing them and creating new ones. Let me know what you want to do, and i can better help you there.

    As for adding projectiles and using them in spells, it's actually really easy.

    ADD_PROJECTILE      ~AlchemistKitBGEE/pro/USALPG1.PRO~
    COPY ~AlchemistKitBGEE/spl/(AL)064B.SPL~ ~override~ 
     LPF ALTER_SPELL_HEADER INT_VAR projectile = %USALPG1% END
    @semiticgod

    This should work. You were just missing "quotes"

    Edit: I'm a bit concerned about those parentheses in "(AL)064B.SPL".

    Does that normally work?

    In any case, ALTER_SPELL_HEADER should work now
    semiticgoddess
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Artemius_I: It installed correctly! I haven't tested the projectile yet, but it's in the right place.

    @Grammarsalad: Parentheses will break WeiDu if you use them in dialogs and projectiles and probably some other places, but they'll be fine if you're simply copying over item and spell files.
  • GrammarsaladGrammarsalad Member Posts: 2,582

    @Artemius_I: It installed correctly! I haven't tested the projectile yet, but it's in the right place.

    @Grammarsalad: Parentheses will break WeiDu if you use them in dialogs and projectiles and probably some other places, but they'll be fine if you're simply copying over item and spell files.

    Good to know!

    Btw, if you want to see other spell related tricks, look here.

    Might be useful
Sign In or Register to comment.