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. 

  • Like 1
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

Posted (edited)
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...