Garfield Posted January 1, 2007 Share Posted January 1, 2007 I have started to test my interjections in game and I have (of course) encountered some problems. Besides some interjections not showing up, I wanted to know a few things: -As INTERJECT_COPY_TRANS2 places the interjection after all the DOs, can my character still interject with and NPC after his dlg turned him into an enemy. (More precisely the beastmaster in the Copper Coronet: I want to add something after he says "Tabitha open the cages", but there he goes Enemy(). If you don't use INTERJECT_COPY_TRANS2, then *my* NPC will turn red will he? And if the beastmaster is turned red then my NPC cannot speak to him??? ) -If I want to give and objet to a character in an interjection (the Dryad Queen here): I used: ==VAELASA IF ~IsValidForPartyDialogue("YU#HAG")~THEN~Are you a... Yes your are. But I sense something strange about you, you are not like the others of your race... Your bond with Nature is pure and strong.~ = ~Let me give you this, you could need it. Fare thee well Yuan-Ti, and never forget your bond with Nature.~ DO ~GiveItemCreate("STAF08","YU#HA",1,1,0)~ END But it does not work (the dialogue triggers, but no object appears). Any problem noticeable in the coding?? Link to comment
berelinde Posted January 1, 2007 Share Posted January 1, 2007 Your example with the beastmaster was *made* for I_C_T2. I_C_T2 just means that the interjection won't transfer the action to the NPC. It does not mean that it happens after all the DOs. I'm stealing this from BG1 NPC Project, so I hope no one minds: INTERJECT_COPY_TRANS2 ~_THALAN~ 0 KivanThalantyr1 == ~_KIVANJ~ IF ~InParty("kivan") !Dead("kivan") !StateCheck("kivan",CD_STATE_NOTVALID) Global("KivWelcome","GLOBAL",0)~ THEN @50 == ~_THALAN~ IF ~InParty("kivan") !Dead("kivan") !StateCheck("kivan",CD_STATE_NOTVALID) Global("KivWelcome","GLOBAL",0)~ THEN @51 DO ~GiveItemCreate("X#KISPEA","kivan",1,0,0) SetGlobal("KivWelcome","GLOBAL",1)~ END This works. I know it works. Are you doing something similar? Incidentally, I'd stay away from IsValidForPartyDialog() because it doesn't always work. CamDawg has a wonderful custom state he made called !StateCheck("DV",CD_STATE_NOTVALID) that is really wonderful. Only thing is, you're going to have to have the game recognize it. Again, this is from BG1 NPC Project. Well, actually, it's from Gavin's tp2, because I happened to have it open at the time, but I got it from BG1 NPC first. You're going to want to put this in your tp2: /* STATE.IDS patching - borrowed from BG1 NPC Project and CamDawg */ /* adds custom IsValidForPartyDialogue state */ APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~ UNLESS ~CD_STATE_NOTVALID~ Link to comment
berelinde Posted January 1, 2007 Share Posted January 1, 2007 BTW: the code was for the interjection with the Dryad queen. And one more thing: you're going to want to add a global check for the gift giving. See Kivan's example. Link to comment
Domi Posted January 1, 2007 Share Posted January 1, 2007 DO ~GiveItemCreate("STAF08","YU#HA",1,1,0)~ What is your NPC's death variable? Did you per chance misspell it and it's YU#HAG (as in the first line), not YU#HA (as in the GiveItemCreate expression? Link to comment
cmorgan Posted January 1, 2007 Share Posted January 1, 2007 For the record n(and if it helps ), the current replacement for IfValidForPartyDialogue("dv") or IsValidForPartyDialogue("dv") is == ~_KIVANJ~ IF ~InParty("kivan") InMyArea("kivan") !StateCheck("kivan",CD_STATE_NOTVALID)~ CD_STATE_NOTVALID contains the STATE_DEAD trigger, so !Dead is redundant. InMyArea was deemed the most reliable way of making sure dialogue wasn't initiated with an NPC who is waiting outside, resulting in dropped dialogue; another variant used is See("dv") (which is an automatic InMyArea but fails if the NPC is out of range or invisible). We tend to initiate dialogues with the See("dv") trigger because some project folks feel that it is not correct behavior under invisibility to converse, but use the more open InMyArea("dv") to standardize dialogues in CHAIN and ICT across the whole project as a replacement for the following triggers: ~InParty("dv")~ ~IsValidForPartyDialogue("dv")~ ~IfValidForPartyDialogue("dv")~ I bet you made the same mistake I did with when to use the .cre file name and the death variable ("dv"): YU#HAG.cre may be assigned the "real name" as a dv, and many of the scripts use this for manipulating the .cre. For example, if I have assigned YU#HAG.cre the dv "Haggis", then CreateCreature("YU#HAG") is correct, but ActionOverride("Haggis",EscapeArea()) is needed. ~GiveItemCreate("STAF08","Haggis",1,1,0)~ Link to comment
berelinde Posted January 1, 2007 Share Posted January 1, 2007 Are you trying to name his NPC "haggis"? I got around the whole DV/CRE problem by using the same thing for both. Now, I know the difference, but it was easier to get my head around during that first month or two. Link to comment
Domi Posted January 1, 2007 Share Posted January 1, 2007 I'm pretty sure that his dv is "YU#HAG", because ~IsValidForPartyDialogue("YU#HAG")~ actually works, and text shows, but the item is not appearing in the inventory because he forgot "G" on the end. It's just a typo. Link to comment
cmorgan Posted January 1, 2007 Share Posted January 1, 2007 Yep - on a re-read, Domi is right -- (nope, just a smelly, awkward placeholder on the sheep intestines front, berelinde ) Link to comment
Garfield Posted January 1, 2007 Author Share Posted January 1, 2007 Yeah, Domi is right, this is a typo Well, I'll correct it right away and test it when I get rid of the hammer in mi head EDIT: both problem are solved. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.