testlum Posted October 26, 2023 Share Posted October 26, 2023 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. 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. Quote Link to comment
subtledoctor Posted October 26, 2023 Share Posted October 26, 2023 I feel like in this case STRING_SET is probably fine. I suppose inside your DECOMPILE_AND_PATCH you could: REPLACE_TEXTUALLY ~#2137~ ~@1005~ Maybe? Quote Link to comment
testlum Posted October 26, 2023 Author Share Posted October 26, 2023 My thought is that the ~@1005~ in your example would reference 1005 in the original DIALOG.TLK instead. Quote Link to comment
jmerry Posted October 26, 2023 Share Posted October 26, 2023 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 @. Quote Link to comment
testlum Posted October 26, 2023 Author Share Posted October 26, 2023 Good to know. Thanks to both of ya. Quote Link to comment
CamDawg Posted October 26, 2023 Share Posted October 26, 2023 (edited) 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 October 26, 2023 by CamDawg Quote Link to comment
CamDawg Posted October 26, 2023 Share Posted October 26, 2023 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. Quote Link to comment
testlum Posted October 26, 2023 Author Share Posted October 26, 2023 Quote ADD_TRANS_ACTION DEGENIA BEGIN 0 END BEGIN END ~GiveItemCreate("_TWAND02",LastTalkedToBy,30,0,0)~ Maybe I am misunderstanding what "toss this into a D file" means. Shouldn't this command be included inside the tp2? Quote Link to comment
CamDawg Posted October 26, 2023 Share Posted October 26, 2023 (edited) 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 October 26, 2023 by CamDawg Quote Link to comment
Recommended Posts
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.