Ludeon Forums

Ludeon Forums

  • December 16, 2018, 09:11:22 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Tool] cookiecutter-rimworld-mod-development : Build a Mod In 30 Seconds or Less  (Read 7785 times)

fyarn

  • Drifter
  • **
  • Posts: 29
  • Modder
    • View Profile

Rimworld Mod Development Cookiecutter

This is a tool for developers to begin mods more quickly, eliminating the overhead of setting up a new project.

Set up a fully functional mod development environment in 30 seconds or less with a Visual Studio integration!

What does it do?

This is a Visual Studio integration (or optionally a command-line, non-VS tool) that, with just 4 skippable questions, will set up an entire Rimworld Mod project for you, including:
  • Complete and accurate file structure
  • VisualStudio project set up inside the folder structure
    • Automatically linked Rimworld .dll files
    • Correct initial VS project settings as listed on RW wiki
    • Automatic build events on Debug/Release build ensure you always have the most up-to-date and optimized version of your code
    • Debug and Release version of mod are automatically maintained and tagged differently
    • Start button builds project and launches Rimworld in a resource monitor
    • Support for separate save profiles and mod lists in debug mode

Why should I care?

Have you ever written a mod? Do you ever plan to? This takes all the hassle out of setting up the mod, letting you get right to that brilliant idea. Bring the time cost of setting up a project down to 30 seconds! Applicable to modders of the XML/Asset-only variety and C# gurus.

Links

Project Repository and Installation Instructions

« Last Edit: February 25, 2018, 05:02:21 PM by fyarn »
Logged

Mehni

  • Super Tester
  • Colonist
  • ***
  • Posts: 601
    • View Profile

This is a pretty neat tool that I wish I had when I started out. While I've now mastered to set up a project by myself, it did make me realise one thing. My current workflow is nowhere near as organised or structured as it should be. Ideally I should have a self-contained lightweight RimWorld install for modding, and a RimWorld install for playing modded. I'm sure there's a command-line option to swap out a modconfig.xml and set a save-data folder...

Do you mind telling me if there's a benefit to the debug and release builds? What's the added advantage over version control like git?

fyarn

  • Drifter
  • **
  • Posts: 29
  • Modder
    • View Profile

Quote
Do you mind telling me if there's a benefit to the debug and release builds? What's the added advantage over version control like git?

Yeah! I'm a huge believer in open-source projects and would actually argue these should be used alongside VCS (my default being Git)! The way I structure my projects is to have a Git repository in the Debug build (which is the originally generated, non-cloned folder) that captures all of my work commit-by-commit. Then once I have a completely finished update to the mod, I both:
  • Push the series of commits and create a Release tag on Github
  • Start the solution in Visual Studio in the Release configuration (which both runs the Release mod build tasks and runs Rimworld) and upload that version through the Rimworld editor
This way I can expect to fail on lots of small edits when in the Debug configuration, and once I'm ready to test it like I would upload it (exactly as the user experiences the mod) I change it to Release configuration and play-test the Release version.
Logged

fyarn

  • Drifter
  • **
  • Posts: 29
  • Modder
    • View Profile

Do you mind telling me if there's a benefit to the debug and release builds?

In addition, the rimworld wiki advocates using Dev and Release builds: http://rimworldwiki.com/wiki/Modding_Tutorials/Distribution#Distribution

So this just follows the standard documented practices, with automation!
Logged

Uuugggg

  • Drifter
  • **
  • Posts: 64
  • Refugee
    • View Profile

This should really be the first thing anyone looks at to make a mod.

Already used it like 10 times for new little mods.
Logged

Wargrave

  • Muffalo
  • *
  • Posts: 4
  • Refugee
    • View Profile

Going to try this thanks for this!
Logged

MockMicrobe

  • Muffalo
  • *
  • Posts: 1
  • Refugee
    • View Profile

Is there a guide to installing this? The instructions are lacking detail and I can't get it to work.
Logged

fyarn

  • Drifter
  • **
  • Posts: 29
  • Modder
    • View Profile

I tried to make good instructions, what's unclear? :)
Logged

Logicsol

  • Muffalo
  • *
  • Posts: 8
  • Refugee
    • View Profile

Edit: I'm dumb, and this was way easier than I thought.

I do have one question though.

One of the last steps is this:

In the new Solution Explorer view that comes up, right click RimWorldWin and click Set as Startup Project

I don't have a RimWorldWin in the solution viewer after opening my sln file.
« Last Edit: September 03, 2018, 07:03:06 PM by Logicsol »
Logged

Sayuri

  • Muffalo
  • *
  • Posts: 1
  • Refugee
    • View Profile

Same as Logicsol, can't find it in the solution explorer either, or I'm quite blind  :-\ .
Logged

Shaggy

  • Muffalo
  • *
  • Posts: 2
  • Refugee
    • View Profile

Same issue here. Do not see a RimWorldWin to designate as startup project in Solution Explorer. I have tried using cookiecutter from command prompt and within VS2017. Any ideas? Is this still a valid project?

Thanks
Logged

Preechr

  • Muffalo
  • *
  • Posts: 2
  • Refugee
    • View Profile

You guys will need to look into the settings in VS for your solution and find the option to open an external program for debugging and assign that to the Rimworld executable you use to start the game. I think you may be having this problem because you're using the 64 bit version, or maybe it has something to do with Steam or how the script functions.

The instructions are super specific and the cookiecutter works exactly as advertised, but there are still little things that will need to be worked out. There are a series of videos on youtube published by a user named keen krozzy that are older, kinda long and unedited that go through the manual setup of what this solution does for you, and you might benefit from walking through the steps and looking at the whole process being done and seeing how it was done for you.

This cookiecutter does a heck of a lot more and in a much more efficient manner, but the videos may give a better perspective on some of the details.
Logged

Shaggy

  • Muffalo
  • *
  • Posts: 2
  • Refugee
    • View Profile

Thanks Preechr. I thought of looking to link external after I posted this. Will look up those vids for some more details.
Logged

Preechr

  • Muffalo
  • *
  • Posts: 2
  • Refugee
    • View Profile

Come to think of it, if you are brand new to VS you will need to install the plugins for cookiecutter and git, and if you haven't used git, you'll need to configure it as your repo, which is not part of this tool's instructions

There are other things you may want to do in addition, like including Harmony and any other frameworks you wish to use, as resources, so paying attention to how that is done and then allowed or included in your mod will be helpful
Logged

TaryTrayTwins412

  • Muffalo
  • *
  • Posts: 6
  • Refugee
    • View Profile

Hi, new to the scene and I'm having trouble after pip installing cookiecutter, i can't get it to create the environment. I know the instruction were suppose to be super easy, but I must be dumb. Any help appreciated!

EDIT: Nevermind, it seems that I had python installed in my appdata AND in my program files, so when i checked my PATH, it had the program files one but not the local one which pip was installing cookiecutter to (if i had paid attention to the paths Git was showing me i would have know). I uninstalled python and reinstalled it just for my use and it's all good.
« Last Edit: December 14, 2018, 10:46:30 PM by TaryTrayTwins412 »
Logged