janismac

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=1.2.0.0, 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[])
KSPAssets.Editor.<BuildBundle>d__6:MoveNext()
KSPAssets.Editor.EditorUtil:UpdateCoroutine()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

https://forum.kerbalspaceprogram.com/index.php?/topic/161314-no-kspasset-in-unity-menu/&tab=comments#comment-3243133

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

Maybe @JPLRepo can take a look at this?

Share this post


Link to post
Share on other sites
Posted (edited)

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

<project-dir>\Assets\Plugins\KSPAssets\TextMeshProResolver.cs
<project-dir>\Assets\Plugins\KSPAssets\TextMeshProResolver.cs.meta

to

<project-dir>\Assets\Plugins\KSPAssets\Editor\TextMeshProResolver.cs
<project-dir>\Assets\Plugins\KSPAssets\Editor\TextMeshProResolver.cs.meta

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=1.2.0.0, Culture=neutral, PublicKeyToken=null'." [...]

Edited by janismac

Share this post


Link to post
Share on other sites

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.

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