Jump to content

how to create a .d file for a mod ?


Recommended Posts

So, I’ve nearly finished my second merchant mod, and I’ve difficulties to understand precisely how to function a .d file. Well I’mnot the dumbest guy here about the IE modding, but until now I don’t understand clearly how functions the variables; it concerns here an exchange between Jan and his cousin Artemus (a merchant -  ARTEMUS.CRE). It works like this:

BEGIN ~Artemus~ 

    // presentation Artemus
IF ~True()
~ THEN BEGIN 0 
  SAY @100 

    // TEST VARIABLE if Jan is present in the team:
    // 1.  if JAN isn’t here    (VARIABLE)  -> GOTO 101 ->  shop open
            -> GOTO 102 not interested   103  104
                        END
    // 2.  if Jan is here    (VARIABLE) -> GOTO   105    Artemus speaks
                106    Jan
                107    Artemus
                108    Jan
                109    Artemus
                110    Jan
                111    Artemus    has the last word
                        END
            GOTO 101
            GOTO 102   not interested  103  104
    // 3.  if Jan is here but has already spoken    (VARIABLE) -> GOTO 101
                       -> GOTO 102 not interested  103  104
                        END

That’s all. Thank you by advance, it has got me out of a spot.

Link to comment

What do the 101 102 103 stand for? I am slightly confused. Also, which is a PC reply and which is supposed to be spoken by Artemus. I understand the Artemus  / Jan interlude if Jan is present, but not exactly the GOTO 102 not interested   103  104.

Link to comment

They are the greetings, in French but I have the translation here:

 

@101    = ~Salut à vous, messire gnome. Regardons donc ce que vous avez.~
@102    = ~Peut-être une autre fois.~
@103    = ~Comme vous voulez.~
@104    = ~Revenez bientôt!~

 

@101  = ~Hello to you , sir gnome. Let's see what you have.~

@102  = ~Maybe another time.~

@103  = ~As you will.~

@104  = ~Come again!~

Link to comment

there isn’t any <CHARNAME>  answer, when he speaks to Artemus ->

@100    = ~Salutations <LADYLORD>, bienvenue dans la boutique d’Artemus Jansen (c’est moi!) . Voudriez-vous acheter quelques-uns de mes objets de grande qualité ?~

(test variable etc)

->101

Link to comment
12 minutes ago, Prof Errata said:

there isn’t any <CHARNAME>  answer, when he speaks to Artemus ->

@100    = ~Salutations <LADYLORD>, bienvenue dans la boutique d’Artemus Jansen (c’est moi!) . Voudriez-vous acheter quelques-uns de mes objets de grande qualité ?~

(test variable etc)

->101

@101 and @102 seem to be the PC replies, either "let's see what you have" or "maybe later".

Link to comment

This is how I would do it. Please note: after using CHAIN if you want to continue with the normal dialogue states, you need to wrap them in APPEND dlgname ... END

I'd suggest you use a prefix and used "xx" for now. Link to the prefix list is here.

 BEGIN ~xxArtemu~ //max 8 letters

    // presentation Artemus
IF ~True()~ THEN BEGIN 0 //I'd recommend a state name instead of fixed numbers in your .d-file
SAY @100 
+ ~OR(4) !InParty("Jan") // Jan not in party
	 !InMyArea("Jan") //Jan not here - can't speak
	 StateCheck("Jan",CD_STATE_NOTVALID) //Jan is there but can't talk
	 Global("xx_janchain_run","LOCALS",0) //Jan already spoke with Artemus
~ + @101 /* ~Salut à vous, messire gnome. Regardons donc ce que vous avez.~ */ DO ~StartStore("xxArtst",LastTalkedToBy(Myself))~ EXIT
+ ~OR(4) !InParty("Jan") // Jan not in party
	 !InMyArea("Jan") //Jan not here - can't speak
	 StateCheck("Jan",CD_STATE_NOTVALID) //Jan is there but can't talk
	 Global("xx_janchain_run","LOCALS",0) //Jan already spoke with Artemus
~ + @102 ~Peut-être une autre fois.~ */ + au_revoir
IF ~InParty("Jan") InMyArea("Jan") !StateCheck("Jan",CD_STATE_NOTVALID)
Global("xx_janchain_run","LOCALS",0)~ THEN DO ~SetGlobal("xx_janchain_run","LOCALS",1)~ + jan_chain
END

IF ~~ THEN au_revoir
SAY @103 /* ~Comme vous voulez.~ */
= @104 /* ~Revenez bientôt!~ */ //I'd suggest shorten the exit a bit. The player has to click through it every time.
IF ~~ THEN EXIT
END

