Author Topic: Adding a New Reaction to an Old NPC  (Read 2923 times)

0 Members and 1 Guest are viewing this topic.

Offline Sir_Carnifex

  • Scourge of Kobolds
  • Modders
  • Level 1
  • *****
  • Posts: 200
  • Karma: +8/-0
  • Scourge of Kobolds
    • View Profile
Adding a New Reaction to an Old NPC
« on: August 23, 2012, 12:20:04 AM »
Okay, I know how I can put an interjection into an official NPCs conversation, and I know how to add additional player responses, but I was wondering about adding a line at the very beginning, then redirect the conversation back to where it originally would go, but bypass a couple lines (they don't make sense considering a certain condition) and replace them with slightly modified ones.   Would it be a simple use of APPEND ~NPC~ AddNewLine and then put a weight on it so it will always be selected assuming a certain variable is right? 

Okay, assume that doesn't work for some reason... would it also be possible to have an NPC interject his own line, and then add the PC responses to the interjection?  I'm trying to figure out the best way of going about this and minimize the amount I'd have to alter.   The less I have to change, the better.

And not quite related to the topic title, but since I'm already posting... If a creature is marked as dead, can you respawn that creature and keep using the old dialogue file?  Would that creature still be marked as dead? 



In progress - Armin Kasun - a mercenary NPC for BG2

On hold - Halbo NPC for BG2, the evil halfling thief, food critic, and party troublemaker

Offline Rhaella

  • Newbie
  • *
  • Posts: 12
  • Karma: +1/-0
    • View Profile
Re: Adding a New Reaction to an Old NPC
« Reply #1 on: August 23, 2012, 07:52:41 AM »
Okay, assume that doesn't work for some reason... would it also be possible to have an NPC interject his own line, and then add the PC responses to the interjection?  I'm trying to figure out the best way of going about this and minimize the amount I'd have to alter.   The less I have to change, the better.

INTERJECT NPCNAME ## interjectionname
== NPCNAME ~New line.~
END
++ ~PC response~ EXTERN NPCNAME ##
++ ~PC response~ EXTERN NPCNAME ##
++ ~PC response~ EXTERN NPCNAME ##

...should work in this situation, I think. I'd need to know exactly what you were trying to do to know for sure, though. Keep in mind that INTERJECT is discouraged since it can interfere with other mods and all, but sometimes there isn't much of a choice.

Can't help you with respawning dead CREs, though, except that I'd be very wary of trying something like that.

Offline Sir_Carnifex

  • Scourge of Kobolds
  • Modders
  • Level 1
  • *****
  • Posts: 200
  • Karma: +8/-0
  • Scourge of Kobolds
    • View Profile
Re: Adding a New Reaction to an Old NPC
« Reply #2 on: August 23, 2012, 10:43:45 AM »
Okay, assume that doesn't work for some reason... would it also be possible to have an NPC interject his own line, and then add the PC responses to the interjection?  I'm trying to figure out the best way of going about this and minimize the amount I'd have to alter.   The less I have to change, the better.

INTERJECT NPCNAME ## interjectionname
== NPCNAME ~New line.~
END
++ ~PC response~ EXTERN NPCNAME ##
++ ~PC response~ EXTERN NPCNAME ##
++ ~PC response~ EXTERN NPCNAME ##

...should work in this situation, I think. I'd need to know exactly what you were trying to do to know for sure, though. Keep in mind that INTERJECT is discouraged since it can interfere with other mods and all, but sometimes there isn't much of a choice.

Right.  I was pretty sure I could code it, it's just I've never seen (at least I don't think I have) an NPC interject his own dialogue.   If it works, then that MAY be the way to go.  What I am trying to do:  I need to alter three of the NPC responses very slightly, so that means I need to interject before that happens, put in the PC responses (they would be the same as before) that lead to the new NPC lines.  Any player responses to those lines would jump back to original dialogue.

Can't help you with respawning dead CREs, though, except that I'd be very wary of trying something like that.

I'm guessing it might be best to just make a duplicate CRE if respawing a dead one might break something.   I suppose it would be possibly to alter a current script to prevent the NPC from dying, but, again, the less altered, the better.
In progress - Armin Kasun - a mercenary NPC for BG2

On hold - Halbo NPC for BG2, the evil halfling thief, food critic, and party troublemaker

Offline Rhaella

  • Newbie
  • *
  • Posts: 12
  • Karma: +1/-0
    • View Profile
Re: Adding a New Reaction to an Old NPC
« Reply #3 on: August 23, 2012, 11:31:32 AM »
Hmm. If you PM me exactly what you're trying to do with the dialogue file, I can see if it should theoretically work.

As for interjecting into your own dialogue... yep, it happens. It's one way to get the Bodhinappings working, which is why I know about it. =)

Spawning a new CRE may well be the best choice there, yeah. It works with Imoen and Imoen2, after all.

Offline Sir_Carnifex

  • Scourge of Kobolds
  • Modders
  • Level 1
  • *****
  • Posts: 200
  • Karma: +8/-0
  • Scourge of Kobolds
    • View Profile
Re: Adding a New Reaction to an Old NPC
« Reply #4 on: August 23, 2012, 12:42:17 PM »
Actually, I think you've answered enough that I know that it IS theoretically possible.  Getting something started, and if THAT would work was the main problem.  I can redirect to something easily enough.  I've done that before with other interjections.   

I'm still wondering about the APPEND to the dialogue for the initial NPC line, but now that I think about it, the Crazy Celvin dialogues work like that, I think, right?

In progress - Armin Kasun - a mercenary NPC for BG2

On hold - Halbo NPC for BG2, the evil halfling thief, food critic, and party troublemaker