INTERJECT, COPY_TRANS, I_C_T, CHAIN ..... Huh?
karnage
Member Posts: 92
I am still working on Hugh. I have put aside Vondo for now, as a Paladin must be much more vocal and opinionated about matters, leading to more dialoge, interjections, maybe even banter. He's on the back burner while I gain more experience.
I have Hugh joining, being kicked out, rejoining, behaving as I wish him to behave; now, to move on to the Tree of Life.
I have looked at several scripts and have questions. From one script to another, these methods are used for the dialogs:
* INTERJECT
* COPY_TRANS
* INTERJECT_COPY_TRANS
* CHAIN
Which method is best to ensure that the NPC will say their piece, and to make sure that the added dialog does not interfere with or remove/overwrite existing dialog from others?
I have Hugh joining, being kicked out, rejoining, behaving as I wish him to behave; now, to move on to the Tree of Life.
I have looked at several scripts and have questions. From one script to another, these methods are used for the dialogs:
* INTERJECT
* COPY_TRANS
* INTERJECT_COPY_TRANS
* CHAIN
Which method is best to ensure that the NPC will say their piece, and to make sure that the added dialog does not interfere with or remove/overwrite existing dialog from others?
0
Comments
You definitely don't want to use INTERJECT. The problem with INTERJECT is that it can basically prevent any other interjections from happening. Say someone was running your mod at the same time as they were running... I don't know, choose your favorite mod. Kelsey to Keto to who the heck ever, depending on someone's install order, INTERJECT could make their own Tree of Life dialog not trigger. This would be bad. Only use INTERJECT when you want your NPC to completely take over the conversation and not allow interjections from other mods or even the canon NPCs. The only common place in NPC mods where INTERJECT is used is when the player gets a bit of dizziness after their soul is taken out at the spellhold, because no one wants a case of every NPC in the party suddenly commenting on 's dizziness (though some people do I_C_T that one). I only am using it once in my mod, when my NPC completely loses it and attacks the party if they make a deal with a demon.
INTERJECT_COPY_TRANS can just be written as I_C_T to save you time, and it *could* work in this case. In practice, almost all your interjections will be coded by I_C_T. Use this for having your NPC put in a one or two liner about any situation in the game.
For Tree of Life, though, using CHAIN is probably the best as you'll be having player responses: generally, you don't want I_C_T's to have player responses in them. You'll then want to use COPY_TRANS to get back to the main dialog so everyone else can make their interjections.
So you'll want something like...
EXTEND_BOTTOM PLAYER1 33
If ~Inparty("MYNPC") and all that checks, remember to put a global check 0 here~ EXTERN PLAYER1 toldialog
CHAIN PLAYER1 toldialog
~MYNPC, the generic description. He glowers at you dubiously or does something of that sort.~
DO ~SetGlobal("theglobalyouchecked","GLOBAL",1)~
END
++ ~You don't need to fight with me.~ EXTERN MYNPCJ toldialog1
++ ~I need you to fight with me!~ EXTERN MYNPCJ toldialog1
(there is no END here in chains, which always gets me)
CHAIN MYNPCJ toldialog1
~I am totes going to fite with you because you are my BFF!~
END
COPY_TRANS PLAYER1 33 <-- don't forget that part. That gets you back to the ToL dialog, so <CHARNAME> can continue having interjections with everyone in their party.
Remember if he's romancable, you need two ToL dialogs.
IF ~~ t1
SAY ~Talk~
++ ~Option~ + talk1.1
END
type coding, you need to APPEND MYNPCJ. Likewise, if you already had an append before the chain, you need to put an extra END in to end the 'APPEND' before the chain will work. Some people get frustrated by that and just CHAIN all their dialogs, but I'm led to understand that's not the wisest idea.
The tutorial on COPY_TRANS in particular uses the "arrival in hell" dialogue as example, which is very similar to the Tree of Life dialog in that the interjections are triggered from the PLAYER1 dialog, and all party members have the opportunity to speak.
Homework, homework, homework, LoL.
I hope my future mods go (much) faster, LoL.
* COPY_TRANS
* INTERJECT_COPY_TRANS
* CHAIN
Okay, so I want Hugh to have his say here:
--------------------------------------------------
// Confronting Irenicus in /Spellhold
IF ~~ THEN BEGIN 35 // from:
SAY #45187 /* ~You tortured those here long before I arrived. I merely had more purpose to do it. Bah, I speak with madmen when I should be at my revenge!~ */
IF ~!IsValidForPartyDialog("Minsc")
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Imoen2")~ THEN GOTO 36
IF ~IsValidForPartyDialog("Minsc")~ THEN EXTERN ~MINSCJ~ 163
IF ~!IsValidForPartyDialog("Minsc")
IsValidForPartyDialog("Jaheira")~ THEN EXTERN ~JAHEIRAJ~ 460
IF ~!IsValidForPartyDialog("Minsc")
!IsValidForPartyDialog("Jaheira")
IsValidForPartyDialog("Imoen2")~ THEN EXTERN ~IMOEN2J~ 19
IF ~Global("ValySunaIrenicus","GLOBAL",0)
InParty("Valygar")
~ THEN DO ~SetGlobal("ValySunaIrenicus","GLOBAL",1)~ EXTERN ~VALYGARJ~ 144
END
--------------------------------------------------
(The file name is ppireni2.dlg)
(The state is 35)
(I want Hugh to say: So, we finally caught you with your pants down! Time to end this. Do you want my wrath before you give back what you took, or after?
--------------------------------------------------
Here is similar text from another .d file where a mod NPC gets their say:
I_C_T PPIRENI1 4 O#BranPPIRENI14
== O#BRANJ IF ~InParty("O#Bran") InMyArea("O#Bran") !StateCheck("O#Bran",CD_STATE_NOTVALID)~ THEN ~Explain it or not, 'tis a prison for mages, healthy and sane both. 'Tis simple enough for those that can see.~
END
--------------------------------------------------
So:
--------------------------------------------------
I_C_T PPIRENI2 35 zkwhughIrenAssylum
== zkwhughj IF ~InParty("zkwhugh") InMyArea("zkwhugh") !StateCheck("zkwhugh",CD_STATE_NOTVALID)~ THEN ~So, we finally caught you with your pants down! Time to end this. Do you want my wrath before you give back what you took, or after?~
END
--------------------------------------------------
Am I correct?
--------------------------------------------------
I tried it, and it didn't work. Hugh didn't speak up. Now, I pulled up a "saved game" and ran this through. Is that the problem? Would the dialog not happen because the game was already in process? If that is the case, though, why would I be able to test my other dialog by uninstalling/reinstalling the mod then pulling up a saved game and going?
--------------------------------------------------
Here is the edited block, decompiled after the mod install, ppireni2:
IF ~~ THEN BEGIN 35 // from:
SAY #45187 /* ~You tortured those here long before I arrived. I merely had more purpose to do it. Bah, I speak with madmen when I should be at my revenge!~ */
IF ~!IsValidForPartyDialog("Minsc")
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Imoen2")~ THEN GOTO 36
IF ~IsValidForPartyDialog("Minsc")~ THEN EXTERN ~MINSCJ~ 163
IF ~!IsValidForPartyDialog("Minsc")
IsValidForPartyDialog("Jaheira")~ THEN EXTERN ~JAHEIRAJ~ 460
IF ~!IsValidForPartyDialog("Minsc")
!IsValidForPartyDialog("Jaheira")
IsValidForPartyDialog("Imoen2")~ THEN EXTERN ~IMOEN2J~ 19
IF ~Global("ValySunaIrenicus","GLOBAL",0)
InParty("Valygar")
~ THEN DO ~SetGlobal("ValySunaIrenicus","GLOBAL",1)~ EXTERN ~VALYGARJ~ 144
IF ~Global("zkwhughppireni235","GLOBAL",0)
InParty("zkwhugh")
InMyArea("zkwhugh")
!StateCheck("zkwhugh",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("zkwhughppireni235","GLOBAL",1)~ EXTERN ~ZKWHUGHJ~ 1
END
--------------------------------------------------
Here is zkwhughj: State 1 (after installing mod):
IF ~~ THEN BEGIN 1 // from:
SAY #75874 /* ~So, we finally caught you with your pants down! Time to end this. Do you want my wrath before you give back what you took, or after?~ */
IF ~!IsValidForPartyDialog("Minsc")
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Imoen2")~ THEN EXTERN ~PPIRENI2~ 36
IF ~IsValidForPartyDialog("Minsc")~ THEN EXTERN ~MINSCJ~ 163
IF ~!IsValidForPartyDialog("Minsc")
IsValidForPartyDialog("Jaheira")~ THEN EXTERN ~JAHEIRAJ~ 460
IF ~!IsValidForPartyDialog("Minsc")
!IsValidForPartyDialog("Jaheira")
IsValidForPartyDialog("Imoen2")~ THEN EXTERN ~IMOEN2J~ 19
IF ~Global("ValySunaIrenicus","GLOBAL",0)
InParty("Valygar")
~ THEN DO ~SetGlobal("ValySunaIrenicus","GLOBAL",1)~ EXTERN ~VALYGARJ~ 144
END
-------------------------------------------------
NearInfinity also showed these triggers, each which would prevent Hugh from speaking in this case. Now, are these the triggers for him to speak, or the triggers to complete an action (extern, et) after speaking?
!IsValidForPartyDialog("Minsc")
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Imoen2")
Now, I pulled up a "saved game" and ran this through. Is that the problem? Would the dialog not happen because the game was already in process? If that is the case, though, why would I be able to test my other dialog by uninstalling/reinstalling the mod then pulling up a saved game and going?
Check that nothing is interfering with the listed trigger conditions:
IF ~Global("zkwhughppireni235","GLOBAL",0) InParty("zkwhugh") InMyArea("zkwhugh") !StateCheck("zkwhugh",CD_STATE_NOTVALID)~
If you mean everything under SAY in your in zkwhughj State 1, those are simply the original transitions COPY_TRANSed from the Irenicus dialog file. They can't interfere with your NPC speaking their lines, since they control what happens after that.Thanks, Liam, I'll check it out.
Dialog files usually aren't as picky, but just to be certain it's not a true bug of it not showing rather then saved games being stupid, try using a completely new save to test out your conditions. Yes, that's a pain in the butt for testing things like the spellhold (or even worse, the tree of life), but you can CLUA Console the right variables and checks to move yourself to the right area if necessary. Or, if you're like me, just CTRL+J plus CTRL+Y everything in sight.
Your code looks perfectly fine, and has everything in it to work properly, as prophet1 said. All of Irenicus dialog options eventually lead to phrase 35 (likely to give focus to the Imoen interaction). Other mods modify it no problem- in my game, it looks like Arath and Adrian are set to comment, as well as Unfinished Business Valygar having a remark about Suna. So everything should be fine. If it's not triggering for you in your game, do an uninstall, a reinstall, then restart from the beginning and get there and everything should be fine.
Global("zkwhughppireni235","GLOBAL",0)
~SetGlobal("zkwhughppireni235","GLOBAL",1)
Then, tests to see if it is 0:
Global("zkwhughppireni235","GLOBAL",0)
.... but the test for 0 comes, I think, before externing to Hugh, who then changes the variable to 1 ... that is to prevent looping, isn't it? So that the game doesn't get stuck with Hugh saying the same thing over and over again, hanging up the game?
The name of the file is "zkwHugh.cre".
Is that my problem? There is no character named zkwHugh, so the dialogs are bypassed?
Should it be:
IF ~Global("zkwhughppireni235","GLOBAL",0)
InParty("Hugh Smeed")
InMyArea("Hugh Smeed")
!StateCheck("Hugh Smeed",CD_STATE_NOTVALID)~