Skip to content

.dll asset

Andrey Peysakhovich edited this page Jan 29, 2020 · 14 revisions

Since 0.79 you can create not only content-based mods but also mods that provide new behaviors and logic, or modify already existent ones. We call it the .dll mods.

How it works?

.dll asset is treated by the game as any other mod asset, so as you placed it in your mod folder, the game will found and load it. However, the process of creating the DLL file itself differs greatly from the other assets.

Core concepts

  • The DLL file you want to get in the end essentially is a .NET class library targeting .NET Standart 2.0 (or .NET 4.x) and containing one or more implementations of the IMod interface provided by Voxel Tycoon API.
  • In order to access Voxel Tycoon and Unity APIs you need to reference Assembly-CSharp.dll and UnityEngine.CoreModule.dll libraries that can be found in VoxelTycoon_Data/Managed directory inside the game folder.
  • Also, you might want to reference UnityEngine.UI.dll if you want to work with the game UI.
  • After you compile your library, the resulted .dll file is ready to be put into your mod directory and loaded by the game.

Step-by-step tutorial

In order to help you start working with the concepts described above, we compiled a simple step-by-step tutorial which will guide you through the process of creating your first .dll mod for Voxel Tycoon.

FAQ

What can be done with the .dll mods?

Voxel Tycoon works on top of Unity, and the .dll mods have full access to all the features that Unity runtime provides, as well as Voxel Tycoon APIs. In other words, you can do anything that you can normally do with Unity.

In what language mods can be written?

Since the game is written in C# and works on top of Unity (which primary language is also C#), most examples, tutorials, and docs you may find will use this language. That being said, C# recommended language of choice for the .dll mods. C# is a modern, constantly evolving language that provides a huge variety of features and flexibility.

However, any .NET language will work.

Where's API documentation?

There are almost no documented APIs available currently in Voxel Tycoon. Still, we urge you to start creating .dll mods right now, so we can build an extendable, flexible, and well-featured platform together with you.

Just as you feel that you need any new APIs, events, callbacks, etc - or modifications of existing ones - do not hesitate to let us know by creating an issue on suggestion tracker. Also, feel free to chat with us and community directly on our Discord Server.

We are committed to update and extend the modding APIs along with your requests as soon as possible.

Meanwhile, we suggest you to use decompilers like dnSpy to dig into the game's code and start exploring the possibilities for modification.

You can’t perform that action at this time.