Author Topic: NPC bashing placeable  (Read 546 times)

Legacy_Avalancho33

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
NPC bashing placeable
« on: September 13, 2011, 11:06:53 pm »


               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!
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
NPC bashing placeable
« Reply #1 on: September 13, 2011, 11:18:46 pm »


               post your script.
               
               

               
            

Legacy_Avalancho33

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
NPC bashing placeable
« Reply #2 on: September 13, 2011, 11:36:26 pm »


               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.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
NPC bashing placeable
« Reply #3 on: September 14, 2011, 12:50:34 am »


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

               
            

Legacy_Avalancho33

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
NPC bashing placeable
« Reply #4 on: September 14, 2011, 04:15:31 pm »


               Tested it last night, it worked.  Thanks a lot!
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
NPC bashing placeable
« Reply #5 on: September 14, 2011, 06:30:17 pm »


               

Lightfoot8 wrote...

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


Now that's sharp.. '<img'>