Hello,
I am working on a line-of-sight stealth based singleplayer module. A big goal here is getting guards to patrol, and when they see the PC, they teleport the PC back to start.
Here's what I have so far:
void main()
{
int nEvent = GetUserDefinedEventNumber();
if (nEvent == 1002) // OnPerceive event
{
object oPC = GetLastPerceived();
float fCheck = GetDistanceToObject(oPC);
if(GetIsPC(oPC) && GetLastPerceptionSeen()&& (fCheck <= 8.0f) )
{
ClearAllActions();
ActionJumpToObject(oPC);
ActionStartConversation(oPC);
}
}
}
But, the orientation of the NPC does not seem to matter. Even if I run past behind them, I'll get sent to the start.
Is it somehow possible to get the NPC to only perceive the PC if they are also facing their general direction?
Thanks!
Modifié par Sturmdolch, 07 février 2011 - 11:27 .