Aller au contenu

Photo

NPC bashing placeable


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

#1
Avalancho33

Avalancho33
  • Members
  • 3 messages
Hello,

I've been trying to generate some scripts to have NPCs bashing custom placeables when they are near them.  The idea is something similar to how NPCs react when they have a door blocking their way.

So far I've been able to get the NPCs attack the placeable object, but after only one attack, they just keep going.

Any suggestions on how to have them attack until the placeable object is destroyed?  Any help is appreciated.  Thanks!

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
post your script.

#3
Avalancho33

Avalancho33
  • Members
  • 3 messages
Right now I'm at work, I thought I had a copy of the script on this computer.

Basically, it works like this. I went with a script OnHeart running on the placeable that does the following:

Checks if there is a NPC within range using CheckEnemyGroupingOnTarget()
Loop through the NPCs using GetNearestCreature()
Use AssignCommand Clear all actions for the NPC
Use AssignCommand to ActionAttack the placeable.

It works for the first attack and then the NPC ignores the object and keeps moving.

I can post the script I have once I get home.

#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
#include "nw_i0_generic" at the top of your script then use DetermineCombatRound(oChest) instead of ActionAttack

#5
Avalancho33

Avalancho33
  • Members
  • 3 messages
Tested it last night, it worked. Thanks a lot!

#6
_Guile

_Guile
  • Members
  • 685 messages

Lightfoot8 wrote...

#include "nw_i0_generic" at the top of your script then use DetermineCombatRound(oChest) instead of ActionAttack


Now that's sharp.. :D