How to get Tent Sleep and Self-Bloodbag working?

Strollo

Member
Is there a trick to get both scripts working?

I got the Self-Bloodbag script working, but for some reason I can't get the Tent Sleep script working. Ironically, the installation (for both) is almost identical, and yet I'm still having difficulty. LOL

The Tent Sleep option does appear as an option/action, but for some reason it doesn't actually do anything. It's as if it doesn't know what to do -- once the option has been selected. There's NO animation or anything that follows. I've even tried executing the script -- looking at the tent from various different angles and still no luck.

I don't get any errors when loading up the server, and it hasn't been interfering with the Self-Bloodbag script, as it is working perfectly fine... My zombies and loot are spawning fine as well.

Has anybody else run into this issue?
 
Could a syntax error be causing this?

In the instructions that Krixes provided, I noticed that he wants people to add the following line to their fn_selfActions.sqf file:
s_player_sleep = player addAction ["Sleep", "custom\player_sleep.sqf",cursorTarget, 0, false, true, "",""];

But if you read through the other lines contained in fn_selfActions file, you'll notice that most of the lines use a _cursorTarget (with an underscore). Could this missing underscore be the reason why my script isn't working?
 
All _cursorTarget is is a variable'd cursorTarget command.

If you have the option coming up, my guess would be that your script is not in the right location.

Of course with any script install, check your RPT log for errors.
 
Hey thanks Vampire!

Changing cursorTarget to _cursorTarget didn't seem to do anything.. Although, since all the other lines (in my selfactions file) show it's use with an underscore, I'm going to follow suit and include the underscore -- for consistency.

I don't think the script's path is the problem, but then again, what do I know? I'm the one with the problem here... lol

I'm trying to keep all my add-ons in the same folder. In my case, I'm putting everything in a folder called /scripts/. My self bloodbag script is located in the same folder, and its working fine and dandy, but for some reason, the tent sleep script doesn't. I even tried starting from scratch, and tried to install the script without any other scripts, and still... no luck.

Here is the sleep section of my fn_selfActions.sqf file:

//Sleep
if(_cursorTarget isKindOf "TentStorage" and _canDo and _ownerID == dayz_characterID) then {
if ((s_player_sleep < 0) and (player distance _cursorTarget < 3)) then {
s_player_sleep = player addAction ["Sleep", "scripts\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_sleep;
s_player_sleep = -1;
};


These are the files in my ../MPMissions/dayz_1.chernarus/scripts/ folder:
* /sfx/snoring.ogg
* compiles.sqf
* fn_selfActions.sqf
* player_selfbloodbag.sqf
* player_sleep.sqf

Oh.. And I also modified the description.ext file. I added the following - so that it points to the correct folder when trying to play the audio file..

class CfgSounds
{
sounds[] = {};
class playerSnoring
{
name="playerSnoring";
sound[]={\scripts\sfx\snoring.ogg,0.9,1};
titles[] = {};
};

};

According to the tutorial, that should be all that's required.
 
I don't see what would be causing it not to work in your RPT. Not really sure why it isn't working.
 
As I said... I've even started from scratch, with no scripts at all, and have tried to install this script exactly as Krixes outlined in his tutorial, and it still doesn't work. I get the same results. I see the option.. I execute the option.. Nothing happens. No animation. No blood increase. No snoring. No nothing... It's almost as if DayZ doesn't know how to sleep. Perhaps "Sleeping" is not an option on my version of DayZ. Weird, huh?
 
As I said... I've even started from scratch, with no scripts at all, and have tried to install this script exactly as Krixes outlined in his tutorial, and it still doesn't work. I get the same results. I see the option.. I execute the option.. Nothing happens. No animation. No blood increase. No snoring. No nothing... It's almost as if DayZ doesn't know how to sleep. Perhaps "Sleeping" is not an option on my version of DayZ. Weird, huh?

Well I would assume like I said before that it couldn't find the script, but you have the files there, and the RPT isn't saying it couldn't find a script, really not sure what's happening.
 
That's how it's behaving... It's as if DayZ doesn't know what to do once the command has been envoked....

So.... This leads me to believe that there is either something wrong with the player_sleep.sqf file, OR the internal files (regarding sleep) have changed so much in version 1.8.0.3 that the Krixes script no longer works.
 
I'm not positive, but I think it's because your calling two different compiles.sqf in your init.sqf. When you do this, one cancels out the other.

What I would do is cut and paste the original compiles.sqf from the dayz_code.pbo into your custom folder in the mission.pbo, overwriting the one you have in there now, and call your custom selfactions from the custom compiles you have placed in your custom folder. Mine looks like this;

fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf"; //Checks which actions for nearby casualty
fnc_usec_selfActions = compile preprocessFileLineNumbers "scripts\fn_selfActions.sqf"; //Checks which actions for self
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";

So again, this would be in your custom compiles.sqf, that you placed in your mission.pbo.

I'm not sure how well I explained this but if you have any other questions, I'll try to answer, unless someone beats me to it lol.
This is what I have for tons of self actions scripts, like self blood, drink water source etc. So hopefully it does you some good
 
I'm not positive, but I think it's because your calling two different compiles.sqf in your init.sqf. When you do this, one cancels out the other.

What I would do is cut and paste the original compiles.sqf from the dayz_code.pbo into your custom folder in the mission.pbo, overwriting the one you have in there now, and call your custom selfactions from the custom compiles you have placed in your custom folder. Mine looks like this;

fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf"; //Checks which actions for nearby casualty
fnc_usec_selfActions = compile preprocessFileLineNumbers "scripts\fn_selfActions.sqf"; //Checks which actions for self
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";

So again, this would be in your custom compiles.sqf, that you placed in your mission.pbo.

I'm not sure how well I explained this but if you have any other questions, I'll try to answer, unless someone beats me to it lol.
This is what I have for tons of self actions scripts, like self blood, drink water source etc. So hopefully it does you some good


To tell you the truth, I've tried installing these scripts a handful of ways... I even tried using the original files in DayZ code (compiles.sqf and and the fn_selfActions file). I copied them over to my /scripts/ folder, tweaked the init.sqf (so that it pointed to my new custom compiles file) and then tweaked my custom compiles file so that it points to my custom fn_selfActions file. I still get the same results... and they're not good. lol Below is my mission .pbo when I try doing it that way.

http://uppit.com/zq0bme9iu385/dayz_1.chernarus.rar
 
So the only mistakes I see (and these may not be game breaking) in that .pbo is in your selfActions.sqf you have this;

s_player_sleep = player addaction - the 'a' in action isn't capitalized (I doubt this is a problem tbh but never know)

The second thing is the class CfgSounds should be between RscPicture and RscLoadingText in your description.ext.

I could be mistaken. That's all I really see wrong though. Other than that my best guess is that the script is now out dated.

I'll see if I can get it working on my server in a little bit and see what I can make of it.
 
Wildwookie gave me a working .pbo. Using these files, I was able to get self bloodbag script working, tent sleep working, and the strip vehicle parts working. Although, I did have to tweak some things. First, I had to add a line to load the default loadscreen.paa. Then I had to add player_sleep.sqf to to the /custom/ folder. Next I had to add the snoring.ogg file to my /custom/sfx/ folder, and poof! It all worked! I'm gonna do some investigating -- to find out how his works and why mine doesn't... lol

Here, take a look at wookie's work:
https://dl.dropboxusercontent.com/u/73434581/dayz_5.chernarus.rar
 
Back
Top