Jump to content

GetHealthPercentage for modified Max Health / Conditional Perk


Exalderan

Recommended Posts

Hi, I'm trying to make a Perk that activates at a certain health treshold, below 50% Max HP. All working fine so far. The problem is tge GetHealthPercentage function I use to set the conditional perk boni only considers unmodded Health.

 

My perk should affect Perks like Life Giver too, or other means max health is added permanently through mods. However there is no function that lets me compare HealthPercentage for the permanent increase.

 

How would I go about using a script?

 

Would something like this work?

BEGIN GameMode

if
((Player.GetAV Health / Player.GetPermAV Health)*100) < 0.5
    Player.modav Strength 2
    Player.modav Agility 2

endif

END

I'm new to modding and sadly I dont know how to stop the script when the condition is not met and reduce the attributes again.

If someone could help me a bit or push me in the right direction I'd be really happy.

 

If there was a way to make Life Giver mod the BaseHealth that would be even greater, that way all the other perks like NerdRage and Hot Blooded would work that way too. Or maybe I could make a new global function that returns the buffed current health.

 

Thanks in advance and i hope you have a nice day

 

EDIT: Sorry I saw too late its in the wrong forum, but I'm unable to delete my post.

Edited by Exalderan
Link to comment
Share on other sites

Please see the 'TIP: Get Actor Health functions' entry of the wiki "Getting started creating mods using GECK" article.

 

Rather than "stopping" your script, you want to "gate" by testing for and setting a "DoOnce" variable you define and control. There are a number of tutorials in the "Scripting" section that TIP is in.

You can PM a moderator (such as Wasteland Assassin) to move the thread to the "GECK and Modders" sub-forum for you.

 

-Dubious-

Link to comment
Share on other sites

  • Recently Browsing   0 members

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