Jump to content

PlayerShip health check?


Recommended Posts

I'm currently working on a personal alternate death/hardcore mod and want to create punishments for the two types of deaths players can experience: on-foot death and playership death.

Does anyone know how to check the hull health of the player's ship? I can't seem to find this stat like I can with the player's health.

Additionally, does anyone know what actually triggers the ship to break apart and explode? Is it possible to trigger those animations?

Thanks.

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

It's just Health [AVIF:000002D4]. You have to call GetValue() on a SpaceshipReference to access it in papyrus just as you would with an Actor.

This returns the % health remaining on your ship (you could call it on other ships, of course.)

Scriptname ShipHealthScript extends Quest
 
ActorValue Property Health Mandatory Const Auto
ReferenceAlias property PlayerShip Auto Const Mandatory
 
float Function CheckPlayerShipHealth()
    float health = PlayerShip.GetBaseValue(Health) / PlayerShip.GetValue(Health)
    return health
EndFunction
Link to comment
Share on other sites

  • Recently Browsing   0 members

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