Author Topic: Making an NPC Leave if PC Leaves a Certain Area  (Read 1874 times)

Sleeta

  • Guest
Making an NPC Leave if PC Leaves a Certain Area
« on: November 24, 2004, 08:18:19 PM »
I really need to make up an account here.  I will, one of these days, when I'm not quite so lazy. *grin*

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?  I'm guessing it'd be by using Shadowkeeper or some such to find the variable I want and setting a trigger for that . . . but what would that trigger *be* exactly?

Thanks for any help.   :)

Offline Ashara

  • Tired
  • Planewalker
  • *****
  • Posts: 784
Re: Making an NPC Leave if PC Leaves a Certain Area
« Reply #1 on: November 24, 2004, 08:33:41 PM »
If you need an NPC to quit after leaving an area:

1) Set a Global in the override that describes that there is something a-foot
2) make a check of the area
3) Set another Global
4) Initiate Quitting dialogue/or Quit and do moving sequence in the dialogue file (or via script if she does not say anything)

ie your override BAF will say something like:

IF
InParty(Myself)
AreaCheck(FWXXXX")
Global("WeAreInAreaFWXXXX","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("WeAreInAreaFWXXXX","GLOBAL",1) //that will tell the game that we entered the zone where something is gonna happen
END

//now leaving itself:


IF
InParty(Myself)
!AreaCheck(FWXXXX")
Global("WeAreInAreaFWXXXX","GLOBAL",1)//these two indicate that you went into the area with the NPC and left it with the NPC
THEN
SetGlobal("WeAreInAreaFWXXXX","GLOBAL",2)
Dialogue(Player1) //that will start the dialogue after you had left the area with the NPC in the party
END

In XXXXJ.D file:

IF ~Global("WeAreInAreaFWXXXX","GLOBAL",2)~
SAY ~Hey, ya, <CHARNAME>, I am going BACK!~
IF ~~ THEN DO ~SetGlobal("WeAreInAreaFWXXXX","GLOBAL",3) LeaveParty() ActionOverride("NPCDeathVariable",LeaveAreaLUA("FWXXXX","",[x.y],3))~ EXIT
END

or any other moving mechanism (MoveGlobal etc)...


If the same vein, how would I make it so that the NPC would initiate dialogue and leave immediately after a certain quest was completed?  I'm guessing it'd be by using Shadowkeeper or some such to find the variable I want and setting a trigger for that . . . but what would that trigger *be* exactly?

The same way: find the Global that sets itself after finishing that Quest and do scriot that have IF condition that Global and sets a new Global for you, than initiates a dialogue; D file will have block depent on global ie...

IF
InParty(Myself)
Global("ThatQuestIsComplete","GLOBAL",1)
Global("NPCReactsOnQuest","GLOBAL",0)
THEN
RESPONSE #100
Global("NPCReactsOnQuest","GLOBAL",1)
Dialogue(Player1)
END

etc.

Hope that helps and mine recipy aren't the one for disaster :)
Hang in there. I'll try to make you glad you did.
—George R.R. Martin

There is nothing better than imagining other worlds [...] to forget the painful one we live in. At least so I thought then. I hadn't yet realized that, imagining other worlds, you end up changing this one.
-Umberto Eco, Baudolino

Three mods you shall make - one too bad and one to dread and one to love.

Sleeta

  • Guest
Re: Making an NPC Leave if PC Leaves a Certain Area
« Reply #2 on: November 24, 2004, 10:09:52 PM »
Thanks!  I'll give that a shot.  :)

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: