Jump to content

Coding interjections in a compatible way


jastey

Recommended Posts

From GV#DaveJ.d:

Spoiler

BEGIN GV#DAVEJ


//Thalantyr
INTERJECT ~%tutu_var%THALAN~ 1 GV#DAVEInterjectTHALAN1
== GV#DAVEJ IF ~InParty("GV#DAVE") InMyArea("GV#DAVE") !StateCheck("GV#DAVE",CD_STATE_NOTVALID)~ THEN
~It's not you, <CHARNAME>. I've knocked on his door once or twice before and he was exactly this grumpy every time. Probably cabin fever.~
END
  ++ ~Rumors talk of a powerful mage that lives out here. If it is you, I would like to speak with you.~ EXTERN %tutu_var%THALAN 2
  ++ ~I go where I wish and stay as long as I please. Don't threaten me.~ EXTERN %tutu_var%THALAN 3
  ++ ~I apologize for the intrusion, and will leave immediately.~ EXTERN %tutu_var%THALAN 4
  +~PartyHasItem("MISC49")~+ ~Well, it's rather amusing actually. You see, I happened to rescue this... um... talking chicken...~ DO
  ~TakePartyItem("MISC49")
  DestroyItem("MISC49")
  CreateCreature("MELICA",[286.398],8)
  ActionOverride("Melicamp",SetNumTimesTalkedTo(2))
  SetGlobal("LeftChicken","GLOBAL",1)~ EXTERN %tutu_var%THALAN 7
  +~GlobalGT("GV#DAVETalk","GLOBAL",6)~+ ~Are you aware there's a temple of Talos next door to you?~ EXTERN %tutu_var%THALAN GV#THALAN

GlamNPC Pack provides the expected original game reply options in written out form. Coding interjections this way makes your mod incompatible with all other mods adding to Thalantyr's dialogue. At least the first time Thalantyr is talked to, Dave will take over the conversation and all NPC/quest added interjections installed before the GlamNPC Pack will be skipped.

Firstoff, I am not sure why you use INTERJECT and not stick to I_C_T which would handle the interjection in a compatible manner by itself. EDIT: It's because of the added reply option, of course, see below for my comment.

If you need to use INTERJECT however, because you want to add own reply options for example, then instead of adding in the original reply options by hand, the way to do it is using COPY_TRANS instead. This way, you catch *all* existing reply options and other added interjections etc. that are present in the player's game at the time GlamNPC Pack is installed. (It also prevents the player of having outdated reply options instead of the actual ones - for example, in Thalatyr's dialogue there is also a trackig variable set in BG:EE which is missing in your mod).

Thus, the above script block should be changed to the following:

//Thalantyr
INTERJECT ~%tutu_var%THALAN~ 1 GV#DAVEInterjectTHALAN1
== GV#DAVEJ IF ~InParty("GV#DAVE") InMyArea("GV#DAVE") !StateCheck("GV#DAVE",CD_STATE_NOTVALID)~ THEN
~It's not you, <CHARNAME>. I've knocked on his door once or twice before and he was exactly this grumpy every time. Probably cabin fever.~
END
  COPY_TRANS ~%tutu_var%THALAN~ 1 //this adds all other reply options as they are in the player's game
  +~GlobalGT("GV#DAVETalk","GLOBAL",6)~+ ~Are you aware there's a temple of Talos next door to you?~ EXTERN %tutu_var%THALAN GV#THALAN

 

I didn't check the mod but this would apply to all other such instances using INTERJECT, of course.

 

Another note: done like this, the reply option about the Talos' Temple nearby will only show the first time Dave gives his interjection. If you want this to be present in later visits as well (because the player might not chose it the first time it's available), a combination of I_C_T for Dave's interjection and adding the reply option by EXTEND_BOTTOM might be preferable. EDIT: Oh, especially the reply option will be eaten by other interjections of NPC mods installed before GlamNPC Pack now that I think about it, because they will play first and then the original set of reply options will show, only.

Link to comment

Thanks very much, @Arthas!

I'm trying not to sound patronizing with these kind of tips... Highest level of compatibility is my goal between mods, because it's one of the things that makes the IE Modding so special! EDIT: And, because, you know - why not, if we have the possibilities for 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...