Jump to content

Can not get the PartTools asset compiler to work at all

Recommended Posts

Hi all,

for context, I want to build a new mod with a complex GUI, and I'm following this tutorial.

I followed the tutorial, but the asset compiler fails when I click "build" and gives a bunch of errors in the console.

After some testing, I was able to reproduce the problem with a simpler setup. Steps to reproduce:

1) Install Unity Version 2017.1.3p1 Personal
2) Create Project
3) Import latest PartTools (April 9, 2019)
4) Open Asset Compiler
5) For the "squadcore" bundle click "Create", "Update", "Build".

After clicking build I get a bunch of errors (message below). I have tested this on Windows 7 and a fresh Windows 10. Same error in both cases.

Any ideas?

TypeLoadException: Could not load type 'KSPFontAsset' from assembly 'KSPAssetCompiler, Version=, Culture=neutral, PublicKeyToken=null'.
UnityEditor.Build.BuildPipelineInterfaces.InitializeBuildCallbacks (BuildCallbacks findFlags) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:115)
UnityEditor.BuildPipeline:BuildAssetBundles(String, AssetBundleBuild[], BuildAssetBundleOptions, BuildTarget)
KSPAssets.Editor.AssetCompiler:BuildAssetBundles(Boolean, Boolean, String, String[])

Assets/Plugins/KSPAssets/TextMeshProResolver.cs(7,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing an assembly reference?

Error building Player because scripts had compiler errors
Link to comment
Share on other sites

Do you have TextMeshPro installed? I was trying to get this working at one point and, even though I wasn't using TestMeshPro in my asset, it was throwing a similar error until I installed it. I think there are some instructions on JPLRepo's PartTool page but it's been a while since I last looked.

Link to comment
Share on other sites

Yes I tried both the most recent version and the version "TextMesh Pro - Release (dll only).unitypackage" found in this comment:


I have also tried the "TextMeshProResolver" script from that thread, but nothing seems to help.

Maybe @JPLRepo can take a look at this?

Link to comment
Share on other sites

Oh I think I just solved half of the problem. It looks like TextMeshPro is included in PartTools nowadays, so no need to install it.

In  this post @xEvilReeperx said that the TextMeshProResolver should be in an "Editor" folder. This is not the case in the current PartTools.

So I moved




Now, when I click build, the last two errors are gone, and the file <project-dir>\AssetBundles\squadcore.ksp is created.

But the first error remains: "TypeLoadException: Could not load type 'KSPFontAsset' from assembly 'KSPAssetCompiler, Version=, Culture=neutral, PublicKeyToken=null'." [...]

Edited by janismac
Link to comment
Share on other sites

  • 11 months later...
On 6/16/2020 at 7:04 AM, cineboxandrew said:

Did you ever find a solution to this? I'm having the same issue with loading fonts. It appears @JPLRepo's font tutorial is outdated or the KSPAssetCompiler is just broken

I'll put it on the list to take a look post 1.10 release.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...