Jump to content

Recommended Posts

Someone in this thread mentioned players taking 1 hit and going into an unconscious state. After playing on another server without this script I realised what they were meaning and investigated further.

This is due to the 'FAR_HandleDamage_EH' function checking for > 1 damage to any part of the body, specifically legs and hands which normally in arma would not kill a unit.

Updating the function to the following will allow your players to live a little longer!

FAR_HandleDamage_EH =
{
private ["_unit", "_killer", "_amountOfDamage", "_isUnconscious","_bodyPart"];

_unit = _this select 0;									// Unit the EH is assigned to
_bodyPart = _this select 1;								// Selection (=body part) that was hit
_amountOfDamage = _this select 2;							// Damage to the above selection (sum of dealt and prior damage)
_killer = _this select 3;									// Source of damage (returns the unit if no source)
_isUnconscious = _unit getVariable "FAR_isUnconscious";

// 26K - Added body part check - Script was checking hits on arms and legs causing early KIAs.
if (alive _unit && _amountOfDamage >= 0.9 && _isUnconscious == 0 && _bodyPart in ["","head_hit","body"]) then 
{
	[side _unit,1,false] call BIS_fnc_respawnTickets;
	_unit setDamage 0;
	_unit allowDamage false;
	_amountOfDamage = 0;
	[_unit, _killer] spawn FAR_Player_Unconscious;
};

_amountOfDamage
};

  • Like 3

Share this post


Link to post
Share on other sites

There is one other bug in this script regarding vehicles

////////////////////////////////////////////////
// Make Player Unconscious
////////////////////////////////////////////////
FAR_Player_Unconscious =
{
    private["_unit", "_killer"];
    _unit = _this select 0;
    _killer = _this select 1;

    // Death message
    if (FAR_EnableDeathMessages && !isNil "_killer" && isPlayer _killer && _killer != _unit) then
    {
        FAR_deathMessage = [_unit, _killer];
        publicVariable "FAR_deathMessage";
        ["FAR_deathMessage", [_unit, _killer]] call FAR_public_EH;
    };

    if (isPlayer _unit) then
    {
        disableUserInput true;
        titleText ["", "BLACK FADED"];
    };

    // Eject unit if inside vehicle
    while {vehicle _unit != _unit} do
    {
        unAssignVehicle _unit;
        // Changed from "eject" to "getOut"
        _unit action ["getOut", vehicle _unit];

        sleep 2;
    };

    _unit setDamage 0;
    _unit setVelocity [0,0,0];
    _unit allowDamage false;
    _unit setCaptive true;
    _unit playMove "AinjPpneMstpSnonWrflDnon_rolltoback";

    sleep 4;

    if (isPlayer _unit) then
    {
        titleText ["", "BLACK IN", 1];

        // Mute ACRE
        _unit setVariable ["ace_sys_wounds_uncon", true];
    };

    _unit switchMove "AinjPpneMstpSnonWrflDnon";
    _unit enableSimulation false;
    _unit setVariable ["FAR_isUnconscious", 1, true];
    disableUserInput false;

    // Call this code only on players
    if (isPlayer _unit) then
    {
        _bleedOut = time + FAR_BleedOut;

        while { !isNull _unit && alive _unit && _unit getVariable "FAR_isUnconscious" == 1 && _unit getVariable "FAR_isStabilized" == 0 && (FAR_BleedOut <= 0 || time < _bleedOut) } do
        {
            hintSilent format["Bleedout in %1 seconds\n\n%2", round (_bleedOut - time), call FAR_CheckFriendlies];

            sleep 0.5;
        };

        if (_unit getVariable "FAR_isStabilized" == 1) then {
            //Unit has been stabilized. Disregard bleedout timer and umute player
            _unit setVariable ["ace_sys_wounds_uncon", false];

            while { !isNull _unit && alive _unit && _unit getVariable "FAR_isUnconscious" == 1 } do
            {
                hintSilent format["You have been stabilized\n\n%1", call FAR_CheckFriendlies];

                sleep 0.5;
            };
        };

        // Player bled out
        if (FAR_BleedOut > 0 && {time > _bleedOut} && {_unit getVariable ["FAR_isStabilized",0] == 0}) then
        {
            _unit setDamage 1;
        }
        else
        {
            // Player got revived
            _unit setVariable ["FAR_isStabilized", 0, true];
            sleep 6;

            // Clear the "medic nearby" hint
            hintSilent "";

            // Unmute ACRE
            if (isPlayer _unit) then
            {
                _unit setVariable ["ace_sys_wounds_uncon", false];
            };

            _unit enableSimulation true;
            _unit allowDamage true;
            _unit setDamage 0;
            _unit setCaptive false;

            _unit playMove "amovppnemstpsraswrfldnon";
            _unit playMove "";
        };
    }
    else
    {
        // [Debugging] Bleedout for AI
        _bleedOut = time + FAR_BleedOut;

        while { !isNull _unit && alive _unit && _unit getVariable "FAR_isUnconscious" == 1 && _unit getVariable "FAR_isStabilized" == 0 && (FAR_BleedOut <= 0 || time < _bleedOut) } do
        {
            sleep 0.5;
        };

        if (_unit getVariable "FAR_isStabilized" == 1) then {
            while { !isNull _unit && alive _unit && _unit getVariable "FAR_isUnconscious" == 1 } do
            {
                sleep 0.5;
            };
        };

        // AI bled out
        if (FAR_BleedOut > 0 && {time > _bleedOut} && {_unit getVariable ["FAR_isStabilized",0] == 0}) then
        {
            _unit setDamage 1;
            _unit setVariable ["FAR_isUnconscious", 0, true];
            _unit setVariable ["FAR_isDragged", 0, true];
        }
    };
};

