Jump to content

Damaging player


lgpmichael

Recommended Posts

OK, I seem to have hit something odd. There seems to be no way to damage a player down to 1 health

 

Easy as anything to damage someone by a predefined amount, but the only way I can see to damage a player TO a value is to keep calling damage spells till the health hits the desired level... As far as I can see you can't modify the damage level of a damaging spell so you have to know in advance how much damage to cause...

 

There seem to be script functions of varying degrees of uselessness...

 

GetActorValue health - gets the current health, great!

SetActorValue health - sets the max health.

 

wait what, get gets current and set sets max... wtf?

 

GetBaseActorValue health - returns the calculated value, useless as you can't reset to the calculated value

 

ModActorValue health - looks good, but it seems to be an effect, it cant be healed away. So - useless

ForceActorValue health - the same

 

Am I really missing something or do I really need to call a series of damage spells (which is wonderful with no looping in scripts...) to do what should probably be the simplest task of all.

 

As a note, I am simulating falling damage, player drops into a hole, change cell, lands, simulate damage.

Link to comment
Share on other sites

Can you read the current maxhealth value and store it, ForceActorValue Health to 1, then use SetActorValue health to set the max level back to where it was, leaving the curreent health at 1?
Link to comment
Share on other sites

Can you read the current maxhealth value and store it, ForceActorValue Health to 1, then use SetActorValue health to set the max level back to where it was, leaving the curreent health at 1?

 

Nupe, because you don't know what max health is. getting it gets it including its modifications, setting it sets it raw, not including modifications, so you end up setting it to a different value. Its pretty much impossible (I suppose you could look through the effects and make the adjustments manually, but that seems a bit overkill)

Link to comment
Share on other sites

From what I remember Oblivion uses a silly method where ModActorValue Health is used to deal damage, which can then be healed normally.

 

Try to Get the current Health value then then subtract Current Health by (Current Health - 1) so you'll be left with a single Health point.

Link to comment
Share on other sites

From what I remember Oblivion uses a silly method where ModActorValue Health is used to deal damage, which can then be healed normally.

 

Try to Get the current Health value then then subtract Current Health by (Current Health - 1) so you'll be left with a single Health point.

 

That was the first thing I tried. ModAV to current-1 works fine, except it can't be healed. I only noticed when my HP sat at rock bottom after a half dozen heals...

Link to comment
Share on other sites

Try a script like this:

 

scn DropHealthTo1Script

short DHealth

Begin ScriptEffectStart

Set DHealth to Player.GetAV Health -1 ;sets DHealth to one point below the Player's current health

Player. ModAV Health -DHealth ; subtracts DHealth from current Player health resulting in one remaining HP

End

 

That should get the job done.

Link to comment
Share on other sites

Try a script like this:

 

scn DropHealthTo1Script

short DHealth

Begin ScriptEffectStart

Set DHealth to Player.GetAV Health -1 ;sets DHealth to one point below the Player's current health

Player. ModAV Health -DHealth ; subtracts DHealth from current Player health resulting in one remaining HP

End

 

That should get the job done.

 

Unfortunately, as I mentioned, that is the very first thing I tried, but the damage cannot be healed. In the modav docs it points out that any script using modav has the responsibility to reverse the effect too. So the only way that works would be to mod every healing spell

Link to comment
Share on other sites

Did you try the ModActorValue2 function in obse?

 

Hi,

 

Nope, I am trying to avoid overheads for the mod, and so trying to do this one without obse. However it does look like that would be the answer.

 

I have ended up instead of simulating the damage of a fall, with a system for looking at current HP and actually dropping the player a distance that does an appropriate amount of damage, so they actually make the fall, see the rockface shooting by, unable to stop themselves, and it does the job, and probably a little better and more fun than just having them appear on the ground and making them trip, yell, and fake damage.

 

I'm still awed by the fact though, that you need a third party addition to the modding tools to do the simplest job there is!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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