Jump to content

Editing .dlg Files


Recommended Posts

Posted (edited)

I want to add a unique upgradable armor to BG2/EET by hijacking the code to make Aslyferund Chain in BOTSMITH.dlg.  I do not want to just change the component and finished armor, as those changes will be carried into the Black Pits 2, other item shops, and as loot drops; I do not want there to be multiple copies.  Instead, I want to edit the 26 response triggers in BOTSMITH that refer to:

PartyHasItem("chan16")

Into:

PartyHasItem("emchan16")

Are there any commands for editing response triggers? I looked at the Weidu documentation, and it suggests REPLACE_TRIGGER_TEXT, but then immediately says never to use it.  Please help!

P.S.

I also want to adjust the formula in the 1 action in BOTSMITH and adjust two little unvoiced lines of dialog. So far, I think I made progress by adjusting the two dialog strings here:

OUTER_SPRINT recipe_short @161
OUTER_SPRINT recipe_tweak @162
STRING_SET_EVALUATE 66897 ~%recipe_short%~
STRING_SET_EVALUATE 66898 ~%recipe_tweak%~

I am hoping this will replace the string reference with the text from @161 & @162 in my tra file.  Are these the correct commands? I find it quite cumbersome to experiment with weidu to find out.  But and actions.  Any advice is appreciated.

Edited by MindTyrant
Posted
On 9/12/2024 at 7:13 AM, subtledoctor said:

This might be an appropriate circumstance for ALTER_TRANS… I think?

I cannot figure out the syntax for that function for my life.  It uses terminology like transition instead of response described in NI and IESDP.  From examining both, I think they mean the same thing, but I am not sure.  Any help would be appreciated.

On 9/12/2024 at 7:13 AM, subtledoctor said:

Or, honestly, good old REPLACE_TEXTUALLY might be fine for this. 

I think it might work; but I am concerned about the replacement text being the same size hexadecimally.  I tested changing it in NI, and replacing "chan16" with "emchan16" shifted the file 2 hexadecimals over.  In the weidu documentation, REPLACE_TEXTUALLY says it destructively replaces the text, I am afraid it just types over it.  I would rather use a command.  Please help!

Posted
19 hours ago, subtledoctor said:

DECOMPILE_AND_PATCH, then REPLACE_TEXTUALLY. The dialogue is then recompiled at the end of the instruction. 

Thank you!  Could you please look at my code and tell me if it looks right?

COPY_EXISTING ~botsmith.dlg~  ~override~
      DECOMPILE_AND_PATCH BEGIN
            REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~CHAN16~ ~emchan16~
            REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~cHAN19~ ~emchan19~
            REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~SCRL6T~ ~SCRL7O~
      END
OUTER_SPRINT recipe_short @161
OUTER_SPRINT recipe_tweak @162
STRING_SET_EVALUATE 66897 ~%recipe_short%~
STRING_SET_EVALUATE 66898 ~%recipe_tweak%~

I just want to make sure it looks right.  It is cumbersome to reinstall EET and test after every change.  So please let me know if I screw up the syntax for DECOMPILE_AND_PATCH, such as missing an END, or if my changes to dialog will result in the text of @161 and @162 replacing the string numbered 66897 and 66898 in dialog.tlk, or do I need to still call it?

Posted (edited)

@subtledoctorCould you please take a quick look? I figured out over the weekend that I do not have a clean save.  If you could just let me know if I am messing up the syntax (such as having the correct number and placement of BEGINs and ENDs) and do I need to call dialog.tik?

Edited by MindTyrant
Posted
1 hour ago, MindTyrant said:

Could you please take a quick look? I figured out over the weekend that I do not have a clean save.  If you could just let me know if I am messing up the syntax (such as having the correct number and placement of BEGINs and ENDs) and do I need to call dialog.tik?

This is the correct syntax. Your code looks fine (assuming you're making the correct edits). There is no need to call dialog.tlk

Posted

Looks okay to me, but at the end of the day things like this need to be tested. 

(And while I have enough familiarity with .DLG modding to give pointers because I’ve made a few content mods recently, it is still not my area of strength, lots of others around here are far more adept than me.)

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...