Thimblerig Posted March 25, 2014 Share Posted March 25, 2014 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
Ardanis Posted March 25, 2014 Share Posted March 25, 2014 The best you can do is to use item type of 0, like bardic instruments. Link to comment
Thimblerig Posted March 25, 2014 Author Share Posted March 25, 2014 - I can't find item type 0 in the list in NearInfinity (Misc 0) - Would that let me customise the Use Item button? Link to comment
Thimblerig Posted March 26, 2014 Author Share Posted March 26, 2014 Well, I know it's possible to change the button on a Conversable item from "Converse" to "Read", because I've done it. I just can't work out how to adapt the code... Link to comment
Thimblerig Posted March 26, 2014 Author Share Posted March 26, 2014 Changing the item type from Potions to Misc gets rid of the Use button entirely. Is there something else I should be doing? Link to comment
argent77 Posted March 26, 2014 Share Posted March 26, 2014 There are no 2DA files (I know of) that can control the button text. Using the Misc category is probably the best you can do. This will let your soap behave like a wand or BG2's Tree of Life nuts (MISCBQ.ITM) that can heal your character. Link to comment
Thimblerig Posted March 26, 2014 Author Share Posted March 26, 2014 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
argent77 Posted March 26, 2014 Share Posted March 26, 2014 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
Kulyok Posted March 26, 2014 Share Posted March 26, 2014 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
Thimblerig Posted March 26, 2014 Author Share Posted March 26, 2014 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
argent77 Posted March 26, 2014 Share Posted March 26, 2014 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
Thimblerig Posted March 26, 2014 Author Share Posted March 26, 2014 Ah, thank you for the explanation. I'll look into Misc items, then. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.