Aller au contenu

Photo

Paralyzing an NPC


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
3RavensMore

3RavensMore
  • Members
  • 703 messages

I want to have an NPC simulate sleep and not be able to be woken up.  So, what am I doing wrong?

 

            AssignCommand(oCreature, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 30000.0));
            DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneParalyze(), oCreature));
 

 

The first line work -- NPC is flat on back.  The second link doesn't do anything.  As soon as I click on the sleeping NPC, the NPC is rotated to face the PC and stands. 



#2
Proleric

Proleric
  • Members
  • 2 356 messages
I don't have access to examples right now, but I think you link the effect to VFX_DUR_FREEZE_ANIMATION then SetCommandable FALSE.

#3
3RavensMore

3RavensMore
  • Members
  • 703 messages

That fixes the standing when clicked issue.  The NPC still rotates (while flat on back) to face the PC.

 

Everything worked when I also added this bit of code to the NPC's OnConversation event:

    SetFacing(GetFacing(OBJECT_SELF));

 

I'm not sure why that worked, but it did. 

 

Thanks for your help!



#4
Proleric

Proleric
  • Members
  • 2 356 messages
The OnConversation event / BeginConversation initiates turning, but SetFacing cancels that immediately. IIRC another solution is to stop the OnConversation script when not commandable.