I have a private Epoch server that my friends and I play on. We're not PVP and have issues with trying to stay alive. With that, I was looking for a way to setup unlimited revives as well as bypass needing a Defibrillator. I'm going to show you how to setup unlimited revives and then show you the code I used to bypass the Defibrillator.
Before I start, I wanted to give a huge thank you to (in no special order) AWOL, Vampire, Ghostrider, He-Man, and Grahame for giving their time to help me on Discord!
Ok, here's what we need to do.
Extract your mission pbo file (mine is bornholm.pbo) and go into epoch_code\compile\setup\EPOCH_clientRevive.sqf
https://github.com/EpochModTeam/Epoch/blob/release/Sources/epoch_code/compile/setup/EPOCH_clientRevive.sqf#L59
Find line 59 and change it to true
58 // set token and can revive to false
59 Epoch_canBeRevived = true;
60 Epoch_personalToken = _personalToken;
Next step, extract your epoch_server.pbo file in @epochhive\addons
Find EPOCH_server_revivePlayer.sqf in @epochhive\addons\epoch_server\compile\epoch_player
https://github.com/EpochModTeam/Epoch/blob/release/Sources/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf#L119
Find line 119 and comment out the code
116 _newPlyr setVariable ["SETUP", true];
117 _newPlyr setVariable ["PUID", _playerUID];
118 _newPlyr setVariable ["GROUP", _playerGroup];
119 //_newPlyr setVariable ["REVIVE", false];
120 _newPlyr setVariable ["SERVER_VARS",_player getVariable ["SERVER_VARS",[]]];
121 _newPlyr setVariable ["EPOCH_playerPlayTime",_player getvariable ["EPOCH_playerPlayTime",0],true];
Ok, thats it. You now have unlimited revives.
Last part. If you don't want to use the Defibrillator, you can copy the following code. This will require the player to have at least 100 energy in order to revive a dead player. Makes it a lot easier, but also prevents players from dying and then running back to revive everyone else.
Lets go back to your mission pbo and find this file epoch_code\compile\EPOCH_DefibrillatorUse.sqf
https://github.com/EpochModTeam/Epoch/blob/release/Sources/epoch_code/compile/EPOCH_DefibrillatorUse.sqf#L20-L57
Replace lines 20-57 with the following code:
if (isplayer _unit) then {
_energyneeded = 100;
if (EPOCH_playerEnergy - _energyneeded > 0) then {
_output = ["Energy", -_energyneeded] call EPOCH_giveAttributes;
_unit spawn {
player playMove 'AinvPknlMstpSnonWrflDnon_medic0';
player playMove 'AinvPknlMstpSnonWrflDnon_medicEnd';
uisleep 8;
if (alive player && isplayer _this) then {
[_this,player,Epoch_personalToken] remoteExec ['EPOCH_server_revivePlayer',2];
};
};
} else {
['Not enough energy to revive',5] call Epoch_Message;
};
}
else {
['This Player can not be revived',5] call Epoch_Message;
};
That should be it. Assuming you made all of the changes that I did, you can revive as many times as you want and a defib not necessary.