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

DMT Modding Tool

Status
Not open for further replies.
Thank you Sphereii ! It is now working, but I have a few questions!

1) I just dowloaded the v1.4. Its assistant installed the lastest 1.5 and this created an error. However it is now working. Where can I find the lastest release directly ?

2) It worked without downloading your mods again. Were there no reference to Localization - Quest.txt in mods, but only in the tool ?

3) After my first compilation error, I did delete the Backup subfolder in the tool's folder to be able to compile again. Was it necessary ? What is the good practice after a compile error in the tools ?

4) How to you know the classes / methods to alter ? Are there some documentation on the base dll of the game ? Is the source code available, where ? Is there introspection in C# ? To start with, I will look for methods to create and remove blocks and entitites from the game.

5) What editor do you recommend for C# ? Do I need an editor for .NET framework ?

Thank you !

 
Last edited by a moderator:
Thank you Sphereii ! It is now working, but I have a few questions!
1) I just dowloaded the v1.4. Its assistant installed the lastest 1.5 and this created an error. However it is now working. Where can I find the lastest release directly ?

2) It worked without downloading your mods again. Were there no reference to Localization - Quest.txt in mods, but only in the tool ?

3) After my first compilation error, I did delete the Backup subfolder in the tool's folder to be able to compile again. Was it necessary ? What is the good practice after a compile error in the tools ?

4) How to you know the classes / methods to alter ? Are there some documentation on the base dll of the game ? Is the source code available, where ? Is there introspection in C# ? To start with, I will look for methods to create and remove blocks and entitites from the game.

5) What editor do you recommend for C# ? Do I need an editor for .NET framework ?

Thank you !
Hi Umbrella,

1) The source (and releases) can be found on the GitHub page linked in the OP

2) The versions of DMT built after A18 released should ignore localisation (you'll see a warning in the output along those lines)

3) No, don't delete the backup folder. If you do then verify the game files in steam. When DMT runs a build and it doesn't have a backup it copies the vanilla files into the backup so it always has them available. Once you do a build the Assembly-CSharp.dll is replaced and can't be used as a backup.

4) There's no documentation, it's just having a look at the code and figuring things out. dnSpy is a good one to dig through the DLL. Guppy's Discord is where a lot of the modders hang out and can answer questions.

5) Visual Studio or Visual Studio code as an IDE for when you're creating scripts.

Cheers,

Hal

 
Hi Hal, thank you very much !

Also, when I uncheck all mods and press build, then launch game from steam, the game freezes at startup.

Is that normal ? How should I restore the initial game state ?

 
Last edited by a moderator:
Hi Hal, thank you very much !
Also, when I uncheck all mods and press build, then launch game from steam, the game freezes at startup.

Is that normal ? How should I restore the initial game state ?
Yes that's normal. Once you build with DMT the DLL gets rewritten so EAC (the anticheat engine) sees it as changed and doesn't let you load the game. You can start the game through steam without EAC and play as normal, start the game through DMT which uses the non-eac version or verify your game files in steam and it will reset the game back to vanilla.

 
DMT not recognizing all the mods in my mod folder

A big benefit of using Harmony is that it allows run-time patches. The Harmony DLLs we make are under the Mods folder, and are loaded every time the game is started. If players found they like a lot of different modlets, then can add and remove them at their leisure, without having to go through the DMT build process.
They are also easier and cleaner to write.
I'm hoping someone can help me with my issue. DMT is not recognizing all the mods in my mod folder. I have 9 mods in there, it only recognizes and displays 4 of them. I can refresh mods and it makes no difference. I copied and renamed my mod folder, went into settings and selected the new folder, and still only the 4 mods are recognized. For some background: I had the game running earlier, perfectly I think, then I deleted a backpack mod that I didn't like, loaded a better one into the mod folder, started up DMT again and told it to build, but now it only displays the 4 mods. the new mod is not shown. I booted into the game, game was bugged, and now I can't open any lootboxes in game. I'm guessing because one of the mods I previously had installed had added extra content into the game, now that that mod is no longer recognized, it seems to have thrown a serious wrench into the works. I just downloaded harmony separately from DMT hoping that I could get some results, but have no idea how to actually get harmony functioning as there is no executable file.

 
So with adding DMT Mods, do i hjave to also build it for the servers or is it just safe to have the mods on the server? is it just clientside only?

 
Hi, I have used SDX to install some mods in the past and had no problems so far. Now with A18.3 experimental, I tried the new DMT, but run into some serious issues. I always got the Error: „Could not load file or assembly 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies“ after starting the game, but I fixed it by manually copying all 4 Mono.Cecil.dll and Newtonsoft.Json.dll to managed.

This happen even with a DMT compile alone without any mods selected.

Now the game starts without errors to the main menu, but on entering the game world all animals and zombies can not move anymore (but can still attack, if I get close). The console puts the following error constantly:

There are no graphs in the scene

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 48)

This occurs even with just DMT without additional mods installed and goes away if DMT is removed. I verified the game cache and installed DMT multiple times without success.

Maybe Alpha 18.3 broke the tool? I hope this can be resolved.

Thank you very much for your time and efforts to make modding in this game better!

 
Hi, I have used SDX to install some mods in the past and had no problems so far. Now with A18.3 experimental, I tried the new DMT, but run into some serious issues. I always got the Error: „Could not load file or assembly 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies“ after starting the game, but I fixed it by manually copying all 4 Mono.Cecil.dll and Newtonsoft.Json.dll to managed. This happen even with a DMT compile alone without any mods selected.

Now the game starts without errors to the main menu, but on entering the game world all animals and zombies can not move anymore (but can still attack, if I get close). The console puts the following error constantly:

There are no graphs in the scene

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 48)

