Jump to content

How to Create a Simple Weidu Mod to Compile One Dialog


Bill Bisco

Recommended Posts

I just want to replace the default dialog of an existing Creature. The line of Code I want to run is:

COMPILE ~NeJ/Dfiles/DEREVAIN.D~

This dialog has already been compiled earlier. I want to replace the current dialog.

I have a Weidu.exe. How do I code the Weidu to just run this one line?

 

Thanks,

 

Bill

 

 

Link to comment

Just make a new directory and call it "Dialogfile", copy the .d file into it and make a new .txt file, save it as setup-dialogfile.tp2, and you can set that to the folder too or leave it out, and then copy this code into it:

BACKUP ~Dialogfile/backup~
AUTHOR ~Bill Bisco~

BEGIN ~Install the dialog file~ 
COMPILE ~Dialogfile/DEREVAIN.D~

And rename the weidu.exe as setup-dialogfile.exe, and then copy the folder, and if you left the .tp2 file outside, and the .exe all to your game folder and then just run the .exe ...

Link to comment

What happens to the existing dialog? Does this replace it?

That depends on what is inside the DEREVAIN.D. If it is "BEGIN ~name of dlgfile~", then it will replace an existing one, yes.

(Replacing dialogue of existing creatures is bad for compatibility, btw., so I hope you know what you are doing.)

Link to comment

I don't know what I'm doing; that's why I'm asking here. How does the Converted .D file into a Dialog File relate to the dialog.tlk ? I want to make changes to the dialog of this creature, update it and then load a saved game to see how the dialog looks ingame. Does the code above compile the .D file into a .Dialogue FIle and put it into Dialog.tlk?

Link to comment

That depends on what you wrote inside the .d (sorry for repeating myself, but it's the valid answer).

 

Upon installation, WeiDU executes the syntax commands in your .d-file. If you define a new dlg by "BEGIN ~dlgname~" it will create a new dlg. If the commands are only patching or attaching to existent dlg-files, WeiDU will do that. The text lines are added to the dialog.tlk with a string reference number (only valid for this install. You cannot take your mod's string numbers for reference, as they will be different for different installs). The string reference number will be stored in the dlg-file, which is basically a sum of links, it doesn't contain any texts.

 

If you want to make changes to an existing dialogue, there are many syntax possibilities to do so. You can do e.g. EXTEND_BOTTOM to add a reply option to an existing dialogue state, then add your new dialogue states by "APPEND ~dlgname~ (your new dialogue states) END".

You can also add more lines of text or interjections of NPCs etc. by I_C_T (INTERJECT_COPY_TRANS).

(too many possibilities to quickly list them here, best you look into the WeiDU readme, or take other mods as example, or look for tutorials).

 

The main importance is, if you make a .d and write inside

 

BEGIN ~dlgname~

It will replace the existing dlg ~dlgname~ (making the mod incompatile with all other mods changing the dialogue - not recommended.)

 

Link to comment

This .d file starts with BEGIN ~DEREVAIN~ 83119

 

I am 99.999% sure no other mods modify this creature. So, since this replaces the dialogue file, dialog.tlk is similarly updated with weidu?

 

What would happen if for instance I converted the .d file somewhere else then later replaced the .dialogue file, would the new dialogue properly show up?

 

Also, why the reference to 83119?

Link to comment

I'd just like to echo jastey here - replacing dialogue and overwriting things is generally considered not a good modding practice. It's usually much easier to introduce your own character, who'd say all the lines you want. Or to append a one-time dialogue with WEIGHT #-1 on top of the stack, so that it plays once and disappears.

Link to comment

Yeah, but you got to ask yourself: Is Bill Bisco asking this question to edit his own game, or about to release a mod of some sorts, which we have never heard about and use the NEJ's resources of all things ? The likely answer is the former ... based on the other questions here. Like:

 

Also, why the reference to 83119?

Erhm, what do you use to look at the .d file ?
Link to comment

Hi, I'm writing a mod to turn Erevain Blacksheaf from IWD into a joinable character for the Never Ending Journey mod (ideally for the IWD NPCs mod too, but that's not in the scope at the moment.)

 

I get what you're saying. Even though I don't expect others to modify the dialog, I should go ahead and try to code it such as that anyway.

 

How would I add an option to this following sequence?

 

IF ~NumTimesTalkedToGT(0)

Global("Erevain_Jerk", "GLOBAL", 0)~ THEN BEGIN 10 // from:

SAY ~Well met, again, friends.~

IF ~!Race(Player1, ELF)~ THEN REPLY ~I'm not your friend, elfling.~ GOTO 4

IF ~~ THEN REPLY ~Greetings. Have you heard any rumors in your travels?~ GOTO 9

IF ~~ THEN REPLY ~Well met, Erevain. Just thought I'd greet you in passing. Farewell.~ EXIT

END

Link to comment

So if I used EXTEND_BOTTOM to edit the below part of the .d file I would do this?

 

Original .D File

IF ~NumTimesTalkedToGT(0)
Global("Erevain_Jerk", "GLOBAL", 0)~ THEN BEGIN 10 // from:
SAY ~Well met, again, friends.~
IF ~!Race(Player1, ELF)~ THEN REPLY ~I'm not your friend, elfling.~ GOTO 4
IF ~~ THEN REPLY ~Greetings. Have you heard any rumors in your travels?~ GOTO 9
IF ~~ THEN REPLY ~Well met, Erevain. Just thought I'd greet you in passing. Farewell.~ EXIT
END

EXTEND_BOTTOM documentation (here) goes like

EXTEND_BOTTOM filename stateNumber  list [ #positionNumber  ] transition  list END

so I'd do something like

EXTEND_BOTTOM DEREVAIN.D 10 list [ 4 ] transition list END

Yeah. I don't really get it. I just want to add a line something like

IF ~~ THEN REPLY ~Erevain.  I think you should join us.~ GOTO 12 ......

I just want to continue you on, making a new GoTo Point (12) and new dialogue options that spring from that.

 

If you know of an example, please let me know and I'll look it up. The Weidu Documentation page doesn't have an example.

Link to comment

Archived

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

×
×
  • Create New...