How do I interject after the Charname responds? (WeiDU question)
BCaesar
Member Posts: 480
Ok I have a question. I'm trying to get my feet wet on modifying dialogue. I want Mazzy to interject when the Charname talks to Lady Delcia Caan. I can do:
INTERJECT_COPY_TRANS DELCIA 11 _BMazzyDelcia
== MAZZYJ IF ~InParty ("Mazzy") IsValidForPartyDialogue ("Mazzy")~ THEN
~This woman may be unpleasant, but you will not murder her. I will not allow it!~
END
And that works, but what I actually want is for Mazzy to interject after one of CN's two responses (Response 37 in Delcia.dlg), and I can't figure out how to do that.
Alternately I could interject after DELCIA 9 but that doesn't seem to work because there Delcia's text is immediately followed by her turning hostile and the conversation ending.
Any help is appreciated.
Thanks.
INTERJECT_COPY_TRANS DELCIA 11 _BMazzyDelcia
== MAZZYJ IF ~InParty ("Mazzy") IsValidForPartyDialogue ("Mazzy")~ THEN
~This woman may be unpleasant, but you will not murder her. I will not allow it!~
END
And that works, but what I actually want is for Mazzy to interject after one of CN's two responses (Response 37 in Delcia.dlg), and I can't figure out how to do that.
Alternately I could interject after DELCIA 9 but that doesn't seem to work because there Delcia's text is immediately followed by her turning hostile and the conversation ending.
Any help is appreciated.
Thanks.
0
Comments
Since you want Mazzy to be in the group, you'll have to add the InParty("Mazzy")... check in the existing TRIGGER.
Typically, in order not to ban the existing reply, which may have no condition, in case Mazzy is not in the group, you'll probably have to alter the existing reply trigger to check for Mazzy not being in the group, and you'll have add a new reply with the InParty check and the same text reply so that only one of the two reply will appear depending on whether Mazzy is there or not.
This is quite common if you look at official NPCs interjection.
And that should create a delcia.d file, but all I get instead are more options.
So what's the easiest way to read the DLG files already in game and see how they do things and where everything is? How do you do it?
I can see the files using Near Infinity but the format is different so it's not as helpful in showing me how to mod things in my D files.
Thanks.
Thanks.
When I mentionned something common, I was refering to multiple replies that have conditions based on "someone is in the group" and testing different characters while keeping the same text. But this how the game allows a character to interject after an NPC line, not after the player's answer.
I found examples of ALTER_TRANS in BG1 NPC and BG2 Fixpack. I didn't have a wide range of mods to check for. The example in BG1 NPC is not covering the case you're interested, however it will give you an example. On the contrary, I found an example of using ALTER_TRANS for EPILOGUE in BG2 Fixpack. However, since the mod is for BG II, not BG2EE, and the purpose is to fix a bug that is probably already fixed in BG2EE, you may not be able to study the starting point in the dialog it tries to patch unless you have BG II.
Note: I used a file search with a pattern to look for ALTER_TRANS in the files. I don't like the way the Windows explorer operates and I'm not sure you can use it for that purpose. I would recommend a free tool called Agent Ransack for that purpose. I mean, if you use Windows. Otherwise grep is your friend.
To your question to ALTER_TRANS: With this, you would only change the trigger of the original PC replies so they only show in case your NPC is not present. Then, you'd have to add the new PC replies with the check for your NPC and the transition to the NPC reaction with e.g. EXTEND_BOTTOM to the dialogue state you want to address.
Example: I take a random dialogue state from BANOMEN.dlg. for a fictitious NPC mod "MyNPC". Now, I want "MyNPC" to interject directly after the PC said: ~Are you calling me weak-willed?~
So, I want the original dialogue state to change into this: To achieve this, I would have to add the trigger to the reply option no 1 (for reply options and transactions, count starts with "0" from the top to bottom), and add the new reply option with the new transition. This is done inside a .d-file which gets compiled via the tp2:
ALTER_TRANS BANOMEN // file name BEGIN 13 END // state number (can be more than one) BEGIN 1 END // transition number (can be more than one) BEGIN // list of changes, see below for flags "TRIGGER" ~OR(3) !See("MyNPC") !InParty("MyNPC") StateCheck("MyNPC",CD_STATE_NOTVALID)~ END EXTEND_BOTTOM BANOMEN 13 + ~See("MyNPC") InParty("MyNPC") !StateCheck("MyNPC",CD_STATE_NOTVALID)~ +#8190 /* ~Are you calling me weak-willed?~ */ EXTERN MyNPC anomen_reaction END
(I didn't test this but this should be the correct code.)
As I said, please don't do that. :-)
Anyway, here's what I have now:
Anyway, my goal in this case is to do three things. These things are going to be damaging to the conversation since that's the point, but I would like them to damage as little as possible.
So 1) Mazzy redirects the conversation away from looting when the PC goes in that direction.
2) Mazzy intervenes if the PC chooses to attack Delcia in State 11, response 2 and forces the conversation to continue instead.
3) Same as #2 but happens if the PC chooses to attack Delcia in state 14, response 2.
And #2 and #3 both lead to the same place (Delcia state 12).
Now I could have Mazzy just complain and turn hostile instead using a trigger, but I'd rather go with a non-violent dialogue solution, especially since logically if I make her complain and turn hostile I'm going to make the rest of the good NPC's complain and turn hostile, and that breaks all kinds of things too.
Now in this particular case, I don't know what other mod interactions this could be messing up unless someone has some sort of Delcia expansion mod, but as I said I would like to be as gentle as possible in my destructive re-arranging of the conversation (this is already more gentle than having her INTERJECT all three times which is what I had before). Any suggestions?
On a side note: I do understand the urge to let your NPC take over some the decisions. I wrote an Ajantis NPC mod and he is not only a paladin, but also a paladin of Helm and rather black-white sighted, so I am guilty of some INTERJECTs myself. But keep in mind that you take the decision away from the player and I can also tell you that this is not well recepted by some.
For your idea, and I do understand your notion, the least obtrusive way of doing so imho would be:
-I_C_T into state 0 with Mazzy saying something that makes it clear that she will not tolerate any hostile action towards Lady Delcia (or something like "This lady's perception of the situation seems to be off if she can't tell friend from intruder. We should talk to her carefully and not weigh her wording too much".)
-INTERJECT into state 9 with Mazzy's line "CHARNAME, put down your weapon! My Lady, I think it would be best if you were to leave right now. You are free to go.", replacing the hostile reaction and dying of Lady Delcia with a transition to state 12.
-Let Mazzy start a dialogue after it ended where she asks the PC wtf this was about. Let the player have the choice to ask her wtf her interjection was about. :-)
That is one of the reasons why I tend to let the player make their decisions first and have my NPC react to the result. It's sometimes the only way you can be sure the intended reaction shows.
(In case it's not obvious: I am more of a dogmatist. 'There is no mod that does that, yet' is no reason for me not to consider possible conflicts.)
But then I still have what to do if Charname decides to attack Delcia. What do you do for your Paladin NPC mod if the player does something really chaotic evil, something like killing off Delcia (something for which there are other parts of the game where if you choose something like that some of the good NPC's will attack you)?
I totally get what you're saying, and I do want to make things as compatible as possible. Especially because I'm making it with Ratatoskr and she both has a huge number of mods installed (so she is big on insisting on compatibility) and because she hates if I remove any of her choices, so she's exactly the type of player you're talking about who this would make unhappy.
Also on a related note, I once read a guide on how to add a counter variable which one could then use to check how an NPC feels about Charname, and now I can't find the guide. Would you happen to know anything about that? It seemed similar to what you did with tracking the evil decisions of a PC.
If you are interested, I listed the reactions of Ajantis in my mod in documentation{ajantis_reactions.txt:
-If the PC makes a deal with Firkraag to betray Lord Windspear (Keldorn)
-If PC gives eggs of silver dragon to the deamon (Keldorn)
-If PC attacks Drizzt (Keldorn)
-IF PC attacks the Snirvlebi (Keldorn)
-If PC's reputation falls below 8
-If PC made more than 5 bad decisions (from Ajantis' sight)
-if PC wears or let a party member wear the finished skin armour
-if the PC poisons the druid grove
-if PC denials Hendak and the other slaves in the Copper Coronet help
-If PC wants to feed the drow slaves to the spiders, and has rep < 12
-if PC sais he will chase the drow slaves
-PC hands over Valygar to the hidden mages (Valygar in the group)
Ajantis turns hostile after joining, if
-If the PC made a deal with Firkraag to betray Lord Windspear (Ajantis will know)
-if PC holds Lady Elgea for ransom upon Ajantis' joining
-If PC's reputation falls / is below 8
Ajantis leaves the group and returns to the Order, if
-PC agrees to steal for Mae'Var (not for engaged romance, new beginnings romance ends)
-if the PC steals for Mae'Var (Ajantis gave no first warning (non-romance case))
Ajantis leaves forever
-if the PC steals for Mae'Var and does not stop / did not leave Ajantis out of the party after Ajantis gave his first warning (non-romance case)
-if the PC brakes Ajantis romance after the marriage
-PC was kicked out of the Order stronghold after failing her duties
-PC was kicked out of church of Helm after failing her duties
-PC tells Tolgerias were he can find Valygar (Valygar not in the group) (Keldorn, Mazzy)
-If PC sides with Bodhi (Mazzy)
Ajantis interjects (meaning the bad, bad INTERJECT coding)
-If PC wants to feed the drow slaves to the spiders, if Keldorn or Mazzy are not in the party or unable to speak. (Keldorn, Mazzy)
-if PC doesn't intend to let lady Elgea free, if Keldorn or Mazzy aren't in the party or unable to speak. (Mazzy)
-if PC doesn't intend to let Mazzy free, and Keldorn or Valygar aren't in the party or unable to speak. (Keldorn, Valygar)
Ajantis thinks it's a bad decision, if
-PC accepts thief stronghold
-PC accepts Mae'Vars' quests
-PC actually steals for Mae'Var
-if rep falls below 10
-PC made evil choices in hell trials
-If PC wants to feed the drow slaves to the spiders, and has rep > 11
-PC didn't want to set Lady Elgea free
-if PC gave bad advice to Anomen after his sister's death
-if PC lies to Sir Sarles
-if PC rejects a place in the temple of Helm, if her god is Helm (Kit(Player1,GODHELM))
-if PC accepts a place in the Church of Lathander if he/she is a believer in Helm (Kit(Player1,GODHELM))
-if PC accepts a place in the Church of Thalos
-if PC doesn't want to free Mazzy
-PC spares Llynis live (murderer of little Wellin)
-PC doesn't want to help little Wellyn
Ajantis think it's a good decision, if (i.e., bad decision counting goes down again):
-reputation goes above 17
-repuation reaches 20
-PC made only good choices in hell
-PC freed the drow slaves
-PC freed Lady Elgea
-PC gave good advice to Anomen after his sister's death
-PC helps little Wellyn
-PC does not side with Bodhi
-PC refuses to make a deal with Renal
-PC refuses to make a deal with Bodhi
-PC asks Drizzt for help against Bodhi
-PC accepts Helm cleric stronghold
-PC joins the Order of the Radiant Heart
-PC does not tell the mages where they can find Valygar / does not hand over Valygar to Tolgerias
Romance (both paths) will end, if
-Ajantis turns hostile
-Ajantis leaves forever
-PC accepts thief stronghold
-PC steals for Mae'Var (Ajantis gives warnings)
-PC made evil choices in hell trials
-PC sides with Bodhi
Ajantis' new beginnings romance will end, if
-Ajantis warns PC after 4 bad decisions
-Ajantis leaves the group because of wrong PC decision
All in all the coding of Ajantis is a mess so it's not easy to take it as an example (and the comments are in German so I don't think it well help you much).. But in general I did what I suggested above: Did an ADD_TRANS_ACTION (A_T_A) to the transitions / reply options I wanted to track, and then either triggered an I_C_T in the dialogue if appropriate directly (with comment / hostile leave) or an extra dialogue afterwards if Ajantis had an urge to talk more about it. In cases where there was no reply option, I also added script triggers (e.g. checking for a "sudden death" or hostility of some characters if the player attacked without talking...) For Ajantis I took example on Keldorn's reactions I guess that's why I left out Lady Delcia (although I added a lot more reactions since Ajantis is so much more law-obiding than Keldorn).
Btw for Lady Elgea, that lady who is held ransom in BGII, Keldorn and Mazzy also interject into the player's decision and let her free (so Ajantis does that, too.), so the original NPC crew is not completely innocent in this regard and players do have to expect own NPC decisions (I guess you already know, Mazzy says "Ignore CHARNAME, good lady. Sometimes PRO_HESHE is as uncouth as a drunken dwarf, I think. I shall free you... I trust you have not been injured?", *snicker*) EDIT: That's why I think making her interject for Lady Delcia is surely in-character for her.
I figure I can have Mazzy speak up about the PC talking about looting the castle as an I_C_T, and I can figure out some sort of point system for her both for romance and/or leaving the party, though how we'll factor reputation and/or charisma into that we haven't figure out yet. I can always put the dialogue in now and worry about the points later.
And then I'll have her turn hostile if you choose to kill Delcia.
Maybe I can use the trigger Allegiance to make something trigger anytime Mazzy becomes Charname's enemy and then use that to have other people interject and turn into enemies as well (for example Keldorn or Minsc). That way I don't have to write a new script for other NPC's joining her every time Mazzy goes hostile. I'll have to look over the IESDP and the in-game triggers and see what works.
{0x400B Allegiance(O:Object*,I:Allegience*EA)
Returns true only if the Enemy/Ally status of the specified object matches that in the second parameter.}
I never did find it when I was looking for it, but I eventually found it while looking for a different guide.
And I ended with my code looking like this: And then the MazzyHostile 1 trigger triggers Mazzy leaving and attacking you, some NPC's commenting and joining her, some NPC's commenting and leaving the party and refusing to fight either way, and some NPC's commenting and happily helping you fight Mazzy.
I'm going to see if I can get it to trigger all the X scripts (MazzyX, AerieX, etc.) since those don't seem to actually work just when someone becomes hostile.