Aller au contenu

Photo

I can't make the daze effect or paralyze effect stick on these NPCs


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

#1
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I have an NPC that is scripted to simply walk from one location to another.  Here is the code

{
object oSelf=OBJECT_SELF;
AssignCommand(oSelf, ActionForceMoveToObject(oWPT, FALSE,300000.0);
}



The NPC walks on unerringly, even when I try to apply daze or paralyze effects to it.  I am making the effects temporary and applying them to the object via spellhook scripting. 

The NPC in question has all of its scripts removed to keep its behavior nice and simple. 

Can anyone think of why the paralyze and daze effects do not stop the NPC from moving?

#2
Dann-J

Dann-J
  • Members
  • 3 161 messages
I think the answer is in the word 'force' in the function name. :)
You might have more luck with ActionMoveToObject().

You'd be better off using standard walk waypoints, and a simple hearbeat script that triggers the NPCs to walk then only if they are not currently stunned/paralysed. Look at the default hearbeat script for creatures, and you'll see a condition that only makes them walk between waypoints if they're not in conversation or in sight of an enemy. You should be able to adapt that for your own purpose.

I recently created a very simply heartbeat script that causes an NPC to equip a torch at night, then unequip it again during the day. The problem was that with a custom HB script he wasn't returning to his single walk waypoint  if he got scared off by a hostile (he has the 'coward' spawn script in effect).  I had to add in the condition I mentioned above in order for him to go back to his position after running off like a little girl.

Modifié par DannJ, 08 novembre 2011 - 02:06 .


#3
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Thanks Dann, I didn't even think of the Force part. Thanks for the advice about the walkwaypoints too.