Jump to content

Make one NPC Ignore Another


Go to solution Solved by Ramikad,

Recommended Posts

Running into a problem.

 

I have a prisoner typing at a console but unfortunately there are stormtroopers around it. What happens is that the troopers will turn on the prisoner. They aren't supposed to. Is there any way I can get the stormtroopers to ignore the prisoner with scripting?

 

Link to comment

It's been a long time since I've done any scripting, but isn't it possible to flag the prisoner NPC as an 'enemy'? That way he'll appear friendly to the stormtrooper NPCs and then you can set 'notarget' on the prisoner as well so he will ignore you and not attack.

Link to comment

SET_NOTARGET will do just fine. It works on everything, NPC and Player.

affect ( "type1", /*@AFFECT_TYPE*/ FLUSH )
{

	task ( "type" )
	{
		set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_CONSOLE1" );
		set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 );
	}

	dowait ( "type" );
}

When I use the above script as it is my prisoner will type away forever. Once I put in the SET_NOTARGET in it I run into the problem. The prisoner types for a bit and then goes to an attack stance or whatever the default stance is for the npc. Where in this script is the correct place to put SET_NOTARGET?

Link to comment

Not completely sure, but I resolved this making the prisoner ignore enemies (SET_IGNOREENEMIES TRUE). I put both strings after SET_ANIM_HOLDTIME_BOTH -1.

 

Thanks for the help. It works great with the SET_NOTARGET & SET_IGNOREENEMIES put in the right spot. All the NPC does is type and ignore the world around it, which fits in well with my story... Thanks again.

Link to comment
  • 2 weeks later...

I have a similar question so i don't want to start a new topic.

Is there any way to force NPC to stop targeting at player if that NPC is agroed ,and make him return to his basic script ie. walking thru level and looking for enemies.

To clarify, i mean, MGS style enemy behavior.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...