/* Here is the Jan-Artemus exchange. For CHAIN, the syntax is slightly different than for normal dialogue states. */
CHAIN
IF ~~ THEN ~xxArtemu~ jan_chain
@105
== JanJ @106
== ~xxArtemu~ @107
== JanJ @108
== ~xxArtemu~ @109
== JanJ @110
== ~xxArtemu~ @111
END
++ @101 /* ~Salut à vous, messire gnome. Regardons donc ce que vous avez.~ */ DO ~StartStore("xxArtst",LastTalkedToBy(Myself))~ EXIT
++ @102 ~Peut-être une autre fois.~ */ + au_revoir

 

 

To use the "NPC cannot talk" state check you'll need to include this into your tp2:

//CamDawgs CD_STATE_NOTVALID
    APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~ UNLESS ~CD_STATE_NOTVALID~
Link to comment

Waou ! Thank you very much for your help, Jastey. Sorry, I can’t send you flowers but the heart is here…Are you in computers like Kat Bellla and many others ? This explains that. Note: it’s the third time that I have received  precious technical helps here in the G3 forums for my mods, and I’m delighted. Merci 1000 fois !

little precisions here:

@105 : it’s the first line said by Artemus when he see Jan for the first time. Here the whole line, in French until now:

@105    =~Que le grand cric me croque! Mais voilà une tête qui m’est familière! Mon cher cousin Jan, spécialiste avéré de toutes les entourloupes possibles et imaginables…alors, Golodon a enfin fini par te virer?  Ce qui ne me surprendrait guère au passage…~
 

@101 and @102: actually they are <CHARNAME> lines. ok

What do you mean exactly with CHAIN/APPEND…END? I’venot the intention to add more dialogs, these ones are definitive until now.

About the new line in the tp2, it’s ok like that ? in the dialogues section ?

// Dialogues

COMPILE
  ~Artemus/dialogue/Artemus.d~
APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~ UNLESS ~CD_STATE_NOTVALID~

my prefix: BEGIN ~PEARTEMU~    //  PE has been already used for my first mod (PEKAYA)

 

So, now is it possible to send me the definitive lines, without the comments please ?

NB: is there a person here in G3 who understand French ? It will help a lot.

 

Link to comment

I understand about 40% French but I'm not sure that's what you meant.

The d-file without comments. Replace ~xxArtemu~ with whatever the name of Artemus' dialogue file is:

BEGIN ~xxArtemu~ 

    // presentation Artemus
IF ~True()~ THEN BEGIN 0 
SAY @100 
+ ~OR(4) !InParty("Jan") 
	 !InMyArea("Jan") 
	 StateCheck("Jan",CD_STATE_NOTVALID) 
	 Global("xx_janchain_run","LOCALS",0)~ + @101 DO ~StartStore("xxArtst",LastTalkedToBy(Myself))~ EXIT
+ ~OR(4) !InParty("Jan") 
	 !InMyArea("Jan") 
	 StateCheck("Jan",CD_STATE_NOTVALID) 
	 Global("xx_janchain_run","LOCALS",0)~ + @102 + au_revoir
IF ~InParty("Jan") InMyArea("Jan") !StateCheck("Jan",CD_STATE_NOTVALID)
Global("xx_janchain_run","LOCALS",0)~ THEN DO ~SetGlobal("xx_janchain_run","LOCALS",1)~ + jan_chain
END

IF ~~ THEN au_revoir
SAY @103 
= @104 
IF ~~ THEN EXIT
END

CHAIN
IF ~~ THEN ~xxArtemu~ jan_chain
@105
== JanJ @106
== ~xxArtemu~ @107
== JanJ @108
== ~xxArtemu~ @109
== JanJ @110
== ~xxArtemu~ @111
END
++ @101 DO ~StartStore("xxArtst",LastTalkedToBy(Myself))~ EXIT
++ @102 + au_revoir

In the tp2, the patching of the STATE.IDS needs to be done before compiling the .d-file, so the installer can resort to the definition:

APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~ UNLESS ~CD_STATE_NOTVALID~ 

// Dialogues

COMPILE
  ~Artemus/dialogue/Artemus.d~

If you don't want to add more dialogue, then forget what I wrote about APPEND etc. But if you'll write more dialogues in the future and get a parsing error after using CHAIN, maybe you'll remember that there was something to remember. ;)

Link to comment

It’s with a mischievous remark from your part that we can nearly complete this precious help; I will see tomorrow if all is OK. And of course, I can only to thank you for your marvellous skills, Ô Great Lady of Computer Science…and now it’s best to sleep on it…

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