Jump to content

NPC follow player through door, automatically


Annie_Thorne237

Recommended Posts

Is it possible for an NPC to be scripted to follow the Player through any given door, by it's self?

How would this be done? Can it be done?

 

IF
ActionListEmpty()
Allegiance(Myself,PC)
!Range(Player1,14)
See(Player1)
THEN
RESPONSE #100
FollowObjectFormation(Player1,2,5)
SmallWait(1)

END

IF
!See(Player1)

THEN
RESPONSE #100
MoveToObjectFollow(Player1)
END

 

 

Lets the NPC follow across the map, but leaves the NPC to merely sit still upon the Player using (X) door and entering (X) area...

hm... any ideas?
:undecided:

 

Link to comment

Do you mean an openable door, or transition between areas?

 

If former... then not universally. You can check BG2EE Red Wizard Enclave, mercs and wizards there are scripted to open the doors blocking their way, and BG SoD Dragonspear Basement (BD4300) where, again people can get past a closed door. However, in both cases it is manual scripting, i.e. you'd need to know what the door's ID name is before scripting for it, and it also assumes you specify a certain path for actors to follow.

Alternatively, you can just open any NearestDoor(), but it still may make the character run back and forth until everything is flung open. It also won't always work in larger space, when there'd be no door within LoS and the actor would then attempt to pass through the nearest solid wall.

So, the general answer is no.

 

If between areas, then, assuming it's not a party member, MakeGlobal() it and then MoveGlobal() to Player1 from area's or baldur script, if not dead and not in the current area.

Link to comment

Original Baldur's Gate.

HM. Having marginal success by trying to store and restore party location, with check and blocks to stop from exploiting it like a "mob in my pocket"... also added a hot key to store party location and then have the scripted npcs hear the hotkey and appear... is there really no simple way to have a "toady" npc (partymember) follow the PC into and out of a store?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...