Jump to content
Smoketest

Easy Item Dialogs

Recommended Posts

IESDP is confusing me. I don't want the cat to just puff out, no. What kind of a cat would that be!

Share this post


Link to post

Not for nothing, but would it be possible to have a moderator split this off to Modding Q&A? This stopped being about talking items a long time ago, and there's no sense clogging the tutorials board with Q&A stuff.

Share this post


Link to post

Since you don't want item dialogs...

 

As someone suggested, you could look at what the game does and copy the effects to your invisible dialog character. For example, DECK.CRE has two items equipped; one (IMPINVIS.ITM or MAGE01.ITM; they do the same thing) provides invisibility while worn, and the other (NOCIRC.ITM) disables the foot circle.

 

Don't use a bird animation if you want your dialog to have external links. (See the this IESDP Archive Topic for more info.)

 

Edit: NOCIRC.ITM may be a ToB item, so you might consider providing your own version of the items if you plan to support people who only have SoA.

Edited by Smoketest

Share this post


Link to post

Don't go away, Smoketest! I wanted to thank you for putting the original post out there, because I *do* want a talking item for BG2.

Share this post


Link to post

You're welcome, and I haven't gone away. For a change, I've decided to stop modding for awhile and actually play some games. :p

 

I'm hanging on to the BG series. It's easy to modify and the games are still fun to play. I like the story a lot, too. It's not every day I get to have divine blood in my veins. :p

Share this post


Link to post

I can't believe how I clogged your topic with that cat!

I need a talking item, too.

Edited by Bardess

Share this post


Link to post

At the risk of pointing out the obvious, modders can add their conversible items to the existing itemdial.2da, rather than overwriting the existing one. This allows compatibility with other mods, which is a good thing.

 

Here's the code to add to the tp2:

APPEND ~itemdial.2da~
~##XXXX	5689  ##DIALOG~
UNLESS ~##XXXX~

 

##XXXX is the item code (## is your unique prefix), 5689 is the "conversible" flag, and ##DIALOG is the item's dialogue file.

 

Nice and simple.

Share this post


Link to post
Guest picollo

Is it possible, that talking item could innitiate dialogue?

Share this post


Link to post

Yes, but it requires horrible bloat in baldur.bcs. Lilarcor does this.

 

Basically, what you would do would be put a script block in baldur.bcs, or in an area script, if the dialogue is only intended to happen in a specific area, or in an NPCs override script, if the item is intended only for one NPC. That script block would contain the item check, preferably HasItemEquiped() rather than PartyHasItem(), and some other conditions. If the conditions were true, it would spawn an invisible creature on top of Player1. The invisible creature has the same dialogue file as the item, so you don't need to create a new one. The reason for spawning the invisible CRE is that creatures can run script but items can't. At the end of the dialogue, you would destroy the creature.

Share this post


Link to post
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.

 

For newbie coders such as myself who find "set bit 11 at offset 0x18" less than clear (sorry, I just don't do bit-setting) -

 

1. Copy your item stub into the Override folder so that NearInfinity can see it. (Use a unique prefix+name so that it won't be confused with anything else.)

2. Use NearInfinity to view the .itm file

3. Look at the flags (Sellable, Droppable etc.) that have cheerful green tickies. If the Conversable flag doesn't have a ticky, go to the Edit tab.

4. You'll see a long list of item attributes. Near the top is Flags. Left click on Flags, look at the edit box that pops up at the bottom. Left click on Conversable. Save item.

5 If you want, go back to the View tab and check that Conversable is now green-tickied.

6 When you're happy with everything, Export your edited itm back into your Mod folder.

7 Append the ~itemdial.2da~ in your tp2 file as described above.

 

APPEND ~itemdial.2da~

~##XXXX 5689 ##DIALOG~

UNLESS ~##XXXX~

 

For people who know what they're doing, editing bit 11 is probably just one line of code added to the tp2, but I don't know what that line of code would be.

 

***

 

Using the string "5689" apparently labels the button with "Converse"? Is there a string that will label the button "Read"?

 

Thanks for all the advice in the tutorial - it was really helpful.

Edited by Thimblerig

Share this post


Link to post

For people who know what they're doing, editing bit 11 is probably just one line of code added to the tp2, but I don't know what that line of code would be.

WRITE_LONG 0x18 THIS BOR BIT11

 

Using the string "5689" apparently labels the button with "Converse"? Is there a string that will label the button "Read"?

If there isn't already one, you can add the string yourself. For example:

OUTER_SET strref = RESOLVE_STR_REF (~Read~)
APPEND itemdial.2da ~##XXXX %strref% ##DIALOG~
UNLESS ~##XXXX~

Edited by Wisp

Share this post


Link to post

Eh, never mind - I can't get this to work. It's fuss, for not much payoff, so I might let it go.

 

OUTER_SET strref RESOLVE_STR_REF (~Read~)

APPEND itemdial.2da ~##XXXX %strref% ##DIALOG~

UNLESS ~##XXXX~

Share this post


Link to post

Oh, you need an equals sign in there:

OUTER_SET strref = RESOLVE_STR_REF (~Read~)

Sorry.

Edited by Wisp

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...