• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

StayClear (No Sleeper Respawn) [A19 tested]

Any chance of an update? Really want to update to 19.6, but want to use this too. Lol
Thanks for using my mod! I'm not sure whether it works on 19.6, but I'd imagine it works on any A19 build. I was last using it on A19.4 I believe. I'd have to see about A20, though.

Can we only use DMT for this mod? I mean do a "build" only for this mod and leave my other mods in the game mods folder? I'm having issues with my other mods, DMT is updating things without my consent while my mods are working fine and don't need this. Also some of my mods are created by others and improved by me, I don't want DMT to come in there!

There is even a mod that is not supported by DMT at all "Admin Skill Points"


Hey. I really should work to include a better guide with this. You don't need to build the mod every time you want to play. If you are already using a version of the game that has DMT pre-applied, you can just drop the folder into your mods folder and it should work. Running a build is only necessary when you are trying to patch a client that does not have DMT enabled on it yet.

Awesome because of this DMT I tried to load a game when half of my mods were no longer installed, my save is screwed up, thanks guys really! I did not see that the build had not succeeded ... @%$#ing bogus the system ... 4et4e5ezhtfftdhz

And with the game launched on DMT we can no longer make screenshots, this tool is a game breaker. Please make this mod without the need for DMT !!!

Do I really have to run the game with DMT or just use build once and then I can run my game from steam?


I'm sorry for the inconvenience, but unfortunately 7 Days to Die does not expose any possible method of doing a mod like this without altering the code. Without DMT, I could provide modified files that you can copy over, but the problem with that is that not only would they only work for one version of the game (DMT gives you the power to keep your client up to date), but it would also not be compatible with any other mod that requires modifications to the code. DMT uses a system called Harmony which allows mods that require code modifications to work alongside one another. I'm sorry you had a hard time getting this working, but as I said above, you can just build once and your client should then be DMT-enabled, and you then should be good to go unless your client gets updated.

 
Last edited by a moderator:
ExtremeLurker said:
Thanks for using my mod! I'm not sure whether it works on 19.6, but I'd imagine it works on any A19 build. I was last using it on A19.4 I believe. I'd have to see about A20, though.
Please keep us posted, I would love to be able to use the mod for A20, happy to test it if necessary even though I'm not sure there is a easy way to that doesn't require me to wait in front of my screen lol.

 
Oh man, can't believe I've not come across this mod before. What a great idea! Got my fingers crossed you've the time/enthusiam to A20 it. The thought of clearing out a whole city has me excited - great job my friend.

 
This is the first I've played 7 days without this mod and I gotta say, boy do I miss it. Its one of those mods you forget you even started using then the game updates and you're like, "wait, what is this nonsense?" Absolutely love the concept of clearing out a place around your base or town or even a whole city (which is quite an undertaking really!) In A19 I tended to play in huge 16k dense city maps using Kinggen and it felt great carving little footholds of safety into the deadly landscape. Good fun. So, yeah, thanks for giving me all of those hours of enjoyment and +1 to a possible a20 update:)

 
Please keep us posted, I would love to be able to use the mod for A20, happy to test it if necessary even though I'm not sure there is a easy way to that doesn't require me to wait in front of my screen lol.


Thanks so much for your interest. As for what you can do to help test, all I recommend is using it normally once I release it and let me know if anything goes wrong, no need to trouble yourself with purposely testing it. I do my best to do that myself before I release stuff!

 

Oh man, can't believe I've not come across this mod before. What a great idea! Got my fingers crossed you've the time/enthusiam to A20 it. The thought of clearing out a whole city has me excited - great job my friend.


This is the first I've played 7 days without this mod and I gotta say, boy do I miss it. Its one of those mods you forget you even started using then the game updates and you're like, "wait, what is this nonsense?" Absolutely love the concept of clearing out a place around your base or town or even a whole city (which is quite an undertaking really!) In A19 I tended to play in huge 16k dense city maps using Kinggen and it felt great carving little footholds of safety into the deadly landscape. Good fun. So, yeah, thanks for giving me all of those hours of enjoyment and +1 to a possible a20 update:)
Thank you both for taking the time to post and express your interest. It always heartens me to hear of people who really enjoyed using the mod or people who are willing to try it out! I can confirm that I will be taking a look at this soon and will try to get a tested and confirmed working version out before the end of the year.

Absolutely love the concept of clearing out a place around your base or town or even a whole city (which is quite an undertaking really!)


 I can confirm it takes time and effort, but it's really fun! Glad you enjoyed it enough even to use in large maps like that. Thanks!

 
namespace StayClear
{

[HarmonyLib.HarmonyPatch(typeof(SleeperVolume))]
[HarmonyLib.HarmonyPatch("UpdatePlayerTouched")]
public class StayClear_SleeperVolume_UpdatePlayerTouched
{
static bool Prefix(ref ulong ___respawnTime, World _world)
{
___respawnTime = _world.worldTime + 120000UL;
return true;
}
}

public class StayClear : IModApi
{
void IModApi.InitMod(Mod _modInstance)
{
var harmony = new HarmonyLib.Harmony("io.stealthbit.7dtdmods.StayClear");
harmony.PatchAll();
}
}
}






Something like that should work after adding the relevant dll references. (Untested)

 
namespace StayClear
{

[HarmonyLib.HarmonyPatch(typeof(SleeperVolume))]
[HarmonyLib.HarmonyPatch("UpdatePlayerTouched")]
public class StayClear_SleeperVolume_UpdatePlayerTouched
{
static bool Prefix(ref ulong ___respawnTime, World _world)
{
___respawnTime = _world.worldTime + 120000UL;
return true;
}
}

public class StayClear : IModApi
{
void IModApi.InitMod(Mod _modInstance)
{
var harmony = new HarmonyLib.Harmony("io.stealthbit.7dtdmods.StayClear");
harmony.PatchAll();
}
}
}






Something like that should work after adding the relevant dll references. (Untested)


Hey, thanks. I received something similar from another user of the mod. The prefix method appears unaltered from v1.2.0 of my mod, the key difference here is the usage of IModApi instead of IHarmony. The thing is, using the built in Modding API only works on dedicated servers and not on single player or p2p multiplayer sessions, and I'd prefer not to distribute a version that's only for dedicated servers. In the past I've used my mod on dedicated servers provided the server has DMT enabled (the above code also requires DMT), and I'm going to see if I'm able to verify the same here. I need to download A20, check the updates to SleeperVolume, and ensure that nothing that's changed impacts my mod. Then I will test in game to ensure it works, and if so I will test on a dedicated server to ensure it works there as well, and then I'll share the result.

If anyone is wanting to use the mod right away, you can use the existing download link and apply it with DMT and maybe it will work as is.

 
I'm not the most knowledgeable person (like, at all) about this stuff, but would something like this help at all? Its what OCBmaurice has been using to get many of his DMT based mods working. Also, I know that Spherii has most of his DMT mods in a useable form over on his github here. It even has his core mod that a lot of things relied on. I don't know if any of that is even remotely useful but I thought I'd at least attempt to be helpful. I'm not trying to rush you or anything either, just sharing some info of an undetermined relevance or usefulness:)

 
The thing is, using the built in Modding API only works on dedicated servers and not on single player or p2p multiplayer sessions, and I'd prefer not to distribute a version that's only for dedicated servers.




Some of the c# stuff I was messing about with using the built in API worked in SP, but that was before it went stable, so I don't know if they changed something. Some mods were required client side and server side to work.

 
Some of the c# stuff I was messing about with using the built in API worked in SP, but that was before it went stable, so I don't know if they changed something. Some mods were required client side and server side to work.
IModApi is used to run C# on the server, and it only works on dedicated servers. You can find more information here:
https://7daystodie.fandom.com/wiki/ModAPI

You are right that some mods are required on the client side and the server side, I'd say that's most mods that do anything of substance, but DMT mods work on the server side as long as the server is DMT-enabled and the mod is placed in the "Mods" folder on the server. I know this because I regularly ran my mod on a dedicated server and only became aware of the IModApi method recently. While IModApi is a great method for mods that are strictly for dedicated servers, it's not the best option for this, where I'd prefer a solution that works for everyone :)

To be clear though, have you had success getting the mod to work on a dedicated server with the code you posted? Because if so, it likely means that I won't have to do much if anything to get it to work besides just testing and verifying it for everyone, and posting a guide for how to get it working.

I'm not the most knowledgeable person (like, at all) about this stuff, but would something like this help at all? Its what OCBmaurice has been using to get many of his DMT based mods working. Also, I know that Spherii has most of his DMT mods in a useable form over on his github here. It even has his core mod that a lot of things relied on. I don't know if any of that is even remotely useful but I thought I'd at least attempt to be helpful. I'm not trying to rush you or anything either, just sharing some info of an undetermined relevance or usefulness:)


Thank you for linking me to this tool. I wasn't aware of it. I don't think it will be necessary, but it appears to be a way of loading DMT mods without modifying the actual client files themselves in the way that the DMT patcher tool does. This is not very relevant to this project specifically, as it is a tool to be used by people using mods, not people trying to create them, as it gives users another avenue for applying their mod, one which would appear to be less prone to being affected by game updates that require you to re-patch your client each time. Even so, I'm happy you shared it with me because it's a very cool thing to be aware of. I didn't know there was another way to use DMT mods. I wonder if this would also work for p2p and dedicated servers. I'll need to try it out sometime in the future.

Also, I'm aware of Spherii's github, I do check it out sometimes and it has helped me learn a few things on my journey of learning about modding! I'll certainly give it a look if I run into serious issues as you say that he's been getting DMT stuff working on A20. Thanks for all the info.

 
Last edited by a moderator:
The thing is, using the built in Modding API only works on dedicated servers and not on single player or p2p multiplayer sessions, and I'd prefer not to distribute a version that's only for dedicated servers.
I've recently adapted WalkerSim for A20 and IModApi + Harmony is working fine in SP.
https://github.com/RagnarHbUa/7d2dWalkerSim/blob/master/src/API.cs#L31
https://github.com/RagnarHbUa/7d2dWalkerSim/blob/master/src/Hooks.cs#L16

Another mod I've been using fine in SP, that is created in vanilla A20 dll mod way
https://github.com/ZehMatt/7dtd-HeadshotTime/blob/master/HeadshotTime/Mod.cs#L76

IModAPi is for the game to see your dll mod at all. And still you can use Harmony to mutate the insides of original game. No problem.

 
Last edited by a moderator:
I've recently adapted WalkerSim for A20 and IModApi + Harmony is working fine in SP.
https://github.com/RagnarHbUa/7d2dWalkerSim/blob/master/src/API.cs#L31
https://github.com/RagnarHbUa/7d2dWalkerSim/blob/master/src/Hooks.cs#L16

Another mod I've been using fine in SP, that is created in vanilla A20 dll mod way
https://github.com/ZehMatt/7dtd-HeadshotTime/blob/master/HeadshotTime/Mod.cs#L76

IModAPi is for the game to see your dll mod at all. And still you can use Harmony to mutate the insides of original game. No problem.
I'm not sure I understand. IModApi was created specifically for adding functionality to dedicated servers, such as slash commands. Did they change this with A20? (yes they did, see edit) If so, are you aware of any information I can read documenting the change (seeing as the current wiki is outdated)? Harmony is not something that works out of the box. Are they including Harmony as a part of the game? (yes they are, see edit)

DMT uses Harmony, which uses the IHarmony interface for classes exposing a Start method that gets executed when your mod is being loaded. I have looked at many DMT mods from the community and they all tend to work that way. This is the first time I'm seeing the IModApi interface being used outside of dedicated servers, I've just not come across it before personally because that's not what it was intended for, though I don't know when that changed 🤔

Looking at SphereII's github, it looks like when moving from A19 to A20, he switched from using DMT's IHarmony hook to the IModApi method. I'm going to search for more information about this change.

EDIT:
I've just read that Harmony is now included in the game? This is VERY exciting. DMT is now being phased out. When I'd read about the updates in A20, I've not yet seen anything about this, but this is very significant. Thank you very much for pointing this out to me.

I will still like to test and verify that it works on both SP and dedicated servers, but yes, it seems like C# modding support is now officially supported on the client using Harmony without needing any sort of patcher, which makes me very confused about what the necessity of something like BepInEx is, but excited all the same. Perhaps the need for BepInEx is now only for when you need to do something that requires more than Harmony is capable of.

 
Last edited by a moderator:
I couldn't find any official info about how to make mods for A20, so I spent the whole day looking for fresh mods for A20 and experimenting myselft.
You now just need some class in your dll to implement IModApi, then the whole dll in the root of your mod's directory (same level with ModInfo.xml) would be loaded. I've created new console command this way: 
public class ConsoleCmdCompleteTrackedQuest : ConsoleCmdAbstract
{

// Actual usefull code of new cmd. Due to inheritace of ConsoleCmdAbstract, this command would be loaded on startup (game uses reflection to find heirs of ConsoleCmdAbstract).

}

public class CompleteTrackedQuest : IModApi
{
    void IModApi.InitMod(Mod _modInstance)
    {
        // Empty, just for the game to see the mod
    }
}

 
I couldn't find any official info about how to make mods for A20, so I spent the whole day looking for fresh mods for A20 and experimenting myselft.
You now just need some class in your dll to implement IModApi, then the whole dll in the root of your mod's directory (same level with ModInfo.xml) would be loaded. I've created new console command this way: 
public class ConsoleCmdCompleteTrackedQuest : ConsoleCmdAbstract
{

// Actual usefull code of new cmd. Due to inheritace of ConsoleCmdAbstract, this command would be loaded on startup (game uses reflection to find heirs of ConsoleCmdAbstract).

}

public class CompleteTrackedQuest : IModApi
{
    void IModApi.InitMod(Mod _modInstance)
    {
        // Empty, just for the game to see the mod
    }
}


Before A20, this would have only worked for dedicated servers, and you'd still have had to use DMT to patch the dedicated server's assembly, should you be wanting to use Harmony. This is a much easier system now and now consumers don't have to use a patcher now that Harmony is shipped with the game and the InitMod hook works on the game client and not just the server. Definitely a big step forward! Thanks again for opening my eyes to this.

Now I just need to figure out how to get a project setup to be able to build. I'd prefer to use VSCode as opposed to Visual Studio. SphereII has put together an example project and a tutorial video, I should be able to use that in order to set something up, but I obviously will have no time for that today, as I won't be home, given the holiday.

 
Last edited by a moderator:
It looks like we might not need a Moddlet for A20 to disable sleepers respawn ONLY IF you play with loot disabled like I do, see here: https://steamcommunity.com/app/251570/discussions/0/3196990777799400614/?tscn=1640041856#c3196990777799923728


I had seen something like this talked about on these forums, and while it's cool that zombie respawn is now tied to loot respawn, you still cannot disable zombie respawn in the current version. If you set loot respawn to disabled, zombies will still respawn in a POI that has been cleared and not visited for 30 days. I have just finished testing to verify that. I have not yet reviewed the changes in the code for SleeperVolume, but I will try to do so tomorrow. Hoping to release something soon seeing as it would appear the mod is still necessary.

 
I have reviewed the changes to SleeperVolume, and as I suspected, it does set the respawn time to whatever is set for loot respawn, and if loot respawn is disable, it sets it to 30 days.

Also, I got around to setting up the project for the new A20 system, updating the code, and testing it out as best as I can. I have only tested it out on singleplayer, however, but I I know someone who has tried it out on a server as well. I'll do some more testing when I get a chance, but I wanted to create a release as soon as I could. I've created a new thread for it here. Enjoy!

 
Back
Top