If you are flying a helicopter as pilot or copilot you do not have an eject action.  So when a chopper crashes, kills the pilot or copilot but remains alive, you never exit the thing and the game freezes because earlier all inputs are disabled.  Switching from eject to getOut seemed to have worked.  I did some preliminary tests with a chopper and humvee, more testing is probably required but for now it seems to work

 

Farooq merged the changes so you can just download it from his github to have the latest version

Share this post


Link to post
Share on other sites

Following the nexus patch a few extra locations have been added, this results in allowing instant kills under some instances, which while interesting, defeats the purpose of a revive script!

 

Making the following corrections below will fix the issue.

 

I'm not 100% if all the parts below are necessary, but they were passed in the EH.

FAR_HandleDamage_EH =
{
	private ["_isUnconscious"];
	params ["_unit","_bodyPart","_amountOfDamage","_killer"];
	_isUnconscious = _unit getVariable "FAR_isUnconscious";
	
	if (alive _unit && 
		_amountOfDamage >= 0.9 && 
		_isUnconscious == 0 && 
		_bodyPart in ["","head","face_hub","neck","spine1","spine2","spine3","pelvis","body"]) then { // 1.54 Changes
			_unit setDamage 0;
			_unit allowDamage false;
			_amountOfDamage = 0;
			[_unit, _killer] spawn FAR_Player_Unconscious;
		};
	_amountOfDamage;
};
  • Like 1

Share this post


Link to post
Share on other sites

Those parts were already there before; but damaging them to 100% wasn't lethal. Well, that changed now :p

 

Thanks for the fix

Share this post


Link to post
Share on other sites

 

I'm not 100% if all the parts below are necessary, but they were passed in the EH.

 

Yes, most seems to be necessary. Tested that yesterday. I missed 'pelvis' resulting in players getting killed when run over by civilians or being shot in the crotch.

 

I also have "head_hit" in the list, it was there before. Is it obsolete now?

 

Another node: You can safely use _amountOfDamage >= 1 to further finetune the point, where players become unconscious.

Share this post


Link to post
Share on other sites

Does any one know how to make the revive "cost" 1 FAK instead of just using a medikit?

Or perhaps the option to use medikit OR a FAK? (both)

Share this post


Link to post
Share on other sites

Does any one know how to make the revive "cost" 1 FAK instead of just using a medikit?

Or perhaps the option to use medikit OR a FAK? (both)

 

I am not using Farooqs revive but you should be able to use use my code for it. In my revive function I use this code to remove a FAK if the reviver has one. When the reviver has no FAK, the other unit is not healed too 100%. A medic with medkit can always revive to 100% health:

