Jump to content

Editing dialogue without STRING_SET


testlum

Recommended Posts

I want to make a simple mod for IWDEE where the kidnapped priestess Egenia in Dragon's Eye gives a reward when rescued. This boils down to (A) changing her first line of text to reference the reward and (B) adding the item to player inventory.

For reference this is the relevant section of DEGENIA.D.

image.thumb.png.0aeee1028daf5bd6da01baf342233c73.png

This is what I have so far.

Quote

STRING_SET 2137 @1005

COPY_EXISTING ~DEGENIA.DLG~ ~override~
    DECOMPILE_AND_PATCH BEGIN
        REPLACE_TEXTUALLY ~("Level_7_Hard")~
        ~("Level_7_Hard")
        GiveItemCreate("_TWAND02",LastTalkedToBy,30,0,0)~
    END

Since the weidu docs recommend against using STRING_SET, is there a better way for me to swap out the existing line? @1005 is contained inside my setup.tra.

Link to comment

No. # signs reference DIALOG.TLK, while @ signs reference a tra file. They can easily coexist in the same .D file; I've done that myself with my "Noober's Game" component. The core of that is a dialogue file; I decompiled the original with NI, then edited it as a .D file to repair a bunch of transitions. And finally, added in a line of my own as a response in one spot to make an otherwise unreachable state accessible. So in the end state, it has hundreds of # references and one @.

Link to comment

For replacing a line of dialogue, STRING_SET is certainly one way to do it, and probably the best option here.

There's no need to decompile-and-patch dlg files when WeiDU has a whole suite of dialogue-specific editing commands. ADD_TRANS_ACTION is made for exactly this:

ADD_TRANS_ACTION DEGENIA BEGIN 0 END BEGIN END ~GiveItemCreate("_TWAND02",LastTalkedToBy,30,0,0)~

Toss this in a d file and compile it in the tp2.

edit: The first BEGIN END combo targets the state (in this case 0) and the second BEGIN END the transition. By leaving the second blank, we add the new action to all transitions off state 0, which covers our bases in case another mod has added a transition here--for, say, an NPC interjection.

 

Edited by CamDawg
Link to comment

One alternative you could do for Egenia instead of the above is this d code:

EXTEND_BOTTOM DEGENIA 0
  IF ~~ THEN DO ~GiveItemCreate("_TWAND02",LastTalkedToBy,30,0,0)~ GOTO EgeniaReward
 END

APPEND DEGENIA

  IF ~~ THEN BEGIN EgeniaReward SAY @1005
    COPY_TRANS 0
  END

END

We're extending the bottom of state 0 with a new transition. Since it sits at the bottom it gets checked first, meaning it always gets followed and bypasses any existing replies and transitions. We add our action there and send it to our new state, EgeniaReward. This state is created in the following append with our new line, @1005. In this case, Egenia's opening line remains intact, so @1005 is now a followup and likely needs to be changed a bit. Once she says her new line, we COPY_TRANS 0, which copies over all of the existing transitions from state 0, like the PC's normal reply and flow into the rest of her dialogue.

Link to comment

No. There's an amazing range of dialogue commands--remember what the D in WeiDU stands for and how the tool got started--that you put into a d file and COMPILE. For example, here's The Calling's dialogue changes in mage.d, and the tp2 bits to compile it.

WeiDU's got a massive section explaining the basics of dialogues and the d commands available.

Edited by CamDawg
Link to comment

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