Jump to content

DMT Modding Tool


HAL9000

Recommended Posts

On 4/10/2021 at 8:37 AM, HAL9000 said:

 

... The good news is that DLL doesn't even need to be in the release any more. DMT stopped relying on the game's DLL a while ago, I just need to update my code for building a release. ...

Wait...so what you're saying is, that one won't have to continuously re-assemble it every time they want to add a mod that requires DMT?

If so, I like it & can't wait for your new release LOL.

Link to comment
Share on other sites

On 6/3/2021 at 6:26 PM, Hayran said:

Hi, I need build my DMT mods all time I playing the game or just one time?

 

You only need to build the first time, rebuild when you add more mods or the game releases an update

 

On 6/3/2021 at 11:05 PM, Pra3t0r 0f R0m3 said:

Wait...so what you're saying is, that one won't have to continuously re-assemble it every time they want to add a mod that requires DMT?

If so, I like it & can't wait for your new release LOL.

 

Alas no, I meant the game used to use code in the Assembly-CSharp.dll to make the builds. It doesn't do that any more so it doesn't need to be there. 

Link to comment
Share on other sites

Can anyone give me an example of a patch script that replaces an existing method with my own code? I'm trying to add my code in BlockPowerDoor.ActivateBlock but it keeps coming up like this, I get basically the same result when trying to add new methods as well, I can create the method but cant put anything in it.

 

// BlockPoweredDoor
public override bool ActivateBlock(WorldBase _world, int _cIdx, Vector3i _blockPos, BlockValue _blockValue, bool isOn, bool isPowered)
{
    //IL_0006: Expected I4, but got O
    return ((BlockPoweredDoorPatchFunctions)/*Error near IL_0006: Stack underflow*/).ActivateBlock_Patch((WorldBase)/*Error near IL_0006: Stack underflow*/, (int)/*Error near IL_0006: Stack underflow*/, (Vector3i)/*Error near IL_0006: Stack underflow*/, (BlockValue)/*Error near IL_0006: Stack underflow*/, (byte)/*Error near IL_0006: Stack underflow*/ != 0, (byte)(int)this != 0);
}

 

Link to comment
Share on other sites

6 minutes ago, three08 said:

Can anyone give me an example of a patch script that replaces an existing method with my own code? I'm trying to add my code in BlockPowerDoor.ActivateBlock but it keeps coming up like this, I get basically the same result when trying to add new methods as well, I can create the method but cant put anything in it.

 


// BlockPoweredDoor
public override bool ActivateBlock(WorldBase _world, int _cIdx, Vector3i _blockPos, BlockValue _blockValue, bool isOn, bool isPowered)
{
    //IL_0006: Expected I4, but got O
    return ((BlockPoweredDoorPatchFunctions)/*Error near IL_0006: Stack underflow*/).ActivateBlock_Patch((WorldBase)/*Error near IL_0006: Stack underflow*/, (int)/*Error near IL_0006: Stack underflow*/, (Vector3i)/*Error near IL_0006: Stack underflow*/, (BlockValue)/*Error near IL_0006: Stack underflow*/, (byte)/*Error near IL_0006: Stack underflow*/ != 0, (byte)(int)this != 0);
}

 

You would use a Harmony patch

 

 

    [HarmonyPatch(typeof(Block))]
        [HarmonyPatch("Init")]
        public class Init
        {
            public static bool Prefix(ref Block __instance)
            {
				Debug.Log("Run me.");
               return true;
            }
        }

 

 

The return true on a Prefix will allow the base Block's Init to run as well. if you return false, the base Block's Init will not run, just your code.

Link to comment
Share on other sites

3 hours ago, sphereii said:

You would use a Harmony patch

 

 



    [HarmonyPatch(typeof(Block))]
        [HarmonyPatch("Init")]
        public class Init
        {
            public static bool Prefix(ref Block __instance)
            {
				Debug.Log("Run me.");
               return true;
            }
        }

 

 

The return true on a Prefix will allow the base Block's Init to run as well. if you return false, the base Block's Init will not run, just your code.

 

Thanks! Took me a minute to work out how Harmony works but I got it all working in the end, its so much easier than patchscripts! I'll post the mod tomorrow sometime.

Edited by three08 (see edit history)
Link to comment
Share on other sites

  • 2 months later...

Parsing arguments
Running BackupFiles
Nope: Could not find a part of the path 'C:\Program Files (x86)\Steam\steamapps\common\7DaysToDie_Data\Managed\Assembly-CSharp.dll'.

process exited with error code -11234

 

I am trying to install a FOV mod for alpha 19, I don't know what I am doing wrong

Link to comment
Share on other sites

On 9/4/2021 at 12:53 AM, Luna22175 said:

Parsing arguments
Running BackupFiles
Nope: Could not find a part of the path 'C:\Program Files (x86)\Steam\steamapps\common\7DaysToDie_Data\Managed\Assembly-CSharp.dll'.

