Jump to content

Modding Documentation


eedobaba

Recommended Posts

I've been trying on and off for the past week or so to do some basic modding in KSP, and I'm really getting no where. All I'm trying to do is make some custom parts for a big moon base set. I'm experienced with modeling and texturing so that part isn't a problem. The problem I'm having is getting my models in and the fact that I can't find any clear, up to date documentation or tutorials. Everywhere I look there's conflicting information. For example, some tuts claim all you need to do it export straight out of Blender, while others say you have to go through Unity. There's also the issue of CFG documentation, which I'm sure varies pretty greatly between the last 5 or 6 builds of the game, so its tough to find something I can know will work with the current build.

Can someone link me to a resource which is reliably up to date and clear about the process of getting models into KSP?

Link to comment
Share on other sites

I reckon a lot of this info was lost during the forum Kraken event. I know I had written some stuff that I wish I had backed up regarding cockpits and landing gear creation.

I'm sure whatever documentation is out there, if it ins't new, is out of date, and should be redone. I might volunteer to do some of it if needed.

In the mean time though, my workflow is like this.

Create a new Unity 4 project to get the folders set up.

Create the mesh in blender, with the file saved to the projects Assets folder.

In unity, create an empty game object, and drag the mesh from the assets pane to this empty object.

Make sure the coordinates of the empty and the mesh inside it is 0,0,0.

Name the empty something like exporter, since this is just a holder object for the exporter tool and the mesh it will export.

The mesh should be pointing up like on a rocket, even if it is for a plane.

Click the mesh inside the exporter, and add a convex mesh collider, or other fitting collider to it.

Download the Part Tools, and drag them into the projects assets pane.

On the "exporter" empty, click add component, and choose KSP/Part Tools.

Fill in a part name and folder name if you like to have order in your mess.

Unless you are using a png file as a texture, you need to choose Convert texture, and one of the file formats. (mbm is a custom semi-protected format).

Click the exporter empty, click the "Write" button in the part tools.

The exported files will be in the Parts folder in the unity project folder. Copy it to a new folder for your mod in KSP, like for other mods (in GameData).

Create a part.cfg in the manner of any other part.

Let us know where you break down in tears, and we can help.

edit: starting a shared document here that anyone can edit.

Edited by Snjo
Link to comment
Share on other sites

Alright, that pretty much describes the last method I tried. The problem I'm running into on that one is that when I click "Write" in the part tools menu, it gives me an error saying it can't find the directory (one which is definitely there).

DirectoryNotFoundException: Could not find a part of the path "C:\Users\Administrator\Documents\New Unity Project\GameData\Eedobaba\Parts\geodome\model.mu".

That's where the process is breaking down now. Also, even if I can get the model working, I need some sort of documentation for CFG writing. This is the best I could find, and it looks like it could be as many as 3 or 4 builds out of date. Do you think it's still trustworthy for working with .20?

Link to comment
Share on other sites

I made a crappy video that may or may not be helpful. Feel free to scan through it to see what steps I take for getting a part from 3d model to in game animated and textured part. The video shows the entire process start to finish for the part.

http://forum.kerbalspaceprogram.com/showthread.php/31251-The-Icarus-Project?p=411792&viewfull=1#post411792

I don't show anything about setting up your modeling program or Unity, but that's thoroughly covered elsewhere. Most people seem to get hung up on the Unity settings, on things like texture unwrapping, and sometimes CFG files.

Link to comment
Share on other sites

On the dialog where you click on "Write" to export the model.mu file, just above that there is a check box that says "Convert Texture"... make sure that is checked

Just took a look and it was already checked. Tried the export again and it's still not exporting anything other than the mu.

Link to comment
Share on other sites

The textures export to the directory ABOVE the directory you set. So if you set:

- Example1\Example2\model.mu

That's where the model exports, but the textures will export to:

- Example1\<partname>model000.png

This is a common problem for people and I don't know why it does that, but it does.

Link to comment
Share on other sites

The textures export to the directory ABOVE the directory you set. So if you set:

- Example1\Example2\model.mu

That's where the model exports, but the textures will export to:

- Example1\<partname>model000.png

This is a common problem for people and I don't know why it does that, but it does.

There's nothing there either.

Link to comment
Share on other sites

Hm, no. It's not exporting any images. Just an mu file. And yes, I have brought the textures into Unity and they display on the model fine there.

Did you set the materials to use one of the KSP shaders? When you bring up the material in the inspector pane (the place where you apply the texture to the material), there is a pull-down menu titled "Shader" (I think), whose default value is "diffuse". If you open up the drop-down, there should be a subcategory called "KSP". Choose one of the shaders in there (KSP/diffuse being the simplest)

Link to comment
Share on other sites

Your model is not 1kb in size is it?

Yes it is. I thought that was weird but didn't question it. Does that mean it's not actually packing anything into the file?

Did you set the materials to use one of the KSP shaders? When you bring up the material in the inspector pane (the place where you apply the texture to the material), there is a pull-down menu titled "Shader" (I think), whose default value is "diffuse". If you open up the drop-down, there should be a subcategory called "KSP". Choose one of the shaders in there (KSP/diffuse being the simplest)

Yes, the model I'm exporting uses the KSP specular shader.

Link to comment
Share on other sites

Does that mean it's not actually packing anything into the file?

Because of the way files are stored many operating system round up the summary data for any file to the nearest kilobyte or four so it could be a lot small. Trying bringing up the detailed data to get the exact size of the file. Unless it's a very simple model to test though it's likely too small and the exporter is encountering an error - the smallest stock parts are 4kB (the winglet).

What errors and messages and showing up in the unity console when you export?

Link to comment
Share on other sites

Because of the way files are stored many operating system round up the summary data for any file to the nearest kilobyte or four so it could be a lot small. Trying bringing up the detailed data to get the exact size of the file. Unless it's a very simple model to test though it's likely too small and the exporter is encountering an error - the smallest stock parts are 4kB (the winglet).

What errors and messages and showing up in the unity console when you export?

Well, looking at the console I get errors about the mesh being non manifold and "convex hull init failed". Not sure what it means. My mesh is very definitely manifold.

Link to comment
Share on other sites

Some times Unity will confuse itself, thinking that the geometry is invalid. Try deleting the hierarchy and recreating it, adding the parts in again from the assets pane.

Link to comment
Share on other sites

Some times Unity will confuse itself, thinking that the geometry is invalid. Try deleting the hierarchy and recreating it, adding the parts in again from the assets pane.

Tried that a few times. I also tried with both DAE file format and OBJ format. It's still not outputting anything other than an 87 byte mu file.

Link to comment
Share on other sites

-Make sure all faces have a material assigned.

-Manually mirroring a mesh can sometimes cause an issue for KSP (By that I mean Scale * -1, not the modifier)

-Make sure the normal directions are OK.

-You can't have too many face on a part without Unity splitting it into separate objects, or KSP refusing to run it. (I mean many thousand faces on one single object can be a problem. Split it up yourself.)

-If you've been animating, and then renaming/deleting obects, delete the animation and start over.

Link to comment
Share on other sites

I know what you're doing - in Unity you need to drag your model file under the PartTools game object in the hierarchy. The entire thing must be a child of the part tools code or it wont export the model OR textures. :D

What you're seeing is a ghost file, basically. Rather misleading.

People often don't realize other less experienced people are doing this because it is the first mistake you make and the first one corrected, so once you've done it once you never see it again lol. But I remember not too long ago...

Edit: Made an image for clarification: this.

Woopsie.jpg

Edited by Bluegobln
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.

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.

×
×
  • Create New...