F4llfield Posted May 23, 2024 Posted May 23, 2024 Hi all, What would be the best way to detect if an NPC is wearing a power armor by script ?
F4llfield Posted May 23, 2024 Author Posted May 23, 2024 Hi,found this in the foreum: Keyword Property pIsPowerArmorFrame Auto Const Mandator Function CheckForPowerArmor(Actor akActor) If(akActor.WornHasKeyword(pIsPowerArmorFrame) == true) dothis.... endif Hopes it help someone else... 2
LarannKiar Posted June 10, 2024 Posted June 10, 2024 On 6/10/2024 at 9:02 AM, DlinnyLag said: See Actor.IsInPowerArmor Expand It's a working alternative indeed but there's unfortunately a problem with it.. it checks for the PA perk: ; Return true if this actor is in power armor bool Function IsInPowerArmor() ;Return if the actor has the Power Armor Perk Return HasPerk(Game.GetFormFromFile(0x0001F8A9, "Fallout4.esm") as perk) EndFunction There's an engine bug that can cause this perk to get stuck on an NPC.. extremely rare in vanilla but it's still there. Here's the original discussion about it (from 2021). In short: IF an NPC's 3D unloads while; 1) being mounted on a Vertibird AND 2; wearing a Power Armor; THEN the PA perk gets stuck (becomes completely unremovable with vanilla Console/Papyrus RemovePerk(), thus even the vanilla code can't remove it on PA exit). 1
Recommended Posts