Jump to content

Set health of armor in an actor's inventory


CarlCorey

Recommended Posts

So, I'm still trying to find a way to keep NPCs who haven't had Power Armor training from putting the stuff on. My latest thought was to put a script on the armor with OnAdd and OnDrop blocks that use the FOSE GetHealth and SetHealth functions to effectively break the armor when its added to the wrong NPC and restore it on the way out. I figured that would be one way to keep someone from wearing it.

 

This code just checks for any container that isn't the player but I figured I could refine that once I verified that it works.

 

 

 

scn PowerArmorNPCCheck

float myHealth

begin OnAdd
    if GetContainer != player
        set myHealth to GetHealth
        printc "got health %.0f" myHealth
        SetHealth 0
    endif
end

begin OnDrop
    if GetContainer != player
        SetHealth myHealth
    endif
end

 

 

 

Well, it doesn't. I give a suit of Power Armor to the NPC. The printc reports 1000 health but the NPC puts it on and showinventory on the NPC reports this: "Power Armor (00014e13) (0,100%)". So even with 0 HP it's still at 100% health. :confused:

 

I can't see any other script function that might address this. SetDestroyed only works on items that don't actually have health and Disable/Enable did nothing either. If anyone knows a way to make it so that the PA is always unequipable, please let me know.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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