_attendant = [(configfile >> "CfgVehicles" >> typeof player),"attendant",0] call BIS_fnc_returnConfigEntry; 
		if(_attendant == 1 && ("Medikit" in items player)) then {
			_target setDamage 0;
		} else {
			if(_fakUsed && ("FirstAidKit" in items player)) then {
				_target setDamage 0;
				player removeItem "FirstAidKit";
			} else {
				_target setDamage (random 0.3)+0.1;
			};
		};

I am using two different action menu options, one for reviving with and one without FAK.

Share this post


Link to post
Share on other sites

Not sure if this has been asked yet, but:

 

I was wondering if it was possible to have the reviving take some time. It is quite fast and for most PVP environments this is too fast.

I'm not much of a scripter myself, so this is why I ask.

Thank you in advance

Yurivw

Share this post


Link to post
Share on other sites

Any way to use this script along with a medical area?

I would like it so ONLY medics can revive anywhere with medkit but also have a medical area to bring downed players in case the medic goes down. I want there to be repercussions to the medic going down but still have a way/place to revive him.

Can I use this with ace3?

Is it best to remove ace3 medical pbos?

Can I use ace3 to load downed players into vehicles still and revive later?

Thanks :)

Share this post


Link to post
Share on other sites

I'm assuming this script is for player vs player revives and will not work on AI units or modified for that.

Share this post


Link to post
Share on other sites

I'm working on a mission now and decided to try Far Revive. I have a 3 man group. A team leader who can revise both team mates, An engineer who can revive both team mates and a medic who can only revive the team leader. The setting allow all member to be able to heal. I tried to switch the medic with someone else and still have the same problem. Seem like the 3rd member only will heal the team leader.

 

Anyone else have this problem or know a fix?

Share this post


Link to post
Share on other sites

No problem here. I am using for AI revive players using far revive  a auto medic script written by bardossy.

Share this post


Link to post
Share on other sites

No problem here. I am using for AI revive players using far revive  a auto medic script written by bardossy.

Can you direct me to the auto medic script?

Share this post


Link to post
Share on other sites

Does this still work with EDEN editor

Does it only work on Altis / Stratis or will any map do :)

 

Thank You

 

Share this post


Link to post
Share on other sites

Is this script discontinued? last version 1.5 doesn't work with Arma 3 v1.56, maybe need lcd fix, now I'm using 1.4d that seems to work but has some bugs.

Share this post


Link to post
Share on other sites

Well I've been working on FAR revive (and might have been inspired by a little bit of code from Liberation)

 

https://github.com/Celludriel/far_revive/tree/develop

 

It's still in the develop branch cause I'm not sure I should release this.  It's structure went totally away from farooq's so the fork went another direction then his.  If he ever does updates no way I can merge his branch into mine.  It should work though.  I have used it in my SimpleCTI mission and my new project ...

  • Like 1

Share this post


Link to post
Share on other sites

Well I've been working on FAR revive (and might have been inspired by a little bit of code from Liberation)

 

https://github.com/Celludriel/far_revive/tree/develop

 

It's still in the develop branch cause I'm not sure I should release this.  It's structure went totally away from farooq's so the fork went another direction then his.  If he ever does updates no way I can merge his branch into mine.  It should work though.  I have used it in my SimpleCTI mission and my new project ...

Could you clarify what the differences are?

Share this post


Link to post
Share on other sites

- hit detection should be improved to become wounded

- when you are wounded you now get a nice death screen animation (the zbug liberation implementation)

- some code beautifications for performance (programmer pride)

- the settings can be configured using parameters (except the ACRE, I forgot that one in this release)

- translations for everything in four languages English, French, German, Spanish

Share this post


Link to post
Share on other sites

celludriel

 

It seems that the "death camera" does not cease when a unit is revived or respawns, The black and white screen remains...

 

Any thoughts?  

Share this post


Link to post
Share on other sites

Hey,

 

i'm here to ask permission (if i need it) to use the original script concept and code in a new script (updated version) with some new nice functions.

 

I will obvioulsy keep the scipts author headers intact as well as give full credit to the original author.

 

Thank you for your time.

 

Domino.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×