1) Install XNA Game Studio in Visual Studio 2017 follow this tutorial:
http://totalminerforums.net/index.php?topic=19324.02) Open Visual studio and create a new project for XNA Game Studio – Windows Game Library(4.0) with your mod name for the name ex: TM_ExampleMod.
3) In the Solution Explorer right click on References select add reference
4) Click Browse and navigate to your Total Miner steam Directory
(C:\Program Files (x86)\Steam\steamapps\common\Total Miner)
5) Select all the .dll files and click add, or add 1 at a time, currently there are 7 in total: StudioForge.Engine.Core.dll, StudioForge.Engine.GUI.dll, StudioForge.Engine.Services.dll, StudioForge.Engine.Integration.dll, StudioForge.Engine.Game.dll, StudioForge.BlockWorld.dll, StudioForge.TotalMiner.API.dll
6) After adding them select the ones you need with check marks and click ok
7) Rename the default class1.cs file to the mod name TM_ExampleMod1.cs by right clicking on it and choosing rename.
8 ) Open the cs file for editing
9) At the top add
using StudioForge.TotalMiner.API;
using StudioForge.TotalMiner;
10) change the class name to match your mod name and make it extend ITMPlugin public class Class1 to
public class TM_ExampleMod1 : ITMPlugin
11) Add the required interfaces to the class:
public void WorldSaved(int version){}
public void PlayerJoined(ITMPlayer player){}
public void PlayerLeft(ITMPlayer player){}
public void Initialize(ITMPluginManager manager, string path){}
public void InitializeGame(ITMGame game){}
public bool HandleInput(ITMPlayer player){return false;}
public void Update(ITMPlayer player){}
public void Update(){}
public void Draw(ITMPlayer player, ITMPlayer virtualPlayer){}
12) In solution explorer right click on your mod name not the solution name and choose add new item
13) find Code File C# highlight it and click add
14) Rename it to TMPluginProvider.cs note: this is the required name
15) open the file for editing with required code and implement required interfaces:
using StudioForge.TotalMiner.API;
namespace TM_ExampleMod
{
class TMPluginProvider : ITMPluginProvider
{
public ITMPlugin GetPlugin()
{
return new TM_ExampleMod1();
}
public ITMPluginBlocks GetPluginBlocks(){return null;}
public ITMPluginArcade GetPluginArcade(){return null;}
public ITMPluginGUI GetPluginGUI(){return null;}
}
}
note: namespace TM_ExampleMod is mod namespace name, return new TM_ExampleMod1() is constructor for mod name
16) Code your mod, build your solution, copy your modname.dll to the mod folder for TM in a folder of the mod name
C:\Users\YourName\Documents\My Games\TotalMiner\Mods\ TM_ExampleMod1
17) Run Total Miner and test your mod.
Optional Settings
1) Right click on mod project file and choose properties
2) under XNA Game Studio select Use HiDef to access the complete API
3) go to Build Events and for Post-Build event command line: add
xcopy /Y /E /I "$(TargetPath)" "$(ProjectDir)\Install\"
xcopy /Y /E /I "$(ProjectDir)\Content" "$(ProjectDir)\Install"
xcopy /Y /E /I "$(ProjectDir)\Install" "$(HOMEDRIVE)$ (HOMEPATH)\Documents\MyGames\TotalMiner\Mods\$(ProjectName)"
note: this copies the mod files to the mod directory automatically. make sure the path is correct.