Jump to content

Developing a Mod?


Omicron314

Recommended Posts

So, after familiarizing myself with the basic premises of the C# programming language, I was thinking that it would be need to try and make my own parts from scratch. Yes, I know there are tutorials on the wiki, but some require Maya and others Unity and blah. So I picked up Blender and Gimp and would like to see what I can conjure up; I was thinking just a basic fuel tank. Does anybody have any get-me-started tips, tricks, or suggestions? The wiki can be a bit vague at times so I would like to make sure I'm not doing something terribly wrong. :)

Link to comment
Share on other sites

In my experience the majority of tutorials deal with the Blender/Gimp->Unity->KSP pathway, I can't directly point you to one at the moment for time limitations but I did want to touch the topic because it appears you've got a misunderstanding about Unity. The purpose of the Unity program in making parts is to serve as a prep and finishing suite for models made in other programs. Unless you want to do things the wrong way and develop without Unity, it does not matter what modeller and what image editor you use, you will import the assets created there into Unity, make sure everything adds up correctly, and export a .mu file which is used in KSP. You will need PartTools as well, it's a script that runs in Unity.

Link to comment
Share on other sites

Progress Report!

Well, after much hard work and tomfoolery, I finally got a part to appear in the game:

snm9l3.jpg

It's a red cube. However, contained within the same file is the texture I thought I assigned it. I was not sure how to reference this, though, because the the part.cfg that I am using is a copied Skipper .cfg with my own values. In order to reference the desired texture, I simply added a line below "mesh = (insert mesh here)" that stated "texture = Kyoob.png" (the name of the texture). As you can see, it did not work, whether or not the .png was in a folder titles "Textures". But I believe that mesh and other such things are set classes, so I can't simply add my own code willy-nillly. How do I do this in a simplistic fashion?

Also, there's this:

nd6446.jpg

The collision mesh does not seem to be working. How do I set up a (specifically convex) collision mesh in Blender? I looked at quite a few guides and they were all either very outdated or decently vague.

One last thing: I noticed that one tutorial (the one for adding hatches and ladders) calls for a .dae to be exported after using Unity. I know how to import a file to Unity, and how to export a file from blender as a .dae, but how do you do both? I could not figure out for the life of me how to import my Unity-modified cube back into Blender.

Sorry to throw so many questions out at once, but I suppose it's better to get them all over with at once. As always, any (constructive) response is appreciated!

EDIT: It appears I did not read the above post carefully enough. Okay, import .blend, export .mu. Got it. :) (Disregard my questions that were answered in previous post, please!)

Edited by Omicron314
Link to comment
Share on other sites

Yeah, there are a lot of outdated tutorials out there. First of all, you got to assign your diffuse texture inside unity, then you can choose to export the model with it in .mbm. Just import the texture then apply it using one of the KSP shaders. You don't have to name the texture in the cfg file. About the collision mesh for your first model, don't even bother making a node_collider in blender. Use the mesh collider in unity, works way better. Take your time to learn how to use PartTools.

This is the most helpful tutorial: http://forum.kerbalspaceprogram.com/showthread.php/25482

It'll teach you about colliders, importing models and textures, shaders...

It uses PartTools .18, so It's a bit outdated, but It works the same way.

Feel free to ask anything else.

Link to comment
Share on other sites

Thank you. I will try this out as soon as I can.

EDIT: More progress has been made! Well, sort of.

First off, VintageXP, the tutorial you linked to was very helpful. I got Part Tools .20 and .18 (because I don't believe the .20 had "Part Tools" as a file; at least, when I tried to assign it to my empty game object, it didn't give me many options to change it.) and I believe I did everything right: I made a model, made a texture, imported both of those and the two aforementioned versions of Part Tools, made an empty game object, parented the textured cube, centered it, assigned Part Tools to the game object, made a collision mesh, exported the model as a .mu and the texture as a .mbm, and put that in the Parts folder, but this is what I got:

2gvs9yb.jpg

Well, at least the texture is there, but the attachment nodes are off. That's strange, but I did use the .cfg from my previous attempt; all I did to it was reconfigure the model directory to model.mu.

Also note how the part is not appearing in the staging. In game, it is unclickable after being placed.

n5j2oj.png

And the collision mesh is not working. That's even more weird. I could have sworn I gave that thing a convex collision mesh in Unity.

So, what might I be doing wrong?

Edited by Omicron314
Added new progress
Link to comment
Share on other sites

OK, you don't need PartTools .18, just .20

in .20 you can assign PartTools to the model by: selecting the model> add component(on the spector menu, bottom right) > KSP > PartTools

I recommend you to start off with simple things, like a fueltank. Engines are a bit more complicated on the Unity side. About the attachment nodes, It could be a scaling problem. Check the scale you imported the model to in unity. Just select the model in the Assets menu. Also check the scale in the CFG file.

I'm glad I could help.

Link to comment
Share on other sites

Here are some little bits you may be over looking....

In Unity make sure your working in LOCAL scale/view not GLOBAL (the toggle is in upper left hand, just above the 3d view window)

Make an 'EmptyGameObject' in Unity and make sure its locations is centered at origin. Then, with said game object selected, in lower right (at bottom of 'inspector' window) click 'Add Component' KSP>PartTools(there are a few choices, make sure to select the one that only says 'part tools')

DO NOT drag and drop part tool from assests into game object.....use add component.

When you add colliders make sure you are adding them to the mesh, not the game object.

Lastly, about configs, the default settings are 'scale =1' and 'rescaleFactor = 1.25'......If no value is defined the system will use these. Rescale setting itsel to 1.25 if not defined really messed me up when I first started making parts.

Hope at least some of this helps =)

Link to comment
Share on other sites

Thanks for the tips, everybody. I'll just ask one question for now: is it necessary to use Part Tools .20? Whenever I choose "Add New Component", there is no KSP folder, and if I select "Part Tools", it appears as "Part Tools (script)" and only lists one option, to "Set GameData Directory". Am I doing something wrong?

EDIT: Nevermind, I got it, thanks to all of you!

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