Jump to content


Photo

Making an NPC Leave . . .


  • Please log in to reply
2 replies to this topic

#1 Sleeta

Sleeta
  • Member
  • 139 posts

Posted 24 November 2004 - 05:34 PM

Let's say I have an NPC who will only remain in the party if you stay in a certain area, and would leave if you left that area?  IE, would initiate his or her parting dialogue and return to the specified area.  How would I handle that?  

In the same vein, how would I make it so that the NPC would initiate dialogue and leave immediately after a certain quest was completed?  

Thanks for any help.  :)
"It's always somethin' . . . 'Phenalope, check for traps.' 'Phenalope, open this here lock and get us the treasures.' 'Phenalope, my destiny's too hard, gimmie an ale and sing me a jaunty tune . . . ' "
Phenalope - When you just need a hug or a hamstring cut. A Baldur's Gate 2 NPC Friendship Mod. Because not everyone wants to get into your heroic britches.

"I was like a poor sinner who'd just found out he'd got to heaven after all."
~ Preacher

#2 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 26 November 2004 - 03:15 PM

It is easy to make her initiate dialogue after a quest. Just be sure that during that quest you set a variable, say QuestDone or whatever. Then have the NPC's . baf check for that variable, triggering an interjection if it that variable exists. Like this:

IF
Global("QuestDone","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("QuestDone","GLOBAL",2)
StartDialogueNoSet(Player1)
END

And in her J file you would have this:

IF ~Global("QuestDone","GLOBAL",2)~ THEN BEGIN QuestDoneChat
SAY ~I'm really glad our quest is done.~
IF ~ DO~ SetGlobal("QuestDone","GLOBAL",3)~
EXIT
END

Or something like that.

For the other, you can script in an area check in her .baf, something like:

IF
!AreaCheck("ARxxxx")
THEN
RESPONSE #100
LeaveParty()
END

This would just cause her to stand around, or worse, trigger her standard booted dialogue, but you could put extra dialogue in her P file to cover this contingency.

Sorry about the vagueness, but my computer is being a pain, and I have to go bake 17 pies.

Sillara

Edit: Yes, SConrad is right. It is easier to do it via the dialogue script, the J file for preference. Use that code! ;)

Edited by Sillara of the Tamari, 27 November 2004 - 02:02 AM.

Check out my RPG forum!

#3 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 26 November 2004 - 03:31 PM

For the other, you can script in an area check in her .baf, something like:

IF
!AreaCheck("ARxxxx")
THEN
RESPONSE #100
LeaveParty()
END

This would just cause her to stand around, or worse, trigger her standard booted dialogue, but you could put extra dialogue in her P file to cover this contingency.

If you wanted him/her to initiate a dialogue, I would rather do this:

IF
!AreaCheck("ARxxxx")
THEN
RESPONSE #100
StartDialogNoSet(Player1)
END

and then have the LeaveParty() in the dialogue. It's safer, smarter and easier.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner