Jump to content

Modding Tutorial Series: Volume 1, Custom Parts


Recommended Posts

Ladies and gents,

I have been working on a series of tutorials lately and have just recently finished Volume 1, Custom Parts! With up-to-date information

(as of 0.23/0.23.5) compiled into one place, the simple tutorials in this volume are all any beginner needs to develop their own parts,

and even help build the foundation for future tutorials!

So, without further ado, here are the episodes! Any feedback or requests are welcome! Also, feel free to ask questions. I'm all ears!

https://https://www.youtube.com/watch?v=FypO9m-i6uw

Link to comment
Share on other sites

Ah yes! the much anticipated episode on fields, events, and actions!

Not sure if sarcasm. Is there something wrong, or were you genuinely waiting for that information? If you have any feedback, I'm more than willing to take it.

Link to comment
Share on other sites

Hi,

nice idea and good job, start watching the 1st episode, you almost do some of the Squad job :D.

Some issues:

- wrong location for the thread, it is more likely to be unseen, unnoticed, forgot, lost. May have been better to put it on add-on dev forum,

- be careful with the sound volume, ep 1, at resources (2'40) volume is lower than before (encoding issue ? mouth to micro distance issue ?) it become worth at 3'27 when you talk about JB-64 and move a bit quite up and down :(.

Link to comment
Share on other sites

So; I am quite proficient when it comes to modeling, I am just brand new to texturing and Blender. How did you manage to get that texture UV-map thing done. I spend an hour struggling last night to figure out how you did it.. but failed and ran back to sketchup :$

Link to comment
Share on other sites

Kerbice, thanks for the feedback. Should I cross-post to that forum? Also, I know sound quality sucks in episode 1. For that episode, I used a headset mic without mastering. You'll notice that in episode 2, I used the same mic, but mastered it all, and that in episodes 3 and 4, I used a much better mic with mastering.

WooDzor, Blender's UI is complicated as crazy. If you can export models to FBX with what you're using, you're fine, but if you want help with Blender, shoot me a PM and I'll help you out in person.

Link to comment
Share on other sites

I tried everything. FBX doesn't even show up when I import, 3ds and dea do..

what%20to%20do%20now.PNG

This is where i am stuck at the moment.. I don't want any fancychmancy animations.. i just want to start photoshopping and see whether i can get this thing into KSP.. I think I cocked up the scale too.. but I am still thinking about which scale to go for.. probably size 2 (orange tank width)

Edited by WooDzor
Link to comment
Share on other sites

so the plan is (just for funz) to have a low poly model with an interior that is visible when you open one of the doors. Maybe not sure whether I should model Kerbals inside too, it would be weird to see them sitting there while on EVA..

Link to comment
Share on other sites

Could you normalize the sound in future videos? The fluctuations are a little annoying to manage manually.

Also Notepad is a bad choice for cfg editing since it doesn't play nice with line breaks. I've had this problem, which lead to modules not working. Notepad++ is better. There are many others.

edit

More criticism:

"1 unit in blender equals 1.25m in Unity"

Yes, No, Maybe, I don't know. It's better to set up Blender to use meters. Scaling then becomes much easier in the config and modelling becomes simpler, because you're working the the actual sizes, without having to do calculations.

edit

-SVG UV layouts are superior to raster layouts.

-Sharp edges should really be made with Edge-Split modifier in Blender. You get more control.

-There's some debate whether MBM is really the best format. I use TGA. It seems to take less space.

-I'm pretty sure the parts folder inside the root is deprecated.

Edited by Cpt. Kipard
Link to comment
Share on other sites

Great series of tutorials, concise and to the point. I hope it continues for many more episodes.

a bit on size scales... figured it out while making my first IVA

KSP applies rescaleFactor of 1.25 by default, so your build size 1, 2, 3 and get 1.25m, 2.5m, and 3.75m in KSP

you can force rescaleFactor to be some other factor, and build your mesh accordingly. Build 1.25 in Blender; set rescaleFactor = 1.0 in config, will get you a same sized part as building 1.0m in blender, and leaving rescaleFactor at default. Build 2.5m in Blender, set rescaleFactor = 0.5, will also get you a 1.25m part in KSP.

Exception to this is IVA, which has to be built at rescaleFactor 1, for whatever reason. but if your EVA mesh was built earlier to the default rescaleFactor, changing the rescaleFactor in config won't line up the EVA and IVA, but exporting it from unity scaled up by 1.25 will make the EVA and IVA meshes line up correctly in KSP (assuming the IVA orientation is correct).

now I find it easier just to build everything 1 to 1; and always set rescaleFactor to 1.0 in the part config file.

Edited by nli2work
Link to comment
Share on other sites

These tutorials are extremely well done and I know they required a lot of time and effort to put together. Thank you for these!

Other replies above have already addressed some points I'd otherwise mention. However a few remain. I understand that the OP is using Windows (7 I think) and that most KSP players use Windows (and that some Mac users have a Windows partition). For those of us who otherwise use Mac OS X, a few notes and recommendations follow.

Of course KSP, 3D modeling apps, image editing apps, the part tools and Unity remain the same and are available from the same sources as shown by the OP; also the interfaces and functions are similar, if not identical.

For cfg. file editing, I recommend the free text editor TextWrangler (the "little brother" of BBEdit). In fact, you can even code with it in several coding languages (with the exception of C#, which language is dominant in the development of Microsoft products).

For an analog to Microsoft Visual Studio, the obvious choice is Xcode, which is free. From Wikipedia: "Xcode supports C, C++, Objective-C, Objective-C++, Java, AppleScript, Python, Ruby and Rez source code with a variety of programming models, including but not limited to Cocoa, Carbon, and Java. Third parties have added support for GNU Pascal, Free Pascal, Ada, C#, Perl, and D." It also supports the new Swift programming language. Check out an article on working with objective-C.

Xcode:

assistant-editor.png

Keep up the good work!

(Note that my parts are not yet available at Cursed. I expect to make more parts after the KSP version 0.24 update, after which I intend to make them available there.)

Edited by Dispatcher
Added an article link.
Link to comment
Share on other sites

Could you normalize the sound in future videos?

As you've seen (heard?), the audio is patchy at best in the first two episodes. That's because I didn't post-process it in the first, and did with the second, but still with a bad mic. You'll notice that episodes 3 and 4 are much clearer and more bearable to watch.

Also Notepad is a bad choice for cfg editing...

I'm aware that there are better tools out there, but the goal is to keep things simple. Notepad is perfectly fine if you don't try to do anything special, and beginners shouldn't be doing anything special.

"1 unit in blender equals 1.25m in Unity"... It's better to set up Blender to use meters...

The conversion between Blender meters and KSP meters is the exact same as the conversion between Blender's default "None" unit and the KSP meter. Hence, 1 Blender "None" unit is equal to 1 Blender meter, which are both equal to 1.25 KSP meters. Since this is true, why bother dragging a new viewer through Blender's already intense UI just to add an "m" to the end of every number? In my eyes, that's even more confusing, because it is then easy to accidentally believe that the ratio is 1m:1m when it's not. With that said, the feedback post right after yours reveals why this is, and I'll be the first to admit that I did not know this until now:

KSP applies rescaleFactor of 1.25 by default, so your build size 1, 2, 3 and get 1.25m, 2.5m, and 3.75m in KSP

So by default, KSP applies the rescale of 1.25 to everything until the player modifies it in a custom model's (part, internal, or prop) config. Thanks for that information, nli2work. I did not know that...

SVG UV layouts are superior to raster layouts.

Indeed, they are, but I'm trying to keep it simple. PNG was the default option, and it does fine for the purposes. Anyone that cares enough for that level of detail probably already knows how to use Blender or an equivalent program.

Sharp edges should really be made with Edge-Split modifier in Blender. You get more control.

Yes, you do, but I claim simplicity again. If you need more control, then the knowledge needed is outside the scope of the tutorial.

There's some debate whether MBM is really the best format. I use TGA. It seems to take less space.

Consistency prevents confusion. Squad uses MBM, and so will I. At least in the tutorials, anyway.

I'm pretty sure the parts folder inside the root is deprecated.

I'm sure it is, which is why I recommended that any custom parts are placed inside their own mod folders. I simply mentioned it so questions didn't have to be raised.

I know it looks like I ripped your criticism to shreds, but please know that I appreciate it regardless. I'd rather have to repeatedly explain my methods than not receive that one thought-provoking criticism that would take my tutorials over the top. So thanks for your opinion regardless.

I understand that the OP is using Windows (7 I think) and that most KSP players use Windows (and that some Mac users have a Windows partition). For those of us who otherwise use Mac OS X, a few notes and recommendations follow... For an analog to Microsoft Visual Studio, the obvious choice is Xcode, which is free...

I was wondering when an OS X user would show up. Would you like to help make a video on Xcode, to help beginners on OS X in plugin development?

Holy crap, I'm done with quotes for the day... But I mean it: thanks for your guys' posts. They really do help me.

Link to comment
Share on other sites

So by default, KSP applies the rescale of 1.25 to everything until the player modifies it in a custom model's (part, internal, or prop) config. Thanks for that information, nli2work. I did not know that...

As far as I can tell it's only for parts. Internal is rescaleFactor 1 default (and completely different orientation), I don't know if there's any way to change it. I don't know about props... I think those scales are just recorded in the internal's config file. Took a while to understand it all when I was trying to make Kerdoz external and internal to match up in size and orientation, the exterior was built at 3 diameter (for 3.75m in KSP) and the internal did not fit correctly until I scaled the external up by 1.25 in Unity before export and forced the KSP rescale to 1.0 in the config file.

Link to comment
Share on other sites

While I'd otherwise love to help as requested, I'm not much of a coder. However, I defer to the more skilled Mac users out there.

Ok then. Anyone else with a Mac and a good microphone want to help make an episode of my series?

Link to comment
Share on other sites

Took a while to understand it all when I was trying to make Kerdoz external and internal to match up in size and orientation, the exterior was built at 3 diameter (for 3.75m in KSP) and the internal did not fit correctly until I scaled the external up by 1.25 in Unity before export and forced the KSP rescale to 1.0 in the config file.

It sounds like the internal is affected by the external's scale in some way. Did you create the internal at 3.75m in Blender? If you did, did it still only fit if the external had a rescale of 1?

Link to comment
Share on other sites

  • 6 months later...

It doesn't require C++ so much as it does C#. I promise, C# is loads easier to deal with than C++ is. Sure, it's still a struggle for people that have never touched code before, but it is by far one of the easier programming languages to learn.

Link to comment
Share on other sites

  • 1 month later...

Hi there,

Nifty thanks for the tutroial, I hope this thread is still watched by you. I don't know where to ask.

I did my first try to mod an engine it is well made following your tut.

But when I swap the model in exchange for the original one it won't start. looking good can be attached. VAB recognizez it like an engine.

Then I throttle up on the launch pad, no particle effects, no backlighting on the thruster, no sound, and no power.... It uses up the resource as the original engine... but dont seem to do somthing usefull...

(just a first try static model this is. The original is the PB-ion)

I made adjustments with the original model by squad. It worked fine. It was Stronger, louder (borrowed from some engine noise mod I didn't remember it's name sorry), has the nice particle effect (borrowed from the hotrockets mod).

So it worked fine with the original model copied over to my folder.

With JUST the model.mu change it stopped working.

What am I missing? (I suspect the animation on the emissive part of it. I don't know yet how am I supposed to do that but that's a later step I think)

Why this thing stopped doing some thrust?

The cfg file looks like this:

PART

{

name = ionEngineR0

module = Part

author = Gary_Ice

mesh = model.mu

scale = 1

rescaleFactor = 0.625

node_stack_top = 0.0, 0.4999, 0.0, 0.0, 1.0, 0.0, 0

node_stack_bottom = 0.0, 0.0001, 0.0, 0.0, 1.0, 0.0, 0

TechRequired = electrics

entryCost = 16800

cost = 97500

category = Propulsion

subcategory = 0

title = PB-ION xenon 0.625m Electric Propulsion System

manufacturer = Gary_Ice

description = To be decided

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision

attachRules = 1,0,1,1,0

sound_loop = running

sound_stop = disengage

sound_stop = engage

sound_stop = flameout

// --- standard part parameters ---

mass = 0.05

dragModelType = default

maximum_drag = 0.2

minimum_drag = 0.2

angularDrag = 2

crashTolerance = 13

maxTemp = 3600

MODULE

{

name = ModuleEngines

thrustVectorTransformName = thrustTransform

exhaustDamage = False

ignitionThreshold = 0.1

minThrust = 0

maxThrust = 25

heatProduction = 0

PROPELLANT

{

name = ElectricCharge

ratio = 8

}

PROPELLANT

{

name = XenonGas

ratio = 1

}

atmosphereCurve

{

key = 0 75000

key = 1 7500

}

}

MODULE

{

name = FXModuleAnimateThrottle

animationName = colorAnimation

dependOnEngineState = True

responseSpeed = 0.5

}

MODULE

{

name = ModuleGimbal

gimbalTransformName = thrustTransform

gimbalRange = 1

}

MODULE

{

name = ModuleTestSubject

// nowhere: 0, srf: 1, ocean: 2, atmo: 4, space: 8

environments = 15

useStaging = True

useEvent = True

}

MODULE

{

name = ModuleGenerator

isAlwaysActive = true

OUTPUT_RESOURCE

{

name = ElectricCharge

rate = 15.0

isTweakable = true

minRate = 0.0

maxRate = 30.0

}

}

RESOURCE

{

name = ElectricCharge

amount = 50

maxAmount = 50

}

RESOURCE

{

name = XenonGas

amount = 400

maxAmount = 400

}

}

So with this setup it working if I copy over the model.mu from squad. not working if I copy over my first static mesh model.mu

Please Help me to get this thing working.

Although this model is in the alpha stage very low poly very ugly I need to figure out how things work.

thank you in advance.

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