process exited with error code -11234

 

I am trying to install a FOV mod for alpha 19, I don't know what I am doing wrong

 

It looks like you've not got the correct folder path in the settings area for DMT. Make sure you have the games folder name in it 

 

e.g.

 

C:\Program Files (x86)\Steam\steamapps\common\7 Days to die

 

Not just C:\Program Files (x86)\Steam\steamapps\common

Link to comment
Share on other sites

10 hours ago, HAL9000 said:

 

It looks like you've not got the correct folder path in the settings area for DMT. Make sure you have the games folder name in it 

 

e.g.

 

C:\Program Files (x86)\Steam\steamapps\common\7 Days to die

 

Not just C:\Program Files (x86)\Steam\steamapps\common

I tried and it says it cannot be in the same file path as the mod folder or there would be build errors.

Link to comment
Share on other sites

On 9/7/2021 at 4:12 AM, Luna22175 said:

I tried and it says it cannot be in the same file path as the mod folder or there would be build errors.

 

Yeah you have to have the DMT mod folder outside of the game folder. Then DMT copies the enabled mods into the games mod folder. it's the only way to have an enabled/disabled system atm

 

So put the DMT mods in something like C:\Games\7DaysMods and you should be good to go

Link to comment
Share on other sites

On 9/8/2021 at 2:08 PM, HAL9000 said:

 

Yeah you have to have the DMT mod folder outside of the game folder. Then DMT copies the enabled mods into the games mod folder. it's the only way to have an enabled/disabled system atm

 

So put the DMT mods in something like C:\Games\7DaysMods and you should be good to go

Not in steam apps/common/7days to die?

I created a folder inside 7 days to die for dmt and called it 7DaysMods

my mods folder is also in the 7 days to die folder

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Version 2.3 will work but a lot of features are disabled in A20+ 

 

Now we have Harmony support built in to the game by default it's time to phase out DMT and move to the new system. 

 

I think SphereII is working on an example project that modders can download to start understanding the new layout and workflow 

 

Existing mods will need to be updated and if you get stuck or have questions there's a lot of stuff available on Guppy's discord: https://discord.gg/cN8fQ6N7Js

 

Cheers,

 

Hal 

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
7 hours ago, EliminationXYT said:

The Application Says "Cannot Find Files" when looking for all paths

 

Do you have .net 4.7.2 installed? 

 

If you're playing Alpha 20 then DMT is no longer needed for modding. Check with the mod maker to see if they've converted their mod to the new A20 method (A20 has native mod support for Harmony now) 

 

Cheers,

 

Hal

Link to comment
Share on other sites

  • 2 months later...

Been trying to use DMT and everytime I try to build, it just keeps spitting out the same error. I used DMT before and it worked in A19, but that was on an old version of my computer. (Also this entirely breaks my game forcing me to verify integrity of the files, otherwise anytime I launch the game, my console gets spammed with "Object reference not set to an instance of an object")


I honestly have no clue what I'm doing wrong since this is a fresh install and I tried a couple things to no success.
spacer.png

Edited by finaphar
Clarification (see edit history)
Link to comment
Share on other sites

Hi finaphar,

 

In A20 the Pimps added Harmony support into the game so DMT shouldn't be needed if the mod has been updated to use the built-in modding tools now. A lot of DMT features are disabled in A20. Check with each mod post and there's usually a "how to install" section explaining what to do. 

 

For earlier versions and from your picture you don't have any of the mods enabled (the checkboxes on the left) 

Link to comment
Share on other sites

  • 2 weeks later...

For anyone running down the same Google rabbit hole I've been down for weeks, trying to find info on how to use harmony with alpha 20. What you need to do is get on Guppy's discord (linked below):

 

 

Then you need to search for sphereii's post (shown below) from 12/9/2021. It'll tell you to use Visual Studio 2019. Once you download the Mods.zip folder, it has a readme with explicit instructions

 

spacer.png

Link to comment
Share on other sites

  • 1 month later...

hi, i`ve just installed the latest DMT and i`m having issues when it comes to the build. i keep getting an error.

The Assembly-CSharp.dll file has already been patched by SDX so cannot be used as a backup. Reset your game files and try again. process exited with error code - 1. Build failed

 

 

Edited by Chuckiewokie (see edit history)
Link to comment
Share on other sites

Hi Chuckiewokie,

 

To reset your game files head to steam and verify the integrity of the install (right click the game -> Properties -> local files). This will replace any vanilla game file. 

 

If you're on the latest Alpha then DMT isn't needed as they've built in harmony support now. You'll need an A20 compatible version of the mod and just drop it in the mods folder. DMT is only for people wanting to run mods on the older alphas now. 

 

Cheers,

 

Hal


 

 

Link to comment
Share on other sites

  • Roland unpinned and locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...