Jump to content

OnEnterBleedOut() help


Recommended Posts

I basically have a script, for a start (i intend to do other things with it).

 

I am just seeing some weird behavior.

 

So setting the PC to essential.

 

When the PC gets their health knocked to 0 and triggers the OnEnterBleedOut() I fade the screen to black, wait 20 seconds then fade back in and heal the player character to 100 to bring them out of bleed out.

Event OnEnterBleedout()
      Game.DisablePlayerControls()
      FadeToBlackAndHold()
      Utility.Wait(20)
      FadeFromBlack() 
      Game.GetPlayer().RestoreActorValue("health", 100)
      Game.EnablePlayerControls()
endEvent

if I load up a game, get myself knocked down, everything works as expected. Player on their knees, fades to black, 20 seconds pass, screen fades back in, players health is restored and they get up and move.

 

The issue is, any subsequent times the player gets knocked down. So if I get knocked out a second time. The Player only falls to their knees for a split second then instantly recovers. (The code in enter bleed out still executes, its just that the player is standing up and at full health the whole time). (I commented out the fade in/fade out to properly observe this ) and sure enough the first time I get knocked out, on my knees till the code finishes. Any subsequent knockouts, my chatacter drops to his knees for a split second then his health is restored and hes up.

 

So i am trying to figure out why after getting knocked down the first time, any subsequent times the player instantly recovers from bleed out.

Edited by tsdobbi
Link to comment
Share on other sites

You could try using SetNoBleedoutRecovery(True) and SetNoBleedoutRecovery(False) in the script. Set it to 'True' in the first line of the event. Set it to false in the last line.

 

That may make it work more reliably. I've never used it so I can't say for sure.

Link to comment
Share on other sites

You could try using SetNoBleedoutRecovery(True) and SetNoBleedoutRecovery(False) in the script. Set it to 'True' in the first line of the event. Set it to false in the last line.

 

That may make it work more reliably. I've never used it so I can't say for sure.

 

Thanks. I saw that before, but wasn't clear on what exactly it did.

Edited by tsdobbi
Link to comment
Share on other sites

Unfortunately, that didn't work. In fact it had the opposite affect. It was causing the player to instantly recover every time.

 

I wonder if it has something to do with the fact I am manually restoring the players health and not letting the bleedOut run its course.

Link to comment
Share on other sites

That's odd. SetNoBleedoutRecovery(true) should do exactly as it sounds. The actor should never recover from bleedout.

 

I found another similar thread and they are using that function. They do not talk about the script not working, only about problems with moving the player to another location didn't work in odd circumstances where the player enters bleedout due to bing hit by unrelenting force and entering bleedout as a result.

 

https://forums.nexusmods.com/index.php?/topic/5526267-bleeding-out-when-knocked-down-help-with-a-script/

 

If you post the full script in spoiler text, someone better than me with scripts might see the problem.

Link to comment
Share on other sites

That's odd. SetNoBleedoutRecovery(true) should do exactly as it sounds. The actor should never recover from bleedout.

 

I found another similar thread and they are using that function. They do not talk about the script not working, only about problems with moving the player to another location didn't work in odd circumstances where the player enters bleedout due to bing hit by unrelenting force and entering bleedout as a result.

 

https://forums.nexusmods.com/index.php?/topic/5526267-bleeding-out-when-knocked-down-help-with-a-script/

 

If you post the full script in spoiler text, someone better than me with scripts might see the problem.

 

 

I got it working, the key was actually to just set the actor to not be able to recover period, and never set it to false and just handle the recovery myself in the script.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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