Question about Patrol Helicopter vs Bradley damage behaviorSolved

Hello,

I wonder why, with the default configuration, Patrol Helicopter can damage player buildings whereas BradleyAPC or CH47 scientists cannot. Please notice that I have disabled most of my plugins (except Vanish, Backpacks, Backpack Button, Building Repair, Night Vision) during my tests.

Trace from Bradley (canceled) damage:
From: TimedExplosive, maincannonshell
To: BuildingBlock, foundation
No shared locations (empty location) - no exclusions
No exclusion found - looking up RuleSet...
Using RuleSet "default"
Initiator is BradleyAPC; evaluating RuleSet rules...
Initiator EntityGroup matches: none
Target EntityGroup matches: none
Evaluating Rules...
Checking direct initiator->target rules...
No matching any->target rules found; returning default value: False

Trace from Patrol (authorized) damage:
From: PatrolHelicopter, patrolhelicopter
To: BuildingBlock, floor
No shared locations (empty location) - no exclusions
No exclusion found - looking up RuleSet...
Using RuleSet "default"
Initiator is heli, target is non-player; allow and return

Since Patrol is identified as "Initiator is heli", I tried to remove the "heli" Entity Group and its reference in the "rules" section. Surprisingly, even after restarting the server, the trace from Patrol damage still identifies the Patrol Heli as "Initiator is heli" as shown below.

Trace from Patrol (authorized) damage:
From: PatrolHelicopter, patrolhelicopter
To: BuildingBlock, floor
 No shared locations (empty location) - no exclusions
No exclusion found - looking up RuleSet...
Using RuleSet "default"
Initiator is heli, target is non-player; allow and return

Does anyone know why Patrol damage to building blocks seems to be enforced compared to Bradley/CH47 scientists?

hi, patrol heli is controlled specifically with flags. rules cannot be used with heli when it is the initiator (when the heli is the attacker)

NoHeliDamageSleepers can be used for sleeping players
NoHeliDamagePlayer can be used with or without that flag, but must be used for player specific damage
NoHeliDamageQuarry is to be used with quarries
NoHeliDamageRidableHorses is for use with ridable horses
NoHeliDamageBuildings is to be used with buildings, but must be protected by a TC 
NoHeliDamage is to be used for all other types of damage. this is to say that this flag will not cover the above flags.
LockedBoxesImmortal and LockedDoorsImmortal override those flags.
absence of a relevant flag will allow that specific damage to be allowed

bradley is controlled with rules.

            if (weapon?.ShortPrefabName == "maincannonshell" || weapon is BradleyAPC)
            {
                if (trace) Trace("Initiator is BradleyAPC; evaluating RuleSet rules...", 1);
                return EvaluateRules(entity, weapon, ruleSet);
            }​

Understood.
Thanks for your answer @nivex. 🙏

Ok, so I used "NoHeliDamageBuildings" as a flag but Patrol Helicopter still can destroy builds. What am I missing?

"name": "default",
"enabled": true,
"defaultAllowDamage": false,
"flags": "HumanNPCDamage, LockedBoxesImmortal, LockedDoorsImmortal, NoHeliDamageBuildings, 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",
"nothing can hurt ch47",
"nothing can hurt cars",
"nothing can hurt mini",
"nothing can hurt snowmobiles",
"nothing can hurt ridablehorses",
"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"
]
}
],

Locked automatically