Jump to content

[Tutorial] How to make your own balloon part using KerBalloons


Recommended Posts

This tutorial is for KerBalloons v0.3.0 and will be updated soon though most of the process hasn't changed. If you have any questions in the meantime just ask.

Hi, I am the author of the KerBalloons mod and I thought I'd write a little tutorial on how you can make your own balloons.

I am going to write this assuming that you have some knowledge already as there are plenty of guides out there already for basic modding.

First of all you are going to need the KerBalloons.dll which you can get from here.

Step 1 - Model & Texture

Next model and texture your balloon in what ever program you use, I used blender. You will need a few things in order for your balloon to work and they have to be set up quite specifically.

First you will need a balloon model, a rope model, a base model and a cap (the bit that comes off the base when you inflate the balloon) model.

The next important step is the parts' origins.

The balloon's origin needs to be at the very bottom of the model, where it connects to the rope.

The rope's origin also needs to be at the very bottom, where it connects to the base.

It is also important that the x,y,z scale for the balloon is 1,1,1 and the upwards scale of the rope (usually z axis) must also be 1. If not you will have a hard time with the config. In blender you can edit the scale in edit mode (press tab) and that does not affect the x,y,z scale.

The origin of the base and cap don't really matter but for simplicity it is easiest to set them to 0,0,0. This makes the config easier later as well.

If you want a flagDecal object then just create it and make it a child of the balloon object and UV map it. If you want multiple flags then you can have them but you will need to join them into one object before you export.

When you're done export it. I would recommend exporting as FBX.

7r2gOeM.png

Step 2 - Unity

Before we start, make sure you have Unity set up for modding KSP.

Now import your balloon FBX file into Unity and drag it into the scene and make sure it is zeroed (at 0,0,0).

Once you have done that you have some fiddling to do.

Create an empty GameObject and move it to 0,0,0. You can call it whatever but make sure it is not the same name as any other objects.

Drag all your objects into this.

Create two new empties, again these can be called whatever you want. I called mine liftPoint and balloonPoint.

liftPoint is where the lift force is applied and balloonPoint is just where the balloon attaches to the rope.

Drag liftPoint under you balloon object and balloonPoint under your rope object.

Align the liftPoint to the centre of the balloon - because that's where you want the lift to be applied.

The balloonPoint object should be at the very top of the rope - because that is where the balloon will attach.

Now add your colliders

Now set the balloon scale to something very small such as 0.01,0.01,0.01 but DO NOT make any of the scales 0 - this will cause the game to freak out when you launch the ship.

Set the scale of the upwards length of the rope (usually the z axis) to 0 - yes it is safe here.

Now drag the balloon inside the base, it doesn't really matter where exactly just so you can't see it - you can align it with the rope if you want.

Add a PartTools component to your parent empty GameObject you created, set the model name, file url and texture format and press write when you're finished.

FBXEbUC.png

Step 3 - The Config

Again, I am going to assume you know how to do a config so I am just going to show you the parts necessary for the balloon to work, you can look at the full config for one of the KerBalloon parts if you need to see what the whole thing looks like

So lets go through it

A list of the bodies and their spelling can be found here

When you are done you can delete all the text after the "//" if you want, they're just comments to help you out.

 

 
MODULE
{
	name = ModuleKerBalloon //Leave this alone
	minAtmoPressure = 5 //Make this the pressure at which you want the balloon to burst, you can use a barometer in KSP to check the pressure at different altitudes
	maxAtmoPressure = 102 //Similar to above but the maximum pressure
	minScale = 1 //You'll mostly want to just leave this at 1 but this is the smallest scale the balloon can be when inflated
	maxScale = 5 //As the pressure decreases the balloon will expand, this value dictates by how much. 5(max scale)/1(min scale) = 5 (the balloon will be 5 times bigger at max size)
	minLift = 0.66 //in kN, the amount of lift the balloon has it it's minimum (just before it bursts)
	maxLift = 1 //same as above but the max lift (the lift at the max pressure)
	recommendedBody = Kerbin //The name of the body, make sure this is spelt as it is in game - case is important. Remember balloons won't work on planets without an atmosphere
        bodyG = 9.81 //only add this if you are using non-stock planets, set it to the surface gravity of the planet. If using stock planets DELETE THIS LINE
	CFGballoonObject = Balloon //The name in unity of your balloon object
	CFGropeObject = Rope //The name in unity of your rope object
	CFGcapObject = Cap //The name in unity of your cap object
	CFGliftPointObject = liftPoint //The name in unity of your liftPoint object
	CFGballoonPointObject = balloonPoint //The name in unity of your balloonPoint object
}

