Jump to content

Problem with falling damage protection script


caramellcube

Recommended Posts

Hi, I'm trying to make a chem that protects against falling damage but I keep getting the same problem.

The effect script calls ResetFallDamageTimer every 0.5 seconds, and while this does prevent falling damage, it also prevents falling. Each time the command is called the character just stops falling as if they hit an invisible floor. I couldn't find much about this command with a few searches, is this what it's supposed to do? or am I just missing some important part of using it? Any advice would be much appreciated.

Link to comment
Share on other sites

Never tried that function myself but if I were you I'd use Con_SetGameSetting fJumpFallHeightMin X instead, where X is a number of your choice. Default (vanilla) value is 600, and a higher value means less damage. Keep in mind that some mods change that value too, so you'd want to at least make sure the effect script temporarily stores the current value before changing it. Something along these lines...

​​

float currentValue

​Begin ScriptEffectStart

    if currentValue == 0
    ​    set currentValue to GetGameSetting fJumpFallHeightMin
    endif
    Con_SetGameSetting fJumpFallHeightMin 1200
    
End

Begin ScriptEffectFinish

    Con_SetGameSetting fJumpFallHeightMin currentValue
    set currentValue to 0

End

I hope that helps.

Link to comment
Share on other sites

You're welcome.

 

There's one thing I forgot to mention. The fJumpFallHeightMin game setting affects all actors, not only the player character, but since NPCs never jump and rarely fall off cliffs by accident, there shouldn't be any problem.

 

Anyway, happy modding!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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