Jump to content

Item Patching: Messing with the Drink Potion button


Thimblerig

Recommended Posts

So, I made up an item for a mod I'm working on - a special soap that will remove minor curses. Since there isn't a basic item class for 'Soap', I made the base item from a potion and added the Remove Curse effect. (The Remove Curse works fine.)

 

But, the Use Item button is still "Drink Potion" and comes with a gulp sound.

 

I'd like, if possible, to change the "Drink Potion" string to "Wash" and attach a different sound. Does anyone have any advice on how to do that?

 

The current tp2 code is:

 

 

/* Curse Removing Soap */

 

COMPILE EVALUATE_BUFFER ~bg1re/girdlegender/dialogue/soapstuff.d~

 

COPY ~bg1re/girdlegender/item/T1SOAP.ITM~ ~override/T1SOAP.ITM~

SAY NAME1 ~Mistress Mirrorshade's Best Curse-Removing Soap~

SAY NAME2 ~Mistress Mirrorshade's Best Curse-Removing Soap~

SAY DESC ~Mistress Mirrorshade's Best Curse-Removing Soap

 

This bottle of liquid soap was concocted to an old gnomish recipe handed down by Gellana Mirrorshade's mother, the cleric Gollumi Myrnickle. The pungent purple lotion, mixed from herbs, holy water, blessed ashes, and the tallow of high-minded sheep, will cleanse the user of some minor curses and spiritual afflictions.

 

CAUTION: May put hairs on your chest, or remove them.

 

Abilities:

 

Remove Curse x 10~

Link to comment
There are no 2DA files (I know of) that can control the button text.

 

This is an example of working code that will affect the button text:

 

OUTER_SET strref = RESOLVE_STR_REF (~Read~)

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

UNLESS ~##XXXX~

 

Unfortunately, this is for Conversable items, and my code-fu is not nearly strong enough to adapt it.

 

Will have a look at the Tree of Life nuts. Thanks.

Link to comment

I doubt that itemdial.2da will be any use to you, unless your soap has become sentient and wants to talk to you. itemdial.2da allows you to specify a dialog file that will be triggered whenever you click on the "Converse" button. On the other hand, I can imagine to (mis-)use the dialog for describing your character's action when he/she's using the soap.

Link to comment
I doubt that itemdial.2da will be any use to you, unless your soap has become sentient and wants to talk to you.

 

Best comment. :) (Now I keep imagining Minsc talking to the sentient soap and lauging so hard! Um, sorry for the offtopic.)

Link to comment

Yes, I know itemdial.2da isn't useful for this. That's why I'm not trying to use that block of code. But you said that there isn't a way to patch buttons, so I showed you an example of buttons getting patched (from "Converse" to "Read".) I've tested that, and it works. I know I can't use that code here.

 

But I know that button-patching is possible.

Link to comment

The text for the "Converse" button can be adjusted in itemdial.2da as well. Potions seem to use the hardcoded strref 19392 only. There may be a way to patch the game's executable to add customizable buttons to items, but that's way over my head. Maybe a TobEx feature request might help.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...