EFFECTS
{
	inflate //leave this alone
	{
		AUDIO
		{
			clip = KerBalloons/Sounds/inflate //link to your inflate sound
			volume = 1
		}
	}
	deflate //leave this alone
	{
		AUDIO
		{
			clip = KerBalloons/Sounds/deflate //link to your deflate sound
			volume = 1
		}
	}
	burst //leave this alone
	{
		AUDIO
		{
			clip = KerBalloons/Sounds/burst //link to your burst sound
			volume = 1
		}
	}
}

 

Step 4 - Test it

It should now all be working, load up the game and check the part is there. Right clicking the part should also show info about the balloon such as lift and pressure limits. The max payload calculations are done automatically

Also don't forget to share your creations with me, I might just feature them on the KerBalloons thread

aoONcEJ.png

Step 5 - Ask for Help

If you run into problems at any point or notice something missing from this tutorial that you think is needed then just comment below and I'll try to help as best I can.

Edited by JoePatrick1
Link to post
Share on other sites
  • 1 month later...

Reserved for Updates

06/12/15
-Recompiled for KSP 1.0.5
-Fixed issue where when a balloon bursts, all other balloons also burst regardless of whether or not they should
-Fixed issue where some cfg values could not be edited

Edited by JoePatrick1
Link to post
Share on other sites
  • 1 month later...
  • 2 months later...
On 23/01/2016 at 9:56 PM, RocketSquid said:

I'm working on some balloons intended for airships. Is there any way to make a zeppelin-type rigid balloon that does not inflate?

Sorry for late reply, didn't see this.  

Where I said to set the balloon scale to something small like 0.01,0.01,0.01, you could just leave it at 1,1,1 then also set min and max scale in the config to 1 - that should work. The balloon will still have to be inflated but the inflating animation won't happen, it wall stay at 1,1,1 scale.

Link to post
Share on other sites
  • 1 month later...
9 minutes ago, JoePatrick1 said:

Do you mean through programming or otherwise?

through the config file. is there a way to make something like a Hot Air or controllable-lift KerBalloon though config parameters?

I wish to, as I have said on the other forums, make a science balloon that can basically meander around to all of the biomes at a certain altitude. As kerballoons cannot do this currently, I was wondering if I can edit the config to create such a lift control.

Edited by Rory Yammomoto
Link to post
Share on other sites
2 hours ago, Rory Yammomoto said:

through the config file. is there a way to make something like a Hot Air or controllable-lift KerBalloon though config parameters?

If not, I  have an idea: it could work by changing the weight rating- a negative one would make you fall, a positive one could make you rise.

 

Through the config this is not really possible, it would require changes to the module (though I am thinking of adding a hover mode). You could create your ship to have a mass in between the two payload ratings which would make it rise and fall continuously as it would not have enough lift to reach the point where the balloon would burst

Edited by JoePatrick1
Link to post
Share on other sites
1 hour ago, JoePatrick1 said:

Through the config this is not really possible, it would require changes to the module (though I am thinking of adding a hover move). You could create your ship to have a mass in between the two payload ratings which would make it rise and fall continuously as it would not have enough lift to reach the point where the balloon would burst

DO IT. It would be really nice, and would keep us from needing two balloon mods instead of one (This and Hooligan Labs, which just came back).

Edited by Rory Yammomoto
Link to post
Share on other sites
16 minutes ago, Rory Yammomoto said:

DO IT. It would be really nice, and would keep us from needing two balloon mods instead of one (This and Hooligan Labs, which just came back).

Should be pretty easy to add - most of the framework is already there from the latest update

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