Skip to content

SHORTTUTORIAL: Mac Modding HowTo

roxxploxx edited this page May 5, 2017 · 8 revisions

Macs can modify XML readily but are severely limited in modding RimWorld because there is not a development environment that supports .Net 3.5 (MonoDev/Xamarin Studio dropped support). That should not limit you. I don't claim to know the best way to do this, but here is what I do. Looking for help if you know it.

Before you start...

  • Here's how to manually install mods.
  • RimWorld Steam Installation Directories:
    • Save Files: ~/Library/Application Support/RimWorld/Saves
    • Manually Installed Mods Directory : ~/Library/Application Support/Steam/steamapps/common/RimWorld/RimWorldMac.app/Mods
    • Steam Workshop Mod Storage: ~/Library/Application Support/Steam/steamapps/workshop/content/294100
      • Note: I think this is a standard location. At runtime, steam loads mods from this directory.
    • Message, Error and Warning Logs: ~/Library/Logs/Unity/Player.log

How I Mod on a Mac

  • Create a directory (referred to as $ModHome), structured to hold all your code and notes for your new Mod.
/$ModHome
  |--- Makefile
  |--- /MyModName - a directory that follows the [default mod structure](http://rimworldwiki.com/wiki/Modding)
  |--- /v1 - set up your Visual Studio development here
  | |--- mod.csproj - project definition in VisualStudio
  | \--- /MyModName - your source code
  |--- /Images - my working directory for textures (Gimp, Photoshop, etc)
  |--- /RimWorldSrc - Where I placed my disassembled RimWorld code
  |--- /Releases - Where I archive releases that I put into Github
  |--- doc,excel - notes on how I am planning my mod
  • Virtualize Microsoft Visual Studio on Windows 10 with VirtualBox.
    • Wasn't hard to set up and Visual Studio is free now.
  • In Windows 10, decompile the source code so you can read it.
  • In Mac OS, Share the $ModHome directory via the VirtualBox 'Shared Folders' configuration. It shows up as drive e: for me in Windows 10.
  • In Mac OS, set up the Makefile to automate tasks
MODSDIR=$(HOME)/Library/Application Support/Steam/steamapps/common/RimWorld/RimWorldMac.app/Mods

MODNAME=MyModName

#.Phony : install checks copyover

all:
    @echo " use 'make checks copyover install'"
    @echo "  or, make a release"

copyover : 
    @echo "making $@..."
    @cp v1/$(MODNAME)/obj/Debug/$(MODNAME).dll ./$(MODNAME)/Assemblies/.
    @echo "   ...done"

checks : 
    @echo "making $@..."
    $(shell find ./ -type f -name "*.xml" -print0 | xargs -0 xmllint --noout)
    @echo "   ...done"

install: 
    @echo "making $@..."
    @rm -Rf "$(MODSDIR)/$(MODNAME)"
    @mkdir "$(MODSDIR)/$(MODNAME)"
    @cp -r "$(MODNAME)" "$(MODSDIR)"
    @echo "   ...done"

release:  checks copyover install
    @echo "making $@..."
    @zip -r $(MODNAME).zip "$(MODNAME)"
    @echo "**** REMEMBER TO UPDATE VERSION NUMBER IN About/About.xml"
    @echo "   ...done"
  • When editing source code using whatever editor (Mac or Windows 10), recompile in Windows 10.
    • The files are shared across OSes so no reason to copy/paste anything.
  • To make a package, after changing XML or recompiling code, run the make command: make checks copyover
    • Be sure to watch the output as this runs an XML format checker to catch simple parse errors.
    • You now have a package, but it isn't installed.
  • To install your package, run the make command: make install
    • Now it is installed in the Mods directory of RimWorld.
  • Reload the Mod:
    • Restart RimWorld
    • Or, close the running game, click 'Mods' and reorder two mods that have an order that doesn't matter. It will reload all mods for you and save restarting the game. Might not work in all cases, but it's faster.
  • To reload a save game faster, create a save game that only generates 5% of the world and the smallest map possible (select advanced options when selecting a place to start your colony on the world map).
Clone this wiki locally