Npc killing npc

Hi,

I have a plugin 'personal animals' allows a pet to loot, kill on command.  Works fine with vanilla NPC's.  However when adding BetterNpc's , it does not damage those npc's.  I raised this with 'personal animals' creator and he tells me he does nothing with damage in plugin, so raise issue with BetterNPC .  They say TruePVE will overwrite damage and to ask about config for TruePVE, so here I'am can you please help if there is a config to allow npc to fight with BetterNpc types ?

Also I tried trace command, it does not register in the logs when pet attacks BetterNpc spawned entity.

Thank you

truepve doesn't block damage from animals or npcs by default

is there a setting that does that ? might be enabled in my config.

you can post your config but I doubt it.

{
  "Config Version": "2.1.3",
  "Default RuleSet": "default",
  "Configuration Options": {
    "handleDamage": true,
    "useZones": true,
    "Trace To Player Console": false,
    "Trace To Server Console": false,
    "Maximum Distance From Player To Trace": 0.0,
    "Prevent Water From Extinguishing BaseOven": false,
    "Prevent Players From Being Marked Hostile": false
  },
  "Mappings": {
    "default": "default"
  },
  "Schedule": {
    "enabled": false,
    "useRealtime": false,
    "broadcast": false,
    "entries": []
  },
  "RuleSets": [
    {
      "name": "default",
      "enabled": true,
      "defaultAllowDamage": true,
      "flags": "NpcsCanHurtAnything, HumanNPCDamage, LockedBoxesImmortal, LockedDoorsImmortal, PlayerSamSitesIgnorePlayers, TrapsIgnorePlayers, TurretsIgnorePlayers",
      "rules": [
        "anything can hurt dispensers",
        "anything can hurt resources",
        "anything can hurt barricades",
        "anything can hurt traps",
        "anything can hurt heli",
        "anything can hurt npcs",
        "anything can hurt players",
        "cars cannot hurt anything",
        "mini cannot hurt anything",
        "ch47 cannot hurt anything",
        "scrapheli cannot hurt anything",
        "players cannot hurt players",
        "players cannot hurt traps",
        "guards cannot hurt players",
        "fire cannot hurt players",
        "traps cannot hurt players",
        "highwalls cannot hurt players",
        "barricades cannot hurt players",
        "mini cannot hurt mini",
        "npcs can hurt players",
        "junkyard cannot hurt anything",
        "junkyard can hurt cars",
        "players cannot hurt tugboats",
        "heliturrets cannot hurt players"
      ]
    }
  ],
  "Entity Groups": [
    {
      "name": "barricades",
      "members": "Barricade, icewall, GraveYardFence",
      "exclusions": "barricade.concrete, barricade.sandbags, barricade.metal, barricade.stone, barricade.wood, barricade.woodwire"
    },
    {
      "name": "dispensers",
      "members": "BaseCorpse, HelicopterDebris, PlayerCorpse, NPCPlayerCorpse, HorseCorpse, SkyLantern",
      "exclusions": ""
    },
    {
      "name": "fire",
      "members": "FireBall, FlameExplosive, FlameThrower, BaseOven, FlameTurret, rocket_heli_napalm, napalm, oilfireball2",
      "exclusions": ""
    },
    {
      "name": "guards",
      "members": "bandit_guard, scientistpeacekeeper, sentry.scientist.static",
      "exclusions": ""
    },
    {
      "name": "heli",
      "members": "PatrolHelicopter",
      "exclusions": ""
    },
    {
      "name": "highwalls",
      "members": "SimpleBuildingBlock, wall.external.high.ice, gates.external.high.stone, gates.external.high.wood",
      "exclusions": ""
    },
    {
      "name": "ridablehorses",
      "members": "RidableHorse",
      "exclusions": ""
    },
    {
      "name": "cars",
      "members": "BasicCar, ModularCar, BaseModularVehicle, BaseVehicleModule, VehicleModuleEngine, VehicleModuleSeating, VehicleModuleStorage, VehicleModuleTaxi, ModularCarSeat",
      "exclusions": ""
    },
    {
      "name": "mini",
      "members": "minicopter.entity",
      "exclusions": ""
    },
    {
      "name": "scrapheli",
      "members": "ScrapTransportHelicopter",
      "exclusions": ""
    },
    {
      "name": "ch47",
      "members": "ch47.entity",
      "exclusions": ""
    },
    {
      "name": "npcs",
      "members": "ch47scientists.entity, BradleyAPC, CustomScientistNpc, ScarecrowNPC, HumanNPC, NPCPlayer, ScientistNPC, TunnelDweller, SimpleShark, UnderwaterDweller, ZombieNPC",
      "exclusions": ""
    },
    {
      "name": "players",
      "members": "BasePlayer, FrankensteinPet",
      "exclusions": ""
    },
    {
      "name": "resources",
      "members": "ResourceEntity, TreeEntity, OreResourceEntity, LootContainer",
      "exclusions": "hobobarrel.deployed"
    },
    {
      "name": "snowmobiles",
      "members": "snowmobile, tomahasnowmobile",
      "exclusions": ""
    },
    {
      "name": "traps",
      "members": "AutoTurret, BearTrap, FlameTurret, Landmine, GunTrap, ReactiveTarget, TeslaCoil, spikes.floor",
      "exclusions": ""
    },
    {
      "name": "junkyard",
      "members": "magnetcrane.entity, carshredder.entity",
      "exclusions": ""
    },
    {
      "name": "tugboats",
      "members": "Tugboat",
      "exclusions": ""
    },
    {
      "name": "heliturrets",
      "members": "turret_attackheli",
      "exclusions": ""
    }
  ],
  "Allow Killing Sleepers": false,
  "Allow Killing Sleepers (Ally Only)": false,
  "Allow Killing Sleepers (Authorization Only)": false,
  "Ignore Firework Damage": true,
  "Ignore Campfire Damage": false,
  "Ignore Ladder Damage": false,
  "Ignore Sleeping Bag Damage": false
}

