ToejaM Posted August 20, 2014 Report Share Posted August 20, 2014 This should stop all forms of getting out of the knockout glitch, where it is mostly when people try to use certain medical objects from their inventory that cause them to do a scripted animation which they can skip and then continue you running. I'm putting this up as a fix is needed asap, though I have faith that someone can simplify this by making the fn_unconscious.sqf bullet proof. Until then, this works fine. Expect a lot of whining from overburdened players building bases though! Just follow the steps below, those of your savvy enough know where to skip certain basic steps. Creating a custom compiles.sqf A compiles.sqf is essentially a hub for linking most of the scripts within DayZ Epoch. Without this, you cannot do the following changes to files below.Step 1) Unpack your dayz_code.pbo in Dayz_Epoch\addons\Step 2) Pull out the compiles.sqf from dayz_code\init\ and place into your root mission folder (where mission.sqm is)Step 3) Find and edit in your init.sqf inside your mission file look like this call compile preprocessFileLineNumbers "compiles.sqf"; //Compile regular functions Folder Creation - Can Skip if you're a messy one and you like to have every edited file in the root directory, you heretic. Step 1) Create a folder in your mission.pbo / folder called "medical" - Mine for example is in another folder called fixes as a subfolder. Prevent Gear Opening While Unconcious - credit Itsatrap This should prevent opening of gear while unconcious, negating the need for my fixes below. If you find that you can brute force the gear open, follow the extra steps to prevent items being used completely. Step 1) Goto @DayZ_Epoch\addons\dayz_code\compile and remove the following file to the folder above or if you already have the file skip to step 2 and you should be able to ignore step 3. fn_gearMenuChecks.sqf Step 2) Edit the following code into the fn_gearMenuChecks.sqf file at line 9 //Knockout Glitch Fix if ((player getVariable ["NORRN_unconscious", true])) exitWith { _display closeDisplay 1; //Let Zeds know [player,15,true,(getPosATL player)] spawn player_alertZombies; systemChat ( "You are unconscious." ); }; Step 3) Edit your compiles.sqf and change: fn_gearMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_gearMenuChecks.sqf"; to fn_gearMenuChecks = compile preprocessFileLineNumbers "fixes\fn_gearMenuChecks.sqf"; You're done. Prevent players using items from inventory that would allow them to move. This will stop players from using medical items that allow them to move freely while unconscious. Step1) Goto @DayZ_Epoch\addons\dayz_code\medical in your client files and copy the following files to the folder you created above. antibiotics.sqf - Not important but stops infected people losing more blood while they are supposed to be unconcious. bandage.sqf - This is one of the major glitches that gets you out of being unconcious morphine.sqf - Same as above painkiller.sqf - This removes your unconcious timer if overburdened, may also remove it if knocked out. selftransfusion - Stops bloodbagging, may also kick you out of "unconcious" Step 2) Edit this line into each file at the stated line below: //CPC Glitch Fix if ((player getVariable ["NORRN_unconscious", true])) exitWith {systemChat ( "You are unconscious." );}; antibiotics.sqf - Line 10 - Below: //s_player_antiobiotic = -1;bandage.sqf - Line 6 - Below: disableserialization;morphine.sqf - Line 6 - Below: disableserialization;painkiller.sqf - Line 6 - Below: disableserialization;selftransfusion.sqf - Line 7 - Below: if ((round(time - _lastused)) <= _timeout) exitWith {cutText [format[(localize "str_actions_medical_18"),(_timeout - (round(time - _lastused)))] , "PLAIN DOWN"]}; Step 3) Goto @DayZ_Epoch\addons\dayz_code\actions and copy the following file into the medical folder you created above: player_useMeds.sqf Step 4) Edit player_useMeds.sqf To look like the following or similar depending on your file structure: private ["_item","_id","_onLadder","_hasmeditem","_config","_text"]; _item = _this; call gear_ui_init; _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]}; _hasmeditem = _this in magazines player; _config = configFile >> "CfgMagazines" >> _item; _text = getText (_config >> "displayName"); if (!_hasmeditem) exitWith {cutText [format[(localize "str_player_31"),_text,"use"] , "PLAIN DOWN"]}; switch (_item) do { case "ItemBandage": { _id = [0,0,0,[player]] execVM "fixes\medical\bandage.sqf"; }; case "ItemMorphine": { _id = [0,0,0,[player]] execVM "fixes\medical\morphine.sqf"; }; case "ItemPainkiller": { _id = [0,0,0,[player]] execVM "fixes\medical\painkiller.sqf"; }; case "ItemAntibiotic": { _id = [0,0,0,[player]] execVM "fixes\medical\antibiotics.sqf"; }; case "ItemBloodbag": { _id = [0,0,0,[player]] execVM "fixes\medical\self_transfusion.sqf"; }; case "ItemHeatPack": { player removeMagazine "ItemHeatPack"; dayz_temperatur = (dayz_temperatur + 5) min dayz_temperaturmax; cutText [localize "str_player_27", "PLAIN DOWN"]; }; }; Step 5) Edit the compiles.sqf with the following around line 96 depending on other mod edits ect player_useMeds = compile preprocessFileLineNumbers "fixes\medical\player_useMeds.sqf"; Step 6) Credit to infiSTAR Create a new .sqf and put the following inside, then place it in your 'fixes' folder under a name of your choice, I called mine "knockoutglitch.sqf" while {true} do { waitUntil {(player getVariable ["NORRN_unconscious", false])}; titleText ["You are unconscious","PLAIN DOWN"]; titleFadeOut 4; disableUserInput true;disableUserInput true;disableUserInput true; waitUntil {!(player getVariable ["NORRN_unconscious", false])}; disableUserInput false;disableUserInput false;disableUserInput false; }; Step 7) In your init.sqf at the bottom add this: // Knockout Action Glitch Fix [] execVM "fixes\knockoutglitch.sqf"; Link to comment Share on other sites More sharing options...
itsatrap Posted August 20, 2014 Report Share Posted August 20, 2014 If I add this to fn_gearMenuChecks.sqf will it not have the same effect but use less files ? after disableSerialization;if ((player getVariable ["NORRN_unconscious", true])) exitWith { _display closeDisplay 1; //Let Zeds know [player,10,true,(getPosATL player)] spawn player_alertZombies; systemChat ( "You are unconscious." ); }; I am not home so can't test it. Link to comment Share on other sites More sharing options...
justchil Posted August 20, 2014 Report Share Posted August 20, 2014 This might be worth posting on the git so future releases.I don't have weight on my server but if you combat log you don't stay knocked out. Link to comment Share on other sites More sharing options...
ToejaM Posted August 20, 2014 Author Report Share Posted August 20, 2014 If I add this to fn_gearMenuChecks.sqf will it not have the same effect but use less files ? after disableSerialization; if ((player getVariable ["NORRN_unconscious", true])) exitWith { _display closeDisplay 1; //Let Zeds know [player,10,true,(getPosATL player)] spawn player_alertZombies; systemChat ( "You are unconscious." ); }; I am not home so can't test it. That should work but I think its brute forceable without more wizardry Link to comment Share on other sites More sharing options...
itsatrap Posted August 20, 2014 Report Share Posted August 20, 2014 There is also dayz_spaceInterrupt.sqf simply disable gear button if unconscious ? Or in the file ui_selectSlot.sqf Simply exit if right klick on the bandage Trying to fingere out a way that don't require that much change in files, Link to comment Share on other sites More sharing options...
itsatrap Posted August 21, 2014 Report Share Posted August 21, 2014 Just tested it and it works, can't get the gear menu up while i'm unconscious Link to comment Share on other sites More sharing options...
PeterBeer Posted August 21, 2014 Report Share Posted August 21, 2014 Just tested it and it works, can't get the gear menu up while i'm unconscious So you added that to fn_gearMenuChcks.sqf ? Link to comment Share on other sites More sharing options...
itsatrap Posted August 21, 2014 Report Share Posted August 21, 2014 Add if ((player getVariable ["NORRN_unconscious", true])) exitWith { _display closeDisplay 1; //Let Zeds know [player,15,true,(getPosATL player)] spawn player_alertZombies; systemChat ( "You are unconscious." ); }; right before if(_inVehicle) then { _cTarget = (vehicle player); }; the finished code should look like this private ["_cTarget","_isOk","_display","_inVehicle"]; disableSerialization; _display = (_this select 0); _inVehicle = (vehicle player) != player; _cTarget = cursorTarget; /**** CSG: Knockout Glitch FIX start ****/ if ((player getVariable ["NORRN_unconscious", true])) exitWith { _display closeDisplay 1; //Let Zeds know [player,15,true,(getPosATL player)] spawn player_alertZombies; systemChat ( "You are unconscious." ); }; /**** CSG: Knockout Glitch FIX End ****/ if(_inVehicle) then { _cTarget = (vehicle player); }; ..................................... Looks like thishttp://cloud-4.steampowered.com/ugc/574527639725913850/50F7EA32AA62F6AB2A748915B1A2DD6066E8F60A/1024x576.resizedimage Link to comment Share on other sites More sharing options...
ToejaM Posted August 21, 2014 Author Report Share Posted August 21, 2014 It appears in SOME cases people can vault out of it still, this is a problem as vaulting is a core Arma mechanic and not something we can edit via scripts. This means we need to do something while they are stationary but still flagged as unconscious. Itsatrap I've added your fix to my post above my fix as yours is simpler, its untested by me but it looks sound enough to work. Link to comment Share on other sites More sharing options...
itsatrap Posted August 21, 2014 Report Share Posted August 21, 2014 It appears in SOME cases people can vault out of it still, this is a problem as vaulting is a core Arma mechanic and not something we can edit via scripts. This means we need to do something while they are stationary but still flagged as unconscious. Itsatrap I've added your fix to my post above my fix as yours is simpler, its untested by me but it looks sound enough to work. if ((_dikCode in actionKeys "GetOver") && (player getVariable ["NORRN_unconscious", true])) then { _handled = true; }; add this in your dayz_spaceInterrupt.sqf (untested) Link to comment Share on other sites More sharing options...
ToejaM Posted August 21, 2014 Author Report Share Posted August 21, 2014 Added that into my script, will test it when the time comes but it can be difficult to work in two unconscious efforts without dying heh. Seems there is an issue if you die while unconscious now, when you relog you can move freely, no timer but all of the blocking efforts keep informing me that I'm unconscious. A relog fixes this and you do not get set unconscious on a relog which is pretty odd. Seems the state must carry over partially from death. I'm wondering if its to do with the timer that shows briefly after you die. People also appear to get told they are unconcious even a while after being unconscious but I have no specifics on what causes this. Link to comment Share on other sites More sharing options...
MassBoobage Posted August 22, 2014 Report Share Posted August 22, 2014 I am getting players who cannot access their own gear. They get a message that they are unconcious. Link to comment Share on other sites More sharing options...
ToejaM Posted August 22, 2014 Author Report Share Posted August 22, 2014 This seems to happen after being knocked out once already, a relog fixes it though. Will be working on something this weekend hopefully Link to comment Share on other sites More sharing options...
itsatrap Posted August 22, 2014 Report Share Posted August 22, 2014 (edited) Updated version Add _isUnconscious to PRIVATE[]; at the top private ["_cTarget","_isOk","_display","_inVehicle","_isUnconscious"]; _isUnconscious = player getVariable ["NORRN_unconscious",false]; if (_isUnconscious) exitWith { if (alive player) then { if (isPlayer player && _isUnconscious) then { _display closeDisplay 1; //Let Zeds know [player,25,true,(getPosATL player)] spawn player_alertZombies; systemChat ( "You are unconscious." ); // combattimeout player setVariable["combattimeout", time + 10, true]; player setVariable["startcombattimer", 0]; dayz_combat = 1; }; }; }; Edited August 23, 2014 by itsatrap fireplace 1 Link to comment Share on other sites More sharing options...
Havoc302 Posted August 23, 2014 Report Share Posted August 23, 2014 Is this working now? It'd be awesome to be able to prevent this. Link to comment Share on other sites More sharing options...
itsatrap Posted August 23, 2014 Report Share Posted August 23, 2014 Well I put two safe in my backpack and run around like a crazy person, past out all the time, when I was passed out I could not open gear menu and after I waked up. All was fine Havoc302 1 Link to comment Share on other sites More sharing options...
Havoc302 Posted August 23, 2014 Report Share Posted August 23, 2014 Well I put two safe in my backpack and run around like a crazy person, past out all the time, when I was passed out I could not open gear menu and after I waked up. All was fine Awesome thanks, I'll drop it in. Link to comment Share on other sites More sharing options...
Havoc302 Posted September 1, 2014 Report Share Posted September 1, 2014 Got it working! Nice thanks guys. Is there any way to make it so they can still open their gear? I'd like players to be able to still drop the items that made them overburdened. Would I just leave out step 2? Step 2) Edit the following code into the fn_gearMenuChecks.sqf file at line 9 //Knockout Glitch Fix if ((player getVariable ["NORRN_unconscious", true])) exitWith { _display closeDisplay 1; //Let Zeds know [player,15,true,(getPosATL player)] spawn player_alertZombies; systemChat ( "You are unconscious." ); }; Link to comment Share on other sites More sharing options...
Havoc302 Posted September 5, 2014 Report Share Posted September 5, 2014 Getting the occasional issue where a player needs to bandage but can't because it's telling him he's unconscious when he's not, he's up and running around but bleeding. Link to comment Share on other sites More sharing options...
itsatrap Posted September 5, 2014 Report Share Posted September 5, 2014 Getting the occasional issue where a player needs to bandage but can't because it's telling him he's unconscious when he's not, he's up and running around but bleeding. Use the code in #15 Havoc302 1 Link to comment Share on other sites More sharing options...
Havoc302 Posted September 6, 2014 Report Share Posted September 6, 2014 So if I removed _display closeDisplay 1; players would still be able to open their gear? Because I want people to still be able to drop items from their gear if they're unconscious from running carrying too much. Link to comment Share on other sites More sharing options...
itsatrap Posted September 6, 2014 Report Share Posted September 6, 2014 well if people can open there gear they can use there bandage and glitch out, Link to comment Share on other sites More sharing options...
Havoc302 Posted September 6, 2014 Report Share Posted September 6, 2014 But I thought this if ((player getVariable ["NORRN_unconscious", true])) exitWith {systemChat ( "You are unconscious." );}; In each file stopped that? Link to comment Share on other sites More sharing options...
itsatrap Posted September 6, 2014 Report Share Posted September 6, 2014 I don't use the medic solution, since my script stops the bug. now I only have to mantain on file and not many Link to comment Share on other sites More sharing options...
SadBoy1981 Posted October 21, 2014 Report Share Posted October 21, 2014 When player after unconscious use bandage and almost same time push to walk, then AI dont see player becose in database player still stay on the ground as unconscious, after relog player are back where he get unconscious. So my players anyway use this bug, make hard missions and AI dont see players. Dont know how to fight with this.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now