Make an NPC unresponsive

I have an NPC lying down (the animation proneB) and she, an old woman, is unconscious. When the PC clicks on her, a conversation starts. Here is the problem: When the PC clicks on her she turns towards the PC. I don’t want her to do that (she is unconscious after all).

I guess I could use a paralyze effect or death effect on her or something like that, but I’m afraid she will not be breathing then. That’s the nice thing now that she’s just lying down, that she breathes and is alive.

Is there some way to achieve this? My thought is to alter the script on OnSpawnIn or on OnConversation but I don’t know…

When I wanted to make a creature remain in a specific position, I set its local variable ‘NX2_NO_ORIENT_ON_DIALOG = 1’ and ran the following:

void IdleCreature( string nTag ) {
  object oCreature = GetObjectByTag( nTag );
  if ( GetIsObjectValid( oCreature ) ) {
    effect sStunned = SuperNaturalEvent( EffectStunned() );
    ApplyEffectToObject( DURATION_TYPE_PERFECT, eStunned, oCreature );
    SetBumpState( oCreature, BUMPSTATE_UNBUMPABLE );
    SetCommandable( FALSE, oCreature ); 
  }
}

Might be overkill in some respects.

2 Likes

Ok. So I put the NX2_NO_ORIENT_ON_DIALOG = 1 in the variables section of the character. Where do I put this other code? Like, do I put the code in the OnConversation script of the character, or maybe on the OnEnter on the area? I’m sorry if that’s a stupid question.

I just tried with just putting the NX2_NO_ORIENT_ON_DIALOG = 1 in the variables section of the character without doing the other code you posted, and that seemed to be enough as far as I can see.

1 Like

Hi,

The actual function to use is (if you prefer):

SetOrientOnDialog(oPC, FALSE);

That allows you to turn orientation on or off.

Cheers, Lance

//RWT-OEI 07/06/05
//This function makes it so that a creature’s orientation ( or facing ) won’t
//be set automatically during a dialog. This prevents a creature from
//turning to face a speaker, or a speaker from facing a listener.
//Passing in ‘TRUE’ re-enables the default behavior where speaker and listener
//will face each other on each dialog node
//Right now only works on creatures. If it needs to work on placeables, let
//me know.
void SetOrientOnDialog( object oCreature, int bActive );

IMPORTANT: NEVER leave this “on” on a PC or they will stop turning to face speakers, which may be an issue with the other issue you have posted and I have responded to.

Ah, I understand. If I make a small script I could use this in the beginning of a dialog if I don’t want to use NX2_NO_ORIENT_ON_DIALOG = 1 in the variables section of a character, I guess. Like this (or maybe one should use the stock script ga_lock_orientation and set sTarget to $PC?)?

void main(string sTarget)
{

object oPC=GetPCSpeaker();
object oTarget=GetNearestObjectByTag(sTarget,oPC);

AssignCommand(oTarget, SetOrientOnDialog(oPC, FALSE));

}

Hi andgalf,

That’s about it. :slight_smile:

Although I would use something other than “main” as it’s your own new function.

Cheers, Lance.

void FixOrientationOfTag(string sTarget);
void FixOrientationOfTag(string sTarget)
{

object oPC=GetPCSpeaker();
object oTarget=GetNearestObjectByTag(sTarget,oPC);

AssignCommand(oTarget, SetOrientOnDialog(oPC, FALSE));

}

Then call FixOrientationOfTag(sTagofObject), remembering to include this function either above the main or inside an include file.

Ok. I guess I could make it as a function instead…I just thought that if I just put this simple script with void main in the the first conversation node the NPC wouldn’t look at the PC. If I do it as a function I have to incorporate it into a new script (but of course then I could use it in other scripts in a simple way), but I don’t fully understand what I gain (other than that reason) to make it a function other than a whole new script in this instance.

As it is a conversation script, I would do it the way you originally said … I missed that point, and only did it the other way as that’s the usual way … Outside of conversation types.

Cheers, Lance