Search the Community
Showing results for tags 'increase health'.
Found 1 result
-
HandleDamage Script Seems To Heal Player Occasionally
RootinTootinShootin posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi everyone! I know ARMA 3 wasn't built for it at all but I've been trying to make a couple "action movie" style Scenarios, using the following commonly suggested script to reduce player damage: this setVariable ["selections", []]; this setVariable ["gethit", []]; this addEventHandler [ "HandleDamage", { _unit = _this select 0; _selections = _unit getVariable ["selections", []]; _gethit = _unit getVariable ["gethit", []]; _selection = _this select 1; if !(_selection in _selections) then { _selections set [count _selections, _selection]; _gethit set [count _gethit, 0]; }; _i = _selections find _selection; _olddamage = _gethit select _i; _damage = _olddamage + ((_this select 2) - _olddamage) * 0.25; _gethit set [_i, _damage]; _damage; } ]; Now, I found this actually does its job most of the time (in vanilla at least), allowing the player to soak up a fair few shots before dying, but in certain situations it seemed like the enemies were taking longer than they should have to kill me - they'd unload what seemed like a couple clips into me, then I'd die kind of abruptly, making it seem almost random if the bullet dealt me damage or not. I installed a Status Bar mod which gave my health as a percentage, and it seemed as though certain shots, especially when I was under fire from multiple enemies, seemed to be healing me. There's every chance that the status bar mod was giving me an incorrect readout but what it was showing seemed to explain some previous issues I've had with this script - e.g. suddenly appearing to take no damage at all on one playthrough when I'd previously been able to tank around 10 or so shots from regular enemies before being killed. Perhaps I was taking so much damage that the formula was trying to multiply a negative number, resulting in me being healed? Thank you so much for taking a look at this post, any input is appreciated - I understand that ARMA wasn't built for things like this but with a Mission Editor THIS good it's always nice to have the option if you ask me!- 5 replies
-
- handledamage
- increase health
-
(and 1 more)
Tagged with: