Jump to content
Sign in to follow this  
Bill Bisco

How to Create a Simple Weidu Mod to Compile One Dialog

Recommended Posts

First let me say these:
- the dialogue file in the game is a dlg. The ".d" file is the file in your mod that is to be compiled. This can contain any kind of syntax, not necessarily a new dlg name.
- don't call your custom dialogue states in your .d-file with plain numbers. Give them unique names, in my example, it is "mod_x". WeiDU will transform them into numbers upon compilation. This way, you prevent existing state numbers to be overwritten (for compatibility reasons - just in case there will be another mod adding to this chrarcter).

 

Then, there is an example in the weidu readme, in section 8.3. Searching for the term inside the document will bring it up (it is in the section for COPY_TRANS, which is also an important thing to know.)

The EXTEND_BOTTOM syntax would be like this. After that, you would use APPEND to add your custom dialogue states. I recommend looking at Kulyok's Branwen NPC mod, which is coded as an example, with explanations to see the syntax in action.

 

EXTEND_BOTTOM DEREVAIN 10
IF ~[your triggers, if any]~ THEN REPLY ~Erevain. I think you should join us.~ GOTO mod_12
END

APPEND DEREVAIN

IF ~~ THEN mod_12
SAY ~blabla~
IF ~~ THEN DO ~[your actions, if any]~ EXIT
END

END //APPEND

Edited by jastey

Share this post


Link to post

Alright I tried to interpret these instructions as best I can:

 

I have a folder named

 

Dialogfile

 

I have three items within this folder

 

DEREVAIN.D

Dialogfile.TP2

setup-Dialogfile.exe (renamed Weidu file)

 

DEREVAIN.D looks like this

 

 

EXTEND_BOTTOM DEREVAIN 10
IF ~~ THEN REPLY ~Erevain, you're an able adventurer, you should join us.~ GOTO mod_12
END

APPEND DEREVAIN

IF ~~ THEN mod_12
SAY ~I think that's an interesting proposal. Let me think about it.~
~ EXIT
END

//APPEND

 

 

Dialogfile.TP2 looks like this:

 

BACKUP ~Dialogfile/backup~
AUTHOR ~Bill Bisco~

COMPILE ~Dialogfile/DEREVAIN.D~

 

 

Is there anything I missed or have wrong syntax with? I assume because I want to affect the DEREVAIN.DLG file, I by default the .D file must be named DEREVAIN.D correct?

Share this post


Link to post

Alright I tried to interpret these instructions as best I can:

 

I have a folder named

 

Dialogfile

 

I have three items within this folder

...

setup-Dialogfile.exe (renamed Weidu file)

The .exe needs to be outside, so when you move it and the folder, you can run the .exe in the game folder and the folder itself keeps the mods custom content inside itself, and the backup folder and so forth. Edited by Jarno Mikkola

Share this post


Link to post

I assume because I want to affect the DEREVAIN.DLG file, I by default the .D file must be named DEREVAIN.D correct?

no. The name of your .d file is unimportant. The result of a .d file is only dependent of what is inside. You specified inside that the derevain.dlg should be affected, the .d file can have whatever name you want. Edited by jastey

Share this post


Link to post

 

I assume because I want to affect the DEREVAIN.DLG file, I by default the .D file must be named DEREVAIN.D correct?

no. The name of your .d file is unimportant. The result of a .d file is only dependent of what is inside. You specified inside that the derevain.dlg should be affected, the .d file can have whatever name you want.

 

My only reference to the derevain.dlg was by:

EXTEND_BOTTOM DEREVAIN 10

Is that good enough? Weidu automatically knows that DEREVAIN is the DEREVAIN.DLG file to EXTEND_BOTTOM with?

 

Thank you much for your replies.

Share this post


Link to post

Yes, that's good enough. The ".DLG" part is implied when you call EXTEND_BOTTOM from a .d file, and there's only ever going to be one DEREVAIN dialogue.

