Help Required
  • AuthorizedDamage - Allows players to damage entities they own or have cupboard authorization over
So you either must own it, or not be building blocked

  • AuthorizedDamageRequiresOwnership - Changes AuthorizedDamage flag to also require ownership

Also requires that you own it. If no one owns it then it can't have an ownership and this flag excludes it. I could remove the no owner check... but that would potentially break something else

You will have to use trial and error for your fire rules to configure them to your liking. 

fire can hurt guards
fire can hurt dispensers
fire cannot hurt traps
fire cannot hurt players
fire cannot hurt samsites

If it says CAN hurt then members can hurt it, but exclusions cannot
If it says CANNOT hurt then members cannot hurt it, but exclusions can

Yeah I thought this about fire, but it just doesn't seem to want to work. I have set it up exactly how I want it with the correct shortnames using trace too... I'm really confused. Also about removing the owner check, if you tell me how to do it I can do it from my end to see if it works and breaks anything else

Merged post

So I blew up a minicopter and the flames from the minicopter were dealing damage to buildings. I decided to turn on the trace to see what it was and it's 'fireball' which I already have setup in my config, but it just isn't working how I set it out.

======================
==  STARTING TRACE  ==
==  23:53:26.95521  ==
======================
 From: FireBall, fireball
 To: BuildingBlock, foundation
  Checking exclusions between [45771961] and [45771961]
   Shared locations: 45771961
   No shared locations, or no matching exclusion mapping - no exclusions)
 No exclusion found - looking up RuleSet...
  Beginning RuleSet lookup for [45771961] and [45771961]
   Shared locations: 45771961
   Found 1 location names, with 1 mapped RuleSets
   Found RuleSet: pve
 Using RuleSet "pve"
 No match in pre-checks; evaluating RuleSet rules...
  Initator EntityGroup matches: fire
  Target EntityGroup matches: none
   Evaluating Rules...
    Checking direct initiator->target rules...
    No direct match rules found; continuing...
     Evaluating "fire->any"...
      Match found; allow damage? False​
{
      "name": "pve",
      "enabled": true,
      "defaultAllowDamage": false,
      "flags": "HumanNPCDamage, LockedBoxesImmortal, LockedDoorsImmortal, AuthorizedDamageRequiresOwnership, AuthorizedDamage, SelfDamage",
      "rules": [
        "anything can hurt dispensers",
        "anything can hurt players",
        "players cannot hurt players",
        "anything can hurt traps",
        "anything can hurt samsites",
        "samsites cannot hurt players",
        "traps cannot hurt players",
        "players cannot hurt traps",
        "players cannot hurt samsites",
        "players cannot hurt barricades",
        "players cannot hurt mini",
        "players cannot hurt cars",
        "players cannot hurt scrapheli",
        "players cannot hurt ridablehorses",
        "barricades can hurt players",
        "highwalls can hurt players",
        "heli can hurt everything",
        "anything can hurt heli",
        "anything can hurt mini",
        "anything can hurt scrapheli",
        "anything can hurt cars",
        "anything can hurt ch47",
        "anything can hurt ridablehorses",
		"fire cannot hurt anything",
        "fire can hurt dispensers",
        "fire can hurt guards",
        "fire cannot hurt players",
		"fire cannot hurt samsites",
		"fire cannot hurt traps",
        "anything can hurt resources",
        "npcs can hurt players"
      ]
    }
  ],
  "Allow Killing Sleepers": false,
  "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, NPCPlayerCorpse, HorseCorpse, PlayerCorpse",
      "exclusions": ""
    },
    {
      "name": "fire",
      "members": "FireBall, fireball_small, fireball_small_arrow, fireball_small_shotgun, riflebullet_fire, rocket_fire, flamethrower_fireball, flameturret_fireball",
      "exclusions": "FlameExplosive, rocket_heli_napalm, Napalm, oilfireball2, FlameThrower, BaseOven"
    },
if (ruleSet.HasFlag(RuleFlags.AuthorizedDamageRequiresOwnership) && entity.OwnerID.IsSteamId() && entity.OwnerID != attacker.userID)

to

if (ruleSet.HasFlag(RuleFlags.AuthorizedDamageRequiresOwnership) && entity.OwnerID != attacker.userID)

fire has always been an issue. I would have to try doing this myself in order to figure out why it isn't working.

That works! I can't damage vehicles anymore. I can't see any issues as of yet. Yeah fire certainly needs a looking at.

