[Tutorial] [1.0] How to make a .dll-mod (Power Generation)

Started by Haplo, May 01, 2014, 03:42:18 PM

Previous topic - Next topic

Haplo

How to make an .dll-mod



Description
This is a small demonstration about how you can make a mod that's using an assembly (.dll).
With this little project you learn about the assembly and it's program. Additionally you'll build your own small dark matter generator and an animated wind turbine. :)
Note, that this is Windows only, as I have no experience with Linux or Mac. Sorry..


Needed Tools
You need the following tools:
- Microsoft Visual Studio 2017 Community Edition (free, download here)
- A basic understanding of C#
- RimWorld


Download
Download the project from Git-Hub.


Preparations
Before you start the project, you need to make the following preparations:
-Extract the file to a folder of your choice
-Go into your RimWorld-Folder:
    - Copy ..\RimWorld000Win\RimWorld000Win_Data\Managed\Assembly-CSharp.dll
      to ..\YourProjectFolder\RimWorld_ExampleProjectDLL\Source-DLLs\
    - Copy ..\RimWorld000Win\RimWorld000Win_Data\Managed\UnityEngine.dll
      to ..\YourProjectFolder\RimWorld_ExampleProjectDLL\Source-DLLs\


Enter The Project
Now that you've prepared everything, it is time to enter the project and take a look into what makes the pump do, what it does and where the problem is..
So open the project by starting <YourExtractionFolder>\RimWorld_ExampleProjectDLL.sln
If everything is installed correctly, Visual Studio should startup, opening your project.
Everything else is described inside.
And once you're finished, you have created your very own dark matter generator and maybe an animated wind turbine.

With this in mind.. Have fun exploring the secrets of the RimWorld code.  8)
See you on the other side,
Haplo

Cala13er


Haplo

Yes I know, I've spoken with him.
My only problem is, that I have no experience with wikis, so the link there will take a while until I figured it out :)

Tynan

Based on the other stuff you're able to do I think figuring out the wiki should take you all of 90 seconds :)
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Cala13er


Haplo

Thank you for the offer, but I need to figure it out myself sometime. So why not yet ;)
First things first.. where to create a new page.. hmm..

keensta

Shouldn't something like this and any tutorials be in the help section and maybe a sub folder in the help section for any tutorials.

On the other hand nice tutorial.
Check out my RimWorld SaveEditor
It removes slag and rock debris.

I mostly hang around in the Mod section of the forum. Yet I don't have a Mod :o.

pawnstorm

You're much better at commenting your code than me :P. Anyway, nicely done! I hope it'll spawn a lot of new modders! Something about giving a man a fish and teaching him how to fish.

Vas

Shouldn't this be in the help section and not the released mods section? :P
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

Tynan

Tynan Sylvester - @TynanSylvester - Tynan's Blog

Haplo

I'm not really sure it fits into the help thread, as I've always seen this as a call-for-help thread and not a tutorial thread.
And as it repairs the fertilizer pump (indirectly the user has to do it himself and learns some basics about coding, even if it wasn't his intention, ;) ) I thought it would be good to place it in the release section.
Maybe a tutorial section would be a good place, but as it isn't there right now, I thought about motivating some users who normally don't do this, to try it out by placing it in the release thread..

But that is just my oppinion :)

Tynan

Isn't there another mod that fixes the fertilizer pump already? I see this as more of a contribution to learning modding, not as a released mod for the game. Does that work?
Tynan Sylvester - @TynanSylvester - Tynan's Blog

harpo99999

tynan, I have tried the so-called fertiliser pump fix mod, BUT it did not make any changes to the gameplay after using it and the pump still does NOT improve the ground, so I just do NOT use the fertiliser pump any more

Haplo

I think the other mod was broken a short time after it's release too. Don't know if it was fixed. Didn't really looked out for it.
If you want to have it in the helps section, that's fine with me. But I've honestly always thought of this section as a place to look into, if I have a specific problem and want some help with it.
I'd like it to be in a tutorial folder, but don't know where such could be placed. So, if you think it's best to place it here, I have no problem with it.
Just wanted to let you know, why I selected the release in the first place and not the help topic.
 

Vas

My fertilizer appears to work, and I didn't use any mods to fix it.  I didn't know anything was broken about it.
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.