Share this post


Link to post

I got got some earlier errors and made some modifications. My files look like this now:

 

DialogFile.TP2 FIle

BACKUP ~Dialogfile/backup~
AUTHOR ~Bill Bisco~

BEGIN ~Dialogfile Mod v1.0~
COMPILE ~Dialogfile/DEREVAIN.D~

DEREVAIN.D File

BEGIN

EXTEND_BOTTOM DEREVAIN 10
IF ~~ THEN REPLY ~Erevain, you're an able adventurer, you should join us.~ GOTO mod_12
END
 
APPEND DEREVAIN
 
IF ~~ THEN mod_12
SAY ~I think that's an interesting proposal.  Let me think about it.~
~ EXIT
END

I got this error message from Weidu:

 

UBow9I3.png

 

It doesn't like this Extend_Bottom Code for some reason. Any help would truly be appreciated.

Edited by Bill Bisco

Share this post


Link to post

Try this:

 
// You don't need a BEGIN unless you're starting or overwriting a new dialogue file.

EXTEND_BOTTOM DEREVAIN 10
++ ~Erevain, you're an able adventurer, you should join us.~ + mod_12
END
 
APPEND DEREVAIN
 
IF ~~ mod_12
SAY ~I think that's an interesting proposal.  Let me think about it.~ 
IF ~~ EXIT
END
 
END // closes the APPEND command

// (I used slightly more streamlined code - saves typing when you have a large .d file to create.)

Edited by Thimblerig

Share this post


Link to post

Woo! That worked!

 

kcnYA7d.png

 

I feel empowered now! Thanks to all of you!

 

Out of curiousity, is there a way to add in a new dialogue option between dialogue options rather than just at the bottom? For example, in Erevain's default dialogue you say goodbye to him as the last option, but with this new extend_bottom dialogue, we're prodding for more information. Ideally, We would Extend us between option 2 and 3 as opposed to becoming 4.

 

E3mGPQ5.png

 

 

Edited by Bill Bisco

Share this post


Link to post

w00t!

 

 

 

Out of curiousity, is there a way to add in a new dialogue option between dialogue options rather than just at the bottom?

 

There is indeed:

 

 

EXTEND_BOTTOM DEREVAIN 10
#2  // this tells the compiler to put the new transition after Existing Transition 2.
++ ~Erevain, you're an able adventurer, you should join us.~ + mod_12
END

 

There's a fuller explanation here: http://www.weidu.org/~thebigg/README-WeiDU.html#EXTEND_BOTTOM (the language can be intimidating, but it's a very worthwhile read).

Share this post


Link to post

(But doing that is bad practice, as it shoves the existing reply option numbering and breaks other mods that e.g. ADD_TRANS_ACTION to a specific reply option, so for compatibility reasons you just add your reply option to the bottom, unless it's ToB Fate of Spirit Call for companions where all mods do EXTEND_TOP, more or less.)

Share this post


Link to post

Very well, I shall seek to refrain from using that, ugliness and obvious moddiness aside

 

How does the streamlined code work with options? I want to put in two conditional lines of dialogue. How would you code those with the pluses?

++ IF ~!Race(Player1, ELF)~ THEN REPLY ~What in the Nine Hells is an elf doing up here?~ + GOTO 2
  ++ IF ~Race(Player1, ELF)~ THEN REPLY ~Well met again brother.  How goes your journey?~  DO ~SetGlobal("Erevain_Met","GLOBAL", 1)~ GOTO 1

Thanks.

Share this post


Link to post

+ ~!Race(Player1, ELF)~ + ~What in the Nine Hells is an elf doing up here?~ + 2
+ ~Race(Player1, ELF)~ + ~Well met again brother. How goes your journey?~ DO ~SetGlobal("Erevain_Met","GLOBAL", 1)~ + 1
Edited by Thimblerig

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...