Merged post

Just to let you know it seems that entity ownership thing I changed in the cs file actually did break a few things. Patrol Helicopters seemed to be invulnerable and also once you killed animals you couldn't damage the carcass. Understandable though. It actually seems like vehicles still work okay too! I have a vehicle claim plugin on my server so that might be why.

Merged post

Yeah the Vehicle Claim Plugin is certainly affecting this. It seems like a player can damage any vehicle. Is there any bit of code I could add to TruePVE or VehicleClaim to reduce this to only vehicle owners?

Merged post

I was just given this by the developer of the Vehicle Claim Plugin. Anyway I could incorporate this into my TruePVE cs file? https://umod.org/community/claim-vehicle-ownership/31417-damage-question?page=1#post-2

Merged post

Just saw the update! Nice job thanks for this change :) Only issue is Modular Cars is invincible whether you own them or not. But it works on everything else.

Merged post

Do you have any idea why I can't damage MiniCopters?

{
      "name": "pve",
      "enabled": true,
      "defaultAllowDamage": false,
      "flags": "HumanNPCDamage, LockedBoxesImmortal, LockedDoorsImmortal, AuthorizedDamageRequiresOwnership, AuthorizedDamage, SelfDamage",
      "rules": [
        "anything can hurt dispensers",
        "anything can hurt players",
        "players cannot hurt players",
        "anything can hurt traps",
        "anything can hurt samsites",
        "samsites cannot hurt players",
        "traps cannot hurt players",
        "players cannot hurt traps",
        "players cannot hurt samsites",
        "players cannot hurt barricades",
		"players can hurt heli",
		"players can hurt mini",
		"players can hurt scrapheli",
		"players can hurt cars",
		"players can hurt ridablehorses",
		"players can hurt ch47",
		"players can hurt npcs",
        "barricades can hurt players",
        "highwalls can hurt players",
        "heli can hurt everything",
        "anything can hurt heli",
        "anything can hurt mini",
        "anything can hurt scrapheli",
        "anything can hurt cars",
        "anything can hurt ch47",
        "anything can hurt ridablehorses",
		"anything can hurt npcs",
        "fire cannot hurt anything",
        "fire can hurt dispensers",
        "fire can hurt guards",
        "fire cannot hurt players",
        "fire cannot hurt samsites",
        "fire cannot hurt traps",
        "anything can hurt resources",
        "npcs can hurt everything"
      ]
    }
  ],
  "Allow Killing Sleepers": false,
  "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, NPCPlayerCorpse, HorseCorpse, PlayerCorpse",
      "exclusions": ""
    },
    {
      "name": "fire",
      "members": "FireBall, fireball_small, fireball_small_arrow, fireball_small_shotgun, riflebullet_fire, rocket_fire, flamethrower_fireball, flameturret_fireball",
      "exclusions": "FlameExplosive, rocket_heli_napalm, Napalm, oilfireball2, FlameThrower, BaseOven"
    },
    {
      "name": "guards",
      "members": "bandit_guard, scientistpeacekeeper, sentry.scientist.static",
      "exclusions": ""
    },
    {
      "name": "heli",
      "members": "BaseHelicopter",
      "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",
      "exclusions": ""
    },
    {
      "name": "scrapheli",
      "members": "ScrapTransportHelicopter",
      "exclusions": ""
    },
    {
      "name": "ch47",
      "members": "ch47.entity",
      "exclusions": ""
    },
    {
      "name": "npcs",
      "members": "ch47scientists.entity, BradleyAPC, HTNAnimal, HTNPlayer, HumanNPC, NPCMurderer, NPCPlayer, Scientist, ScientistNPC, Zombie",
      "exclusions": ""
    },
    {
      "name": "players",
      "members": "BasePlayer",
      "exclusions": ""
    },
    {
      "name": "resources",
      "members": "ResourceEntity, TreeEntity, OreResourceEntity, LootContainer",
      "exclusions": "hobobarrel.deployed"
    },
    {
      "name": "samsites",
      "members": "sam_site_turret_deployed",
      "exclusions": "sam_static"
    },
    {
      "name": "traps",
      "members": "AutoTurret, BearTrap, FlameTurret, Landmine, GunTrap, ReactiveTarget, TeslaCoil, spikes.floor",
      "exclusions": ""
    }
  ]
}​


Merged post

Update * I have found out I can damage Minicopter and Scrap heli using guns, but not pickaxe etcetera. How can I fix this?