Krixes - Tent Sleep Healing Script

Krixes

Moderator
Staff member
Krixes - Tent Sleep Healing Script
Version 1.1

All of the edits can be done in player_sleep.sqf under the Config area!

This video was made by BetterDeadThanZed and shows the mod in use.

Change Log 1.1:
  1. Made some minor tweaks in the code
  2. Lowered quality of the snoring for smaller file size (it still sounds good :p)
Change Log 1.0:
  1. Added sleep cooldown timer
  2. Added a snoring sound
  3. Added a variable for changing amount of blood restored when sleeping
Please like this post if you like and it works for you, it would be appreciated!

Please post questions, comments and suggestions below!


Installation Instructions For new dayz_mission.pbo:
Open your dayz_mission.pbo and find init.sqf

add this just before progressLoadingScreen 1.0;
Code:
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
Now create a folder in your dayz_mission.pbo called custom and create a new empty file called compiles.sqf inside.

Edit the compiles.sqf to look like this.....
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";            // fnc_usec_selfActions - adds custom actions to dayz code
add the fn_selfActions.sqf to your custom folder.

Now open your description.ext file and add this to the very bottom under everything else.....
Code:
class CfgSounds
{
    sounds[] = {};
 
    class playerSnoring
    {
    name="playerSnoring";
    sound[]={\custom\sfx\snoring.ogg,0.9,1};
    titles[] = {};
    };
};
Now create another folder called sfx INSIDE your custom folder you made earlier and place the file snoring.ogg inside it.

Now lastly add the attached player_sleep.sqf into your custom folder.

Go in game place or find a tent that belongs to you and select sleep!


Installation Instructions For existing custom dayz_mission.pbo and fn_selfActions.sqf:
Open your dayz_mission.pbo

Create a new folder called custom in your dayz_mission.pbo and add my player_sleep.sqf to the custom folder you just created!

open your fn_selfActions.sqf in YOUR dayz_mission.pbo and locate this line....
Code:
s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",cursorTarget, 0, false, true, "",""];
Change it to look like this........
Code:
s_player_sleep = player addAction [localize "str_actions_self_sleep", "custom\player_sleep.sqf",cursorTarget, 0, false, true, "",""];
Now open your description.ext file and add this to the very bottom under everything else.....
Code:
class CfgSounds
{
    sounds[] = {};
 
    class playerSnoring
    {
    name="playerSnoring";
    sound[]={\custom\sfx\snoring.ogg,0.9,1};
    titles[] = {};
    };
};
Now lastly create another folder called sfx INSIDE your custom folder you made earlier and place the file snoring.ogg inside it.

For those of you running Taviana or any mod that does not originally have the "Sleep" option on tents or the Sleep is somehow already custom do to the mod you will need to change this line in fn_selfActions.sqf.....
Code:
s_player_sleep = player addAction [localize "str_actions_self_sleep", "custom\player_sleep.sqf",cursorTarget, 0, false, true, "",""];
To this......
Code:
s_player_sleep = player addAction ["Sleep", "custom\player_sleep.sqf",cursorTarget, 0, false, true, "",""];
Have Fun,
Krixes
 

Attachments

Top