Tutorials ‐ Using custom scripts - ow-mods/outer-wilds-unity-wiki GitHub Wiki

Getting your mod scripts

  1. Build your mod
  2. Take the .dll file from your mod (in %APPDATA%\OuterWildsModManager\OWML\Mods\[your mod name]) and copy/drag it into your unity project (anywhere will do, as long as it's somewhere in Assets. I like putting mine in Assets/Dlls.)
  3. If your mod dll references other dlls (e.g. if your mod uses code from New Horizons), you also need to copy the other dlls into your unity project.
  4. If it loads without errors, you should be able to add your scripts to GameObjects in editor!

Automatically updating on build

  1. In your .csproj.user file, add this property in the <PropertyGroup> block:
<UnityDllsDir>[path to folder in unity project]</UnityDllsDir>

This defines the folder you want to copy the dll to.

  1. In your .csproj file, add this in the <Project> block:
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="Exists('$(UnityDllsDir)')">
    <Exec Command="xcopy /y &quot;$(TargetPath)&quot; &quot;$(UnityDllsDir)&quot;" />
</Target>

This tells the compiler to copy your dll (TargetPath) into where you specified earlier (UnityDllsDir) after building the dll.

⚠️ **GitHub.com Fallback** ⚠️