Re: How to make script to regenerate health
AndyChanglee wrote:
Hey, sorry to necro this thread, but I was wondering about how to make the health regen more Call of Duty style (which is basically you take hits and your screen is all bloody, but then you find cover, you wait 5-7 seconds and you start to regenerate your health).
It makes it more fair than just always regenerating health.
And one more question if you're willing to answer: I haven't tried out the script, but how fast does it regen, and is that adjustable?
/Necro reply.
This is simply what I have to regenerate HP while removing wounds from an actor.
Include a Wounds .ini active somewhere, and give your actor the new wounds as entry and exit.
Code:
AddEffect = AEmitter
PresetName = Regen Wound
Mass = 0.0001
HitsMOs = 0
GetsHitByMOs = 0
SpriteFile = ContentFile
FilePath = BloodBeast.rte/Sprites/RegenWound/RegenWound.bmp
FrameCount = 5
SpriteOffset = Vector
X = -2
Y = -2
SpriteAnimMode = 4
SpriteAnimDuration = 500
AtomGroup = AtomGroup
AutoGenerate = 1
Material = Material
CopyOf = Flesh
Resolution = 2
Depth = 5
DeepGroup = AtomGroup
AutoGenerate = 1
Material = Material
CopyOf = Flesh
Resolution = 3
Depth = 5
DeepCheck = 0
JointStrength = 50000
JointStiffness = 1
DrawAfterParent = 1
AddEmission = Emission
EmittedParticle = MOPixel
CopyOf = Drop Blood
Spread = 0.2
MaxVelocity = 9
MinVelocity = 3
BurstSound = Sound
CopyOf = Flesh Penetration Hit
EmissionEnabled = 1
EmissionsIgnoreThis = 1
EmissionCountLimit = 1
ParticlesPerMinute = 20
BurstSize = 1
BurstScale = 4
BurstDamage = 1
BurstTriggered = 1
EmissionDamage = -1
Flash = None
FlashOnlyOnBurst = 0
"RegenWound.bmp" is my animation for the wound, it simply pulsates.
The 5 bmp names start with "RegenWound000.bmp" and end with "RegenWound004.bmp".
This whole thing would make your actor regenerate exactly 100% of damage they take from wounds while removing them, after a few seconds delay per wound.
Important things to edit to your liking (for the wounds .ini):
EmissionDamage = The amount of HP regained per wound healed.
ParticlesPerMinute = The rate at which a wound is healed, lower is slower.