Jump to content

INTERJECT : how have your NPC comments Delcia horrible behaviour (aunt of Nalia) ?


Nijel

Recommended Posts

Hi,

 

I'm working on a NPC mod (don't know if I'll get through with it, but I'm enjoying it despite the unavoidable coding headhache and all) and currently trying some INTERJECT.

 

I was sticking to rather basic conditions now, so I had no trouble so far that I couldn't solve my self. But now...

 

I want my NPC making a comment like other Bioware NPC (Mazzy,Viconia,Yoshimo,Korgan) in De'Arnise Castle, when Delcia (the infamous aunt of Nalis) talks with the PC. I decompiled Delcia.dlg and I found that the coding was rather complicated (and not an INTERJECT at all by the way). In short, the script checks if Mazzy is in the party, then if Viconia and not Mazzy, then Yoshima and not Mazzy and Viconia, and so on until Korgan. Each time, the state ends by an EXTERN to the checked NPC. If you look at the npc dialog then it is scripted so that you'll hear others NPC comments I think.

 

Here's the beginning of the relevant part of Delcia.d

 

IF ~~ THEN BEGIN 16 // from: 41.0

SAY #24576 /* ~Il sera muet comme une carpe. Il est parfois aussi faible que Nalia, mais il ne s'abaisserait pas à marchander avec des inférieurs. Sauvez-le, voulez-vous ? Vous êtes là pour ça, après tout.~ */

IF ~!IsValidForPartyDialog("Mazzy")

!IsValidForPartyDialog("Viconia")

!IsValidForPartyDialog("Korgan")

!IsValidForPartyDialog("Yoshimo")~ THEN DO ~SetGlobal("DelceaMove","GLOBAL",1)

ActionOverride("kpsold01",EscapeArea())

SetGlobal("DelciaLeave","GLOBAL",1)

EscapeAreaMove("AR1300",768,3310,8)

~ UNSOLVED_JOURNAL #7262 EXIT

 

IF ~IsValidForPartyDialog("Mazzy")~ THEN DO ~SetGlobal("DelceaMove","GLOBAL",1)

ActionOverride("kpsold01",EscapeArea())

SetGlobal("DelciaLeave","GLOBAL",1)

EscapeAreaMove("AR1300",768,3310,8)~ UNSOLVED_JOURNAL #7262 EXTERN ~MAZZYJ~ 187

 

IF ~!IsValidForPartyDialog("Mazzy")

IsValidForPartyDialog("Viconia")~ THEN DO ~SetGlobal("DelceaMove","GLOBAL",1)

ActionOverride("kpsold01",EscapeArea())

SetGlobal("DelciaLeave","GLOBAL",1)

EscapeAreaMove("AR1300",768,3310,8)~ UNSOLVED_JOURNAL #7262 EXTERN ~VICONIJ~ 169

 

I removed the comment which described #7262 of the journal part put in by Weidu.

 

Here's VICONIJ 169. If you decompile MAZZYJ.dlg, you'll see that it checks similarly (so it will go to VICONIJ169 if Viconia is in the team).

 

IF ~~ THEN BEGIN 169 // from:

SAY #56542 /* ~Je pense qu'un petit mois de torture parmi les araignées de Lolth devrait lui enlever son sens de la supériorité. L'elg'caress devrait savoir rester à sa place lorsqu'elle rencontre ses supérieurs, tout sang mis à part.~ */

IF ~!IsValidForPartyDialog("Korgan")

!IsValidForPartyDialog("Yoshimo")~ THEN EXIT

IF ~IsValidForPartyDialog("Korgan")~ THEN EXTERN ~KORGANJ~ 169

IF ~!IsValidForPartyDialog("Korgan")

IsValidForPartyDialog("Yoshimo")~ THEN EXTERN ~YOSHJ~ 96

END

 