This occurs even with just DMT without additional mods installed and goes away if DMT is removed. I verified the game cache and installed DMT multiple times without success.

Maybe Alpha 18.3 broke the tool? I hope this can be resolved.

Thank you very much for your time and efforts to make modding in this game better!

 
Hi, I have used SDX to install some mods in the past and had no problems so far. Now with A18.3 experimental, I tried the new DMT, but run into some serious issues. I always got the Error: „Could not load file or assembly 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies“ after starting the game, but I fixed it by manually copying all 4 Mono.Cecil.dll and Newtonsoft.Json.dll to managed. This happen even with a DMT compile alone without any mods selected.
Now the game starts without errors to the main menu, but on entering the game world all animals and zombies can not move anymore (but can still attack, if I get close). The console puts the following error constantly:

There are no graphs in the scene

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 48)

This occurs even with just DMT without additional mods installed and goes away if DMT is removed. I verified the game cache and installed DMT multiple times without success.

Maybe Alpha 18.3 broke the tool? I hope this can be resolved.

Thank you very much for your time and efforts to make modding in this game better!
Maybe you are missing some extra libraries? I've been using DMT on 18.3 and haven't experienced the issue. Maybe the install is confused?

 
I've wiped everything from my hard drive and installed again from scratch. Now I tried DMT with this mod combination:

0-SphereIICore

SphereII Food Spoilage

SphereII Music Boxes

Xyth Bandits

This bring up 2 compile errors:

c:\Progs\Steam\steamapps\common\7 Days To Die\DMT_Mods\0-SphereIICore\Scripts\MusicBoxes\MusicBox.cs(121,40): error CS0117

and...

c:\Progs\Steam\steamapps\common\7 Days To Die\DMT_Mods\0-SphereIICore\Scripts\Blocks\BlockMortSpawner.cs(187,9): error CS0023

Failed to compile Mods.dll

Build failed

Compiling without mods worked without errors and I am not getting DLL errors anymore and my animals and zombies can move again and are no longer stuck.

Now it works I guess, only these 2 compile errors are left so solve. Since the core mod belong to you, maybe you can help me out fix the problem? I never fully learned C++ and have only some basic programming knowledge.

Thank you very much.

 
I've wiped everything from my hard drive and installed again from scratch. Now I tried DMT with this mod combination:
0-SphereIICore

SphereII Food Spoilage

SphereII Music Boxes

Xyth Bandits

This bring up 2 compile errors:

c:\Progs\Steam\steamapps\common\7 Days To Die\DMT_Mods\0-SphereIICore\Scripts\MusicBoxes\MusicBox.cs(121,40): error CS0117

and...

c:\Progs\Steam\steamapps\common\7 Days To Die\DMT_Mods\0-SphereIICore\Scripts\Blocks\BlockMortSpawner.cs(187,9): error CS0023

Failed to compile Mods.dll

Build failed

Compiling without mods worked without errors and I am not getting DLL errors anymore and my animals and zombies can move again and are no longer stuck.

Now it works I guess, only these 2 compile errors are left so solve. Since the core mod belong to you, maybe you can help me out fix the problem? I never fully learned C++ and have only some basic programming knowledge.

Thank you very much.
Those two errors are from building the mod against 18.3. they will need a patch before they'll work with that experimental

 
Hello,

I have server on G-Portal hosting, how i can use dmt on it?

Nevermind i made what i want :)

 
Last edited by a moderator:
For anyone else with the above question,

1) Download the 7 Days To Die Dedicated version through Steam, under Tools

2) In DMT, click on Settings and Add Game Location, pointing to the Dedicated version

3) Build as normal

4) Using an FTP software, upload the following files and folders:

Code:
   7DaysToDieServer_Data/Managed/Assembly-CSharp.dll
   7DaysToDieServer_Data/Managed/DMT.dll
   7DaysToDieServer_Data/Managed/0-Harmony.dll
   7DaysToDieServer_Data/Managed/Mods.dll
   Mods/
If your server host does not allow you to replace Assembly-CSharp.dll, then that server host does not support DMT mods.

 
Solved: Harmony doesn't seem able to patch static methods.

Besides, my requirement meant checking the instance type, which isn't possible in a static method.

I solved this by patching a different, non-static method to achieve what I wanted to do


Is there something special I need to do to patch static methods?

Take this example

Code:
class Tim_Test {
   public class Tim_Test_Init : IHarmony {
       public void Start () {
           Debug.Log (" Loading Patch: " + this.GetType ().ToString ());
           var harmony = HarmonyInstance.Create (GetType ().ToString ());
           harmony.PatchAll (Assembly.GetExecutingAssembly ());
       }
   }

   [HarmonyPatch (typeof (BlockPoweredDoor))]
   [HarmonyPatch ("Init")]
   public class Tim_BlockPoweredDoor_Init {
       public static bool Prefix (BlockPoweredDoor __instance) {
           Debug.Log ("Type: " + __instance.GetType ().Name);
           return true;
       }
   }

   [HarmonyPatch (typeof (BlockPoweredDoor))]
   [HarmonyPatch ("IsDoorOpen")]
   public class Tim_BlockPoweredDoor_IsDoorOpen {
       public static bool Prefix (BlockPoweredDoor __instance) {
           Debug.Log ("Type: " + __instance.GetType ().Name);
           return true;
       }
   }
}
In this case, the patch for "Init" works, as the log can be seen in the console, however the patch for "IsDoorOpen", does not, as under no circumstance does a log appear in the console (placing, turning on power, etc).

The only difference between the two methods is vanilla "Init" is:

Code:
public override void Init()
whereas vanilla "IsDoorOpen" is:

Code:
public static bool IsDoorOpen(byte _metadata)

Any help pointing me in the right direction would be greatly appreciated

 
Last edited by a moderator:
Status
Not open for further replies.
Back
Top