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?
I can't make the daze effect or paralyze effect stick on these NPCs
Débuté par
M. Rieder
, nov. 07 2011 09:53
#1
Posté 07 novembre 2011 - 09:53
#2
Posté 08 novembre 2011 - 01:56
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.
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
Posté 08 novembre 2011 - 02:16
Thanks Dann, I didn't even think of the Force part. Thanks for the advice about the walkwaypoints too.





Retour en haut