At the end of the state, every characters amongst Mazzy, Viconia, Korgan and Yoshimo should have commented about Delcia behavior. So, I want to make my NPJ comments like the other. I don't think modifying (in a respectful Weidu way) DELCIA.dlg, MAZZYJ.dlg, ..., KORGAN.dlg is the way to go (seems a hassle to me). At first I tried to interject after DELCIA 16, but that did interrupt the script (she didn't escape the area as she was supposed to).

 

Then I did that :

INTERJECT_COPY_TRANS2 DELCIA 16 LyssenCommentDelciaLeave //When Delcia leaves, Lyssen points out she would have eagerly killed her

== N1#LYSJ IF ~InMyArea("N1#LYS") InParty("N1#LYS") !StateCheck("N1#LYS",CD_STATE_NOTVALID)~ THEN

~Une vraie peste ! S'il y avait un contrat sur sa tête, je serais presque prête à l'honorer gratuitement...~

== N1#LYSJ IF ~InMyArea("N1#LYS") InParty("N1#LYS") !StateCheck("N1#LYS",CD_STATE_NOTVALID)~ THEN

~COPY_TRANS DELCIA 16~

END

 

Now, the script correctly work, she escapes the area.

But Korgan and Yoshimo who are in my test party didn't have their comments about Delcia behavior.

Is there a simple (or not so complex) solution to have my NPC make its comments as the others ?

 

P.S. : as you may have noticed from the code text, I'm a french-native speaker, and by the way, great forum.

Link to comment

You are doing things twice :rolleyes:

 

INTERJECT_COPY_TRANS2 DELCIA 16 LyssenCommentDelciaLeave //When Delcia leaves, Lyssen points out she would have eagerly killed her
== N1#LYSJ IF ~InMyArea("N1#LYS") InParty("N1#LYS") !StateCheck("N1#LYS",CD_STATE_NOTVALID)~ THEN
~Une vraie peste ! S'il y avait un contrat sur sa tête, je serais presque prête à l'honorer gratuitement...~
== N1#LYSJ IF ~InMyArea("N1#LYS") InParty("N1#LYS") !StateCheck("N1#LYS",CD_STATE_NOTVALID)~ THEN
~COPY_TRANS DELCIA 16~
END

 

~COPY_TRANS DELCIA 16~

(You don't want those tildes, either)

 

INTERJECT // break into the dialog

<<do something here>>

COPY_TRANS // send to an existing state

<<state>>

 

and

 

INTERJECT_COPY_TRANS

 

 

are related, but I_C_T already incorporates both actions. The safest way to do this is to use

 

INTERJECT_COPY_TRANS

<<something>>

END

 

into Delcia's dialog, and create Jastey's "Passback", or a single line of dialog assigned to Delcia that sends the actions back to Delcia.

 

So,

 

INTERJECT_COPY_TRANS DELCIA 16 LyssenCommentDelciaLeave //When Delcia leaves, Lyssen points out she would have eagerly killed her
== N1#LYSJ IF ~InMyArea("N1#LYS") InParty("N1#LYS") !StateCheck("N1#LYS",CD_STATE_NOTVALID)~ THEN
~Une vraie peste ! S'il y avait un contrat sur sa tête, je serais presque prête à l'honorer gratuitement...~
== DELCIA IF ~InMyArea("N1#LYS") InParty("N1#LYS") !StateCheck("N1#LYS",CD_STATE_NOTVALID)~ THEN
~Te-tois, chien.. auton que je sais, tu n'a parle vraiment.~
END

 

should do the trick, after you rewrite my horrible old French Canadian-learned Francais into something more palatable :mwaha:

 

Resources that might help -

 

SHS, K'aeloree lays all these out carefully: http://www.shsforums.net/index.php?showtopic=36995

 

I work through some possibilities in Aran, here - http://forums.gibberlings3.net/index.php?showtopic=16170

Link to comment

Thanks, I've looked your solution, it works. I don't even have to add a Delcia line since all Bioware NPC make their comment in a similar fashion as mine without an answer (and the only things that "give away" my NPC codingdifferent is the fact that after the dialog, if the player look at the log, he'll see that the journal was modified between my npc reaction and the bioware reaction, though there was no interruption during the dialogue flow).

Link to comment

Nevermind what the BioWare bunch do. They are already coded in place, and interjections behave slightly differently for mod-added NPCs.

 

You need a line for Delcia if there is an action in the line that cannot be performed by your character. For example, if the next line gives an action like EscapeArea(), your NPC is going to leave the area and never be heard from again. Needless to say, you won't like what happens if the next action is Kill(Myself).

 

Suppose this is the dialogue you want your NPC to interject into:

 

IF ~~ THEN BEGIN 12
SAY ~Nothing you say will help. I have already drank the poison.~
IF ~~ THEN REPLY ~Wait!~ DO ~Kill(Myself)~ EXIT
IF ~~ THEN REPLY ~I have an antidote!~ DO ~Kill(Myself)~ EXIT
END

 

If you don't have the original speaker say a line, your NPC is going to wind up dead on the floor. So you would do it like this, assuming the speaker's dialogue file is POISON:

 

INTERJECT_COPY_TRANS POISON 12
== MYNPC IF ~InParty("MyNPC") InMyArea("MyNPC") !StateCheck("MyNPC",CD_STATE_NOTVALID)~ ~That's "I have already drunk the poison."~
== POISON IF ~InParty("MyNPC") InMyArea("MyNPC") !StateCheck("MyNPC",CD_STATE_NOTVALID)~ ~My mistake.~
END

Link to comment

I see, but wouldn't INTERJECT_COPY_TRANS2 do the same job without having to add a Delcia line ?

 

While I'm on it, I've a little question. I'm obviously doing a Salvanas dialog since my npc is female. I used an append which I put at the end of my NPCJ file. But this new dialog then EXTERN to an INTERJECT which was prior in the same file (I felt that Interject was an easy way here to do things, because the dialog have a little number of lines). This didn't work, because of label errors, so I put the INTERJECT block just after my APPEND of Salvanas file. Now it works, but I wonder if it's the "correct" way to do it ?

 

in short in my N1#LYSJ.d, at the end i've :

APPEND SALVANAS //Obligatory Salvanas dialogue

IF ~!InPartySlot(LastTalkedToBy,0) Name("N1#LYS",LastTalkedToBy)~ N1#SalvanasLyssen

SAY ~Froide et solitaire, et pourtant d'une grande beauté, oh je suis déjà séduit par ce regard mortel que vous me lancez !~

END

END

 

INTERJECT SALVANAS N1#SalvanasLyssen LyssenSalvanas

blabladialog

END

 

I've thought of using CHAIN, but since it's not a banter, I didn't try.

 

Well after some experiments, I guess I should really use CHAIN (editnumber9999:yes it works !)

Link to comment

First of all, don't use INTERJECT unless you really and truly have absolutely no other choice. You will break other people's mods, and they will say bad things about you behind your back.

 

Here's the problem: INTERJECT takes the dialogue and takes it into whatever direction you want it to go, but you'll never see dialogue other mods use. It's not very courteous, but more than that, if the dialogue that never happens is critical to a quest, you broke it.

 

What you can do instead is use a CHAIN and give it a weight of -1 so it plays ahead of what Salvanas would usually say. Make sure that you use check variables so that your dialogue only plays once.

 

INTERJECT_COPY_TRANS2 will usually throw warnings on installation. If you don't mind your players writing in bug reports saying that your mod installed with warnings, go ahead and use it. Also, please be aware that you might break the game. Please see the discussion cmorgan linked. I wrote an explanation there about why you don't want to use I_C_T2, and I don't want to type it again.

 

Modders are usually very good about placing the actions in the linked states, not in the transitions, but the original game was not written to be modded. The actions often occur in the transition, and I_C_T2 can break these.

Link to comment

Archived

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

×
×
  • Create New...