Jump to content


Easy Item Dialogs


29 replies to this topic

#1 Smoketest

  • Members
  • 467 posts
  • Gender:Male
  • Location:Oregon State

Posted 01 September 2004 - 06:28 PM

I'm reposting this here from memory for anyone who still doesn't know how to do this.

The first thing to do is to make your item conversible. This is done by setting bit 11 in the item flags at offset 0x18. This tells the Infinity engine that a dialog can be attached to this item, so check for it. How does it check? The secret is in ITEMDIAL.2DA (short for Item Dialog).

Here are the default contents of that file:
2DA V1.0
*
               LABEL   FILE
SW2H14        5689    SW2H14

Item SW2H14 (.ITM) is the talking two-handed sword, Lilarcor. The label is displayed on a button that you will see if you right-click the item for options. In this case 5689 is the string reference for "Converse." Next is file SW2H14.DLG. Extensions are implied, so don't bother putting file.ITM in the first column or file.DLG in the third column. The game will know what to look for.

To add your own talking item, simply add a new row to ITEMDIAL.2DA. For example, if you want your mage to have a talking quarterstaff, you might do something like this:
2DA V1.0
*
               LABEL   FILE
SW2H14        5689    SW2H14
STAF01        5689    MYSTAFF

Remember to set the conversible flag in STAF01.ITM, and you'll need to write a dialog for the item, which in this example is named MYSTAFF.DLG. Just talk to the staff the same way you'd talk to Lilarcor. You could also give the item a personal name or something, as was done for Lilarcor. The sky's the limit, and any item can be made conversible.

While the method used to initiate a conversation is limited to the game interface for items with special abilities, item dialogs can be written like most other dialogs. You'd have to come up with an alternative method of initiating a dialog if you wanted the item to be able to initiate a dialog with you, rather than waiting on you to do it. If I remember correctly, one method involves creating an invisible character (with the item's name) near the party and having it start a dialog using the item's dialog file.

If you want your item to talk outside of a conversation, like Lilarcor does in and out of combat, you'll need to add scripting to BALDUR.BCS. Look at Lilarcor's example in BALDUR.BCS (and BALDUR25.BCS) to get an idea of how that's done.

#2 Bardess

    C is the deadliest weapon of all

  • Members
  • 143 posts
  • Gender:Female
  • Location:Serbia, Europe

Posted 06 February 2007 - 10:47 AM

I'm sure lost in all of this... I don't really need a talking item, but, can someone please tell me how to make an invisible character?

???

#3 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 07 February 2007 - 12:21 AM

Have him drink a potion of invisibility? Or force an invisibility spell on him? I'm not a scripting ninja but there might be some examples in this.
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#4 berelinde

    The Typo Queen

  • Gibberlings
  • 8591 posts
  • Location:New Jersey, USA

Posted 07 February 2007 - 02:57 AM

Sorry, Miloch, but that won't work. He'll go visible or partially visible as soon as he initiates dialogue.
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#5 Bardess

    C is the deadliest weapon of all

  • Members
  • 143 posts
  • Gender:Female
  • Location:Serbia, Europe

Posted 07 February 2007 - 05:40 AM

I can make something up... A fog, or a cat, or a corpse... As long as the players wouldn't mind, though. Hmm, I really can...

Edited by Bardess, 07 February 2007 - 05:41 AM.


#6 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 07 February 2007 - 05:58 AM

Yeah. Well I guess you could have an alternate CRE with a blank BAM animation or something...
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#7 berelinde

    The Typo Queen

  • Gibberlings
  • 8591 posts
  • Location:New Jersey, USA

Posted 07 February 2007 - 06:16 AM

You're still going to get the blue circle.

If it were me, and it isn't, I would go with something you're going to find in the Bridge district anyway, like a cat or a rat animation, assign it its own DV and dialogue file, and nothing else needs to be done.
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#8 Kulyok

  • Members
  • 5206 posts
  • Gender:Female
  • Location:Moscow, Russia

Posted 07 February 2007 - 06:25 AM

Actually, you could just add dialogue into Player1 dialogue file:

CHARNAME: (You hear a disembodied voice.) Hey, where is my beer?

#9 Bardess

    C is the deadliest weapon of all

  • Members
  • 143 posts
  • Gender:Female
  • Location:Serbia, Europe

Posted 07 February 2007 - 06:41 AM

Hey!

I made my own cat (!) and it talks to me very nicely ??? , I can make it like this:
"#something he says# (You hear something in the shadows, turn around and find out that it's a cat!)" The cat does *not* destroy itself after the conversation, and Fiars appears a couple of steps away from it. Huh?

#10 berelinde

    The Typo Queen

  • Gibberlings
  • 8591 posts
  • Location:New Jersey, USA

Posted 07 February 2007 - 06:54 AM

If you want the cat to destroy itself afterward, you could just give it a DestroySelf() command at the end of its dialouge.

Or, you could just let it wander off, once Fiars is there and joins.
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#11 Bardess

    C is the deadliest weapon of all

  • Members
  • 143 posts
  • Gender:Female
  • Location:Serbia, Europe

Posted 07 February 2007 - 07:12 AM

Ok, how do I order the cat to wander off?

I can't believe what we are discussing! ???

#12 berelinde

    The Typo Queen

  • Gibberlings
  • 8591 posts
  • Location:New Jersey, USA

Posted 07 February 2007 - 07:32 AM

That would depend on how you're handling the talking cat. If you are using a separate cre, as in not Fiars, and it has ist's own dialogue file, that isn't Fiars, and you want Fiars to join, you would do the following. I'm using Z_Cat as the cat's dialogue file.

This will start with the state where Fiars acutally joins. I'm making all this up, so it's going to be different for your mod, naturally.

IF ~~ THEN BEGIN FiarsChoice
SAY ~So, do you want me to join or not?~
++ ~I suppose.~ DO ~ActionOverride("Z_Fiars",JoinParty()) SetGlobal("Z_FiarsJoined","GLOBAL",1)~ EXIT
++ ~Not a chance.~ + Loser
END

IF ~~ THEN BEGIN Loser
SAY ~Your loss. Later.~
IF ~~ THEN DO ~EscapeArea() ActionOverride("Z_Fiars",EscapeArea())~ EXIT
END
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#13 drake127

  • Members
  • 123 posts
  • Gender:Male
  • Location:Prague, Czech Republic

Posted 07 February 2007 - 07:35 AM

Look how Deck of Many Things makes its invisible creature (deck.itm, deck.cre). It may help you or just copy and edit.

#14 Bardess

    C is the deadliest weapon of all

  • Members
  • 143 posts
  • Gender:Female
  • Location:Serbia, Europe

Posted 07 February 2007 - 07:53 AM

I'm lazy, I may look later.

So, the EscapeArea command will make a creature get lost, but using its legs?

#15 berelinde

    The Typo Queen

  • Gibberlings
  • 8591 posts
  • Location:New Jersey, USA

Posted 07 February 2007 - 07:56 AM

If you check the IESDP, you'll find that EscapeArea() will make the creature leave forever via the nearest exit, using its legs. If you want it to just wink out of existence, use DestroySelf().
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users