Try this, work´s for me. Better Npc use scientistnpc_oilrig

{ "name": "npcs", "members": "ch47scientists.entity, BradleyAPC, HumanNPC, NPCPlayer, ScientistNPC, TunnelDweller, SimpleShark, UnderwaterDweller, Zombie, ZombieNPC, scientistnpc_oilrig, CustomScientistNPC, scientistnpc_heavy, ScarecrowNPC", "exclusions": "" },

omegablue

Try this, work´s for me. Better Npc use scientistnpc_oilrig

{ "name": "npcs", "members": "ch47scientists.entity, BradleyAPC, HumanNPC, NPCPlayer, ScientistNPC, TunnelDweller, SimpleShark, UnderwaterDweller, Zombie, ZombieNPC, scientistnpc_oilrig, CustomScientistNPC, scientistnpc_heavy, ScarecrowNPC", "exclusions": "" },

Tried that, the pet still does not damage the BetterNpc spawned npcs.  Does that work for you with the 'personal animals' plugin ? If so could you maybe dm your config ?

you should update TruePVE, and your trace is not enabled so tpve.trace won't print

"Trace To Player Console": true,
"Trace To Server Console": true,
"Maximum Distance From Player To Trace": 50.0,

you can try it again, but NpcsCanHurtAnything will allow the damage unless another plugin blocks it (OnEntityTakeDamage or CanEntityTakeDamage)

I can't tell you since I don't own that plugin.

ok , I did that and here are my logs 

When I attack an npc spawned by BetterNpc & when the wolf pet from personal animals attacks a vanilla npc

======================
==  STARTING TRACE  ==
==  16:15:29.18740  ==
======================
 From: BasePlayer, player
 To: CustomScientistNpc, scientistnpc_heavy
   No shared locations (empty location) - no exclusions
 No exclusion found - looking up RuleSet...
 Using RuleSet "default"
 Initiator or target is HumanNPC, with HumanNPCDamage flag set; allow and return

======================
==  STARTING TRACE  ==
==  16:17:30.50277  ==
======================
 From: Wolf, wolf
 To: ScientistNPC, scientistnpc_junkpile_pistol
   No shared locations (empty location) - no exclusions
 No exclusion found - looking up RuleSet...
 Using RuleSet "default"
 Initiator is NPC; flag set; allow damage and return
​
No logs are thrown when the wolf pet attacks a npc spawned by BetterNpc, so does this indicate TruePve can't detect the type so 1. it will allow damage 2. throw into the log ?

NpcSpawn is used by BetterNPC to spawn the npcs

NpcSpawn uses the CanEntityTakeDamage hook provided by TruePVE

it does not have a statement to allow damage from BaseNpc (your animals) so the damage is blocked

open NpcSpawn.cs and change line 2082 from:

return false;

to

return attacker is BaseNpc;

Unfortunately still does not work, and still not throwing in the trace logs.  What I don't get is the animal 'wolf' can damage vanilla npc's and that triggers the logs, but the betternpc do not ?  

Does the return need to be something other than BaseNpc ?

I don't know since I don't own that plugin

you can change it to return true; on line 2082 to rule that out

if that doesn't work then something else is still blocking the damage.

Sorry for the late response tried that, still no good. I used the /tpve_prod for the Npcs and here is what I got.
type= Oxide.Plugins.Npcspawn+CustomScientistNpc,
prefab=scientistnpc_heavy
do I need to do something with the type to get damage to work ?

that's already in the config. your trace shows that the damage is allowed. so it's likely not truepve.

you're right, I've found the issue in NpcSpawn plugin, now to just get the dev to help me resolve it.