Author Topic: Paralyzing an NPC  (Read 552 times)

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Paralyzing an NPC
« on: March 26, 2015, 04:17:23 pm »


               

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. 



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Paralyzing an NPC
« Reply #1 on: March 26, 2015, 05:18:53 pm »


               I don't have access to examples right now, but I think you link the effect to VFX_DUR_FREEZE_ANIMATION then SetCommandable FALSE.
               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Paralyzing an NPC
« Reply #2 on: March 26, 2015, 05:58:44 pm »


               

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!



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Paralyzing an NPC
« Reply #3 on: March 26, 2015, 08:26:58 pm »


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