Jump to content

How to control what happens when the player dies?


HailHell

Recommended Posts

There are several approaches I could see on how to tackle this (might not work or work necessarily as planned, only how I would start to tackle the problem).

 

The first, and probably more of a brute force (but should be highly compatible) approach would be to have a script listening for OnUpdateGameTime() using some trigger to RegisterForSingleUpdateGameTime(0.0244) (0.0244 translates to 14.64 in-game minutes [pretty small time interval all in all]). Have a property containing the player and check their current health compared to their max health, and transport the player if it falls under a certain percentage.

 

Another approach (probably not as compatible as the other) would be to attach a script to the player itself to listen for the OnEnterBleedout() event. If the player starts to enter that state, do the action you want (which you can check to see if the player is the one bleeding out in the script) [Not sure if you could instead use the event within the same script for your UpdateGameTime() attempt. If you can, it will be more compatible than attaching it to the player].

 

Since an Actor is also an ObjectReference, there are a few events that ObjectReference's listen for that might be helpful in trying to determine player health state or player living state. Hope this helps.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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