Jump to content

[A15] Working Beds and Sleep


Carlzilla

Recommended Posts

This adds a need for sleep to the game, and makes beds a usable object for sleeping.

 

The mod contains a series of buffs that confer bonuses or penalties depending on how rested you are. There are 5 states:

 

Well Rested - You receive a movement and stamina boost. Lasts 6 hours. Active after getting at least 6 hours of sleep.

 

Normal - You receive no bonuses or penalties. Last 10 hours. Active after getting woken up after between 3 and 5 hours of sleep or after well rested wears off. There is no notification for the normal state.

 

Tired - You incur a 20% movement penalty. Lasts 8 hours. Active if you slept for less than 6 hours and were previously exhausted, or after Normal wears off.

 

Exhausted - You incur a 50% movement penalty and a stamina hit. Lasts 5 hours. Active after Tired wears off or you wake up from a passed out state.

 

Passed Out - You are asleep on your feet. You incur a 100% movement penalty and a complete stamina loss. Lasts 1 hour. Upon reviving you will be in an exhausted state. You do NOT want to enter this state, you're basically a sitting duck for zombies.

 

Different levels of beds offer different boots to your stamina, core temp, and wellness by "resting" on them. To rest on a bed simply hang out on top of one. You do not need to activate the sleep option to receive the resting bonuses.

 

You can sleep on the beds in two different ways, first, you can hit the <use> key while looking at a bed, or second you can stand on top of the bed and hit the 5 key on your NumPad. Doing either of these will allow you to sleep. There's a chance that your sleep will be interrupted by zombies, and you'll be notified of how much sleep you received. If you got 4 hours or more of sleep, you will not be able to sleep again for 16 hours. If you were interrupted before the 4 hour mark, you may sleep again immediately after dealing with the intruding zombies. A full night's sleep fully restores your health and your stamina, gives you a .25 boost to wellness, and moves the game time ahead 8 hours. Anything less than 8 hours will give you a percentage of those boosts based on the number of hours you slept. If you aren't sure when you can sleep again, stand on top of the bed and press 6 on your NumPad this will tell you when you last woke, and when you can sleep again.

 

If you slept through a horde night (dog horde included), the script will trigger a wandering horde upon waking just to attempt to re-add some difficulty. I know that some people are going to view the ability to sleep through feral hordes as cheating...but it's up to the player how to play, and I personally hate the idea of omniscient feral hordes.

 

The mod is fully configurable through a small text file in the save game directory (on windows it's %appdata%\7DaysToDie\Saves\<either navesgane or random gen>\<world game name>\sleep.cfg), it will be created once the game is run once with the mod active.

 

This file will have descriptions of each line in the file, and only the first 6 lines matter (the others are just descriptions).

 

Here's what you can change

Line 1: the 1 in X chance you will be interrupted in your sleep by zombies. 5 means it's a 1 in 5 chance

Line 2: the minimum number of zombies to spawn during an interruption event.

Line 3: the zero based maximum number of zombies to spawn during an interruption event. Zero based means you start counting from zero, so 4 is actually 3.

Line 4: the name of the entity group (as defined in entitygroups.xml) from which to choose the interrupting zombies from.

Line 5: the MAXIMUM distance from the bed in which to spawn zombies...even with this set high they can literally spawn right on top of you, and trust me, it's terrifying when it happens.

Line 6: if this is 1, all the hordes the script spawns (not interrupting zombies, but the wandering hordes that replace the night hordes if you sleep through a horde night) will be feral (even in the daytime), if this is anything else, they will be normal wandering hordes.

 

Download:

https://www.mediafire.com/?cbrcfrrnrf4vxjh

 

*** THIS MOD IS SINGLE PLAYER ONLY *** I WILL NOT HELP YOU TROUBLESHOOT MULTIPLAYER ISSUES!***

Link to comment
Share on other sites

Because it advances time, there's no way to get this work on a MP server in the way I intended it. Otherwise every time someone slept it would throw the server forward up to 8 hours. That said, I'm not saying that it won't work, it might "work", but it would definitely be jarring to players to have the times changing constantly.

 

I could remove that part, and leave in the sleeping buffs, which should theoretically make it work in MP, but in my opinion it would completely kill immersion to "sleep for 8 hours" and have it be the exact same time as when you went to bed...

 

...as a general rule, I write for single player, because it's what I play. If the things I write work on multiplayer, that's great, and I'm happy they do, but unless specifically requested, I don't really consider whether or not it's going to work on MP servers or not.

Link to comment
Share on other sites

Because it advances time, there's no way to get this work on a MP server in the way I intended it. Otherwise every time someone slept it would throw the server forward up to 8 hours. That said, I'm not saying that it won't work, it might "work", but it would definitely be jarring to players to have the times changing constantly.

 

I could remove that part, and leave in the sleeping buffs, which should theoretically make it work in MP, but in my opinion it would completely kill immersion to "sleep for 8 hours" and have it be the exact same time as when you went to bed...

 

...as a general rule, I write for single player, because it's what I play. If the things I write work on multiplayer, that's great, and I'm happy they do, but unless specifically requested, I don't really consider whether or not it's going to work on MP servers or not.

 

Oh i wasnt having a go at you this is a great mod :-). and yes I understand bout the mp and throwing everything out makes full sense.

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...
  • 5 months later...
  • 10 months later...
  • 4 weeks later...
  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...