Jump to content

IsInPowerArmor() & GetLinkRef(LinkPowerArmor) not consistant.


Recommended Posts

Is just me or are the native PowerArmor scripting functions just hit and miss?

 

I'm using VMQuestVariable conditions on a Menu Buttons.

One of the buttons is to Evict an actor out of power armor if they're are in power armor.

All works well for some actors, but other actors it's like the native functions are blind to the actor wearing power armor.

Bool bIsInPA Conditional
.....
bIsInPA =  myActor.IsInPowerArmor()

In the case of IsInPowerArmor() it reports false for example when I query the respawning Raider on a catwalk between 2 buildings with a Fatman at Lexington.

Also GetLinkRef(LinkPowerArmor) on the same actor always initially fails as well.

That's just a single repeatable instance of it not reporting correctly, but I have many more.

If I evict the Raiider out of the armor and then command them back into the armor, then IsInPowerArmor() reports correctly.

 

A work around to consistently see if an Actor is wearing power armor seems to be:

myActor.WornHasKeyword(ArmorTypePower)

At least in testing every actor who was wearing power armor reported true and false if they weren't wearing power armor.

 

Basically I find I'm having to re-invent functions to get what I'm after done.

I won't go into the work around for the dodgey issues I've had with GetLinkRef(LinkPowerArmor) just so I can find the armor they got out of, which seems to be equally hit and miss depending on the actor.

But basically required me to look for furniture via furniture keyword in close vicinity after the actor hops out.

But at least I can find the armor they were in no matter what actor it is.

 

I was all set in my mind the inconsistent behavior was due to the actor not being unique or from a leveled list and many other things, but that doesn't appear to be the case at all, as the wrong reporting can happen on just about any type of spawned actor.

 

Don't get me wrong as I'm use to papyrus functions not doing as expected, makes me more appreciative of those other papyrus functions that do do as expected...lol

Edited by sLoPpYdOtBiGhOlE
Link to comment
Share on other sites

Yes it seems hit or miss. I'm using it on custom made companions that do have the Unique keyword, and do have the PowerArmor script attached.

 

I use a very simple script from a terminal:

 

Actor hgActor = hgCompanion.GetActorReference()
if hgActor.IsInPowerArmor()
hgActor.SwitchToPowerArmor(none)
endif

 

Sometimes it works, sometimes not.

 

I get the feeling the companion gets 'bugged out' for whatever reason, and won't exit power armor.

 

For one thing I have the no damage to power armor keyword set.

 

Sometimes I would look at the companion and swap out pieces while they were equipped. I haven't established for sure if that is a repeatable way to get them 'stuck' in PA.

 

From what you're saying it's possible my checking IsInPowerArmor() is not enough. Thanks for WornHasKeyword(ArmorTypePower) will check into that.

Edited by MasterMagnus
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...