Ludeon Forums

Ludeon Forums

  • June 19, 2021, 06:03:22 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 5

Author Topic: [Tutorial] [1.0] How to make a .dll-mod (Power Generation)  (Read 84876 times)

Haplo

  • Global Moderator
  • Planetologist
  • ****
  • Posts: 2135
  • Shadow
    • View Profile

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
« Last Edit: July 24, 2018, 03:27:01 PM by Haplo »
Logged

Cala13er

  • Super Tester
  • Colonist
  • ***
  • Posts: 819
  • Trying to obtain motivation to update my mods
    • View Profile
Re: [Example] How to make an .dll-mod (and repair the fertilizer pump)
« Reply #1 on: May 01, 2014, 03:44:58 PM »

I think Tynan wants stuff like this on the wiki.
Logged

Haplo

  • Global Moderator
  • Planetologist
  • ****
  • Posts: 2135
  • Shadow
    • View Profile

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 :)
Logged

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12472
    • View Profile
    • Tynan's Blog

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

Cala13er

  • Super Tester
  • Colonist
  • ***
  • Posts: 819
  • Trying to obtain motivation to update my mods
    • View Profile

Haplo, I'll create it for you if you wish?
Logged

Haplo

  • Global Moderator
  • Planetologist
  • ****
  • Posts: 2135
  • Shadow
    • View Profile

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..
Logged

keensta

  • Colonist
  • ***
  • Posts: 110
  • That guy
    • View Profile

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.
Logged
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

  • Colonist
  • ***
  • Posts: 164
  • Refugee
    • View Profile

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.
Logged

Vas

  • Colonist
  • ***
  • Posts: 875
  • Dragon
    • View Profile
    • Feral Dragon

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

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12472
    • View Profile
    • Tynan's Blog

Shouldn't this be in the help section and not the released mods section? :P

Moved to help.
Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Haplo

  • Global Moderator
  • Planetologist
  • ****
  • Posts: 2135
  • Shadow
    • View Profile

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 :)
Logged

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12472
    • View Profile
    • Tynan's Blog

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?
Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog

harpo99999

  • Planetologist
  • ****
  • Posts: 1066
  • Refugee
    • View Profile

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
Logged

Haplo

  • Global Moderator
  • Planetologist
  • ****
  • Posts: 2135
  • Shadow
    • View Profile

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.
 
Logged

Vas

  • Colonist
  • ***
  • Posts: 875
  • Dragon
    • View Profile
    • Feral Dragon

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