Jump to content

TT's IVA Tutorial


TouhouTorpedo

Recommended Posts

I got asked a few questions about IVA transforms today, and that led me to thinking about IVA and checking things enough that I decided might as well make an IVA tutorial finally, since a few others have gone dead now.

TT's IVA cockpit tutorial V1

A somewhat rushed IVA cockpit tutorial without the basic Unity stuff. I've also included the external work like ladder and hatch since it's pretty closely related and almost always going to be there in the same projects.

Where to start?

-------------------------------------

You need to export three different things here. An external model, an internal model, and the props internal cfg. I usually make three blank gameobjects, center them, and build from those, one for each export. Put PartTools on the internal and external, and Proptools on the internal props transform.

also, I recommend you've at least made a fuel tank or engine or something basic in Unity first, so you've got a vague idea what you're doing.

Directions things face

--------------------------------------

the Kerbal transform Z faces forward, Y faces upward.

for external model Z faces up, Y faces forward. For the internal model, Y faces up, Z faces BACKWARD.

for props they are a bit arkward. They all work a little different so you'll just have to try and play it by ear as I don't remember every individual ones direction. Note axis indicators all have the same orientation, so some will need to be placed with their transforms at 90 degrees to the others.

Important note on Scales

--------------------------

you must MUST work to reScaleFactor 1. If you don't, then it won't line up and you'll just have a big headache. Even if you think you'll be clever and resize the internal model 1.25 in Unity. It knows you're being a smartass and it'll make you pay dearly, trust me I tried.

The Layers you need to use and not get wrong for everything in IVA

--------------------------------------

16 - Kerbals

this layer is used for placing the Kerbals transforms, and anything that you want visible in IVA AND the Kerbal portrait cameras. Place any box colliders with IsTrigger set TRUE for areas you can double click to change camera view (these may work on 20-internal space too but I haven't tried)

20 - Internal Space

this layer is used for placing anything that you want visible in IVA but NOT the Kerbal portrait cameras. The external model of the MK3 cockpit is in this layer in the MK3 IVA mod for instance, so it doesn't block the portrait camera views, but is visible on the external cameras or to Kerbals.

How to add IVA cameras

--------------------------------------

in the cfg use "InternalCameraSwitch". Set colliderTransformName to whatever you called it in Layer 16, and set cameraTransformName to the same name as an empty transform in Layer 16. It might not need to be in that layer - thats just what I used. in those transforms Z faces forward, Y faces up.

The Layers AND TAGS you need to use and not get wrong for everything in external model

--------------------------------------

Default - Everything Kerbals won't use.

21 - Part Triggers

Anything you want to use as a Ladder or an Airlock MUST have this set as its layer. But these must also have Tags defined.

Tags to also not get wrong, these are added the same place as Layers by clicking to the right on Element 0:

--------------

Airlock

Ladder

Adding Airlocks and Ladders on your EXTERNAL MODEL

------------------------------------------

Use a BOX COLLIDER in a game object (name not important) X and Z size I use is about 0.5 but vary it as neccesary. A shallow hatch may be more to your taste if you get it working. Hatches Box colliders typically MUST overlap the collider for the model, and the models collider must overlap the ORIGIN of the model (0,0,0). You might get away with either of these but if you get "Hatch obstructed" bug, not following those is probably the cause. Kerbals face toward the Z axis and climb up the Y axis. It is a very good idea to have a Ladder box collider overlapping the Airlock Box Collider, Typically in the same location. Be sure they are in LAYER 21 Part Triggers, and Ladders are set to "Ladder" Tag, and Airlocks to "Airlock" Tag.

Another thing, move the TRANSFORM, NOT THE BOX COLLIDER CENTER. As that'll bug out to hell and just shoot off kerbals into space or inside your model itself. Center must be left as 0,0,0.

For bent ladders just overlap the colliders a little. For climbing over a 90 degree bend, use multiple ladder colliders, so the Kerbal goes over the angle in steps. 3 colliders at 45 degrees should work fine though.

Adding your props

------------------------------

Props are added using proptools. Its pretty self explanatory as you use it to be honest. But the old versions were really buggy and needed you to manually update the exported cfg file to get them working right. It used to export radar altimeter and the axis indicators wrong, so be careful with those and compare them to stock cockpit internal cfg's. This may have been fixed in the newest version.

I always combine the PropConfig.cfg that is exported with the Internal.cfg file, but there is a lot of ways to get these into the model. Firespitter for instance adds these in the part.cfg! Just check out other implementations to find a way you like best.

Final note:

-------------------------------------

Let me know somehow if anything is wrong and I'll look into updating this. I'll hold no responsibility for time spent head butting walls, melting GPU's and cursing Unity's name. You decided to indulge in this torture yourself!

Link to comment
Share on other sites

AWESOME!!

Thanks for this TT!

IVA is one of the few core things I have yet to even try, mainly because all the info I could find was outdated and/or very minimal and hard to follow.

Also....

"It knows you're being a smartass and it'll make you pay dearly, trust me I tried."

best line in a tutorial on anything EVER! lol

Link to comment
Share on other sites

Thanks for posting this here as well TT, added a link to the compilation thread.

I know this is asking a lot but could you add some pictures? People can really struggle without seeing exactly what you mean.

I've ran out of time tonight to be able to do it and wouldn't know exactly which parts to highlight. It should be reasonably self explanatory for someone with a little Unity experience, but if there are specific areas that prove troublesome I may add some images.

Link to comment
Share on other sites

Thanks! This is very helpful.

Not sure if anyone is interested in some screenshots, but I thought I'd share.

Proper orientation for KSP:

CrmwE5e.png

Selected part object to show orientation. Notice this object has the PartTools script.

Yavo69j.png

Selected dummy 'orient' object to show orientation. Notice this object does not have the PartTools or Props scripts.

ULSYyVe.png

Orientation if the dummy 'orient' object is not used.

TmN9mMs.png

First off sorry about the pictures, didn't realize I had exported all that empty space out to the side. Important points you may have understood but I'm going to repeat for clarity:

- The 'Ultralight_Vulture' object is the model, collision meshes, lights, animations, and nodes for the part which appears in the VAB. It is the source of a .mu file via the PartTools script. This .mu goes in the 'Parts' folder and is called by the part module in the .cfg file.

- The 'Ultralight_Vulture-Orient-IVA' object does nothing except make it easier to understand where your various IVA objects are going. It does not output anything useful to KSP and is purely there for convenience.

- The 'Vulture-IVA' object is the model, lights, IVA cameras, and kerbal positions for the IVA mode which appears after you have launched the part. It is the source of a .mu file via the PartTools script. This .mu goes in the 'Spaces' folder and is called by the internal module in the internal.cfg file.

- The 'VultureProps' object is the placeholder for the various props used in the IVA view (Navball, buttons, and such). It is the source of a .cfg file via the PropTools script. This .cfg file provides the PROP {} values for the internal .cfg file in your 'Spaces' folder.

Lastly, I believe the interal.cfg files could be rewritten to look more like the .20 part.cfg files. I have not experimented.

Also, if I am doing something poorly let me know, this is just how I do it and not guaranteed to be the best.

Edited by Alskari
Screenshots
Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Firstly, great tutorial!

My command pod now has a nice interior!

However there is one major issue, that the external model is still visible while in IVA view. For example when looking out of the window collider, you can see the rim of the external models window.

5512vmN.jpg

IOrfUud.jpg

Is there anyway I can fix this?

Link to comment
Share on other sites

Firstly, great tutorial!

My command pod now has a nice interior!

However there is one major issue, that the external model is still visible while in IVA view. For example when looking out of the window collider, you can see the rim of the external models window.

5512vmN.jpg

IOrfUud.jpg

Is there anyway I can fix this?

Command pod scale is wrong by the looks of it. Check your scales again and the notes on that in the tutorial, otherwise make sure the origin points are relatively in the same position on both models.

Proptools is in the parttools system just check through the hierarchy. You need to add the Proptools in then browse for props folder in the KSP folder to get the props. The proptools config export is more or less the same as the parttools one. It'll make an internals file holding all the neccesary information for placing props. I normally pull all that out and put it in the config cfg for the internal.

Hope it helps and glad to see someone making use of the tutorial!

Link to comment
Share on other sites

Command pod scale is wrong by the looks of it. Check your scales again and the notes on that in the tutorial, otherwise make sure the origin points are relatively in the same position on both models.

Proptools is in the parttools system just check through the hierarchy. You need to add the Proptools in then browse for props folder in the KSP folder to get the props. The proptools config export is more or less the same as the parttools one. It'll make an internals file holding all the neccesary information for placing props. I normally pull all that out and put it in the config cfg for the internal.

Hope it helps and glad to see someone making use of the tutorial!

Ah the issue is that the interior was never modelled to be exactly aligned with the outer model, I just designed it roughly the same size, assuming the outer model could be hidden. This will be hell to line up :D .

Still, I now have a working set of altimeters inside, thanks for the tips!

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • 1 month later...
There is an 'InternalSpace' script in the unity part tools package that brings up the prop tools window. Took me quite a while to find it.

How do I use it? Opening it in the bottom "Project" view opens it in "MonoDevelop" and I get no window.

This tutorial only mentions placing props, not making them, haven't found a tutorial on that subject yet.

Edited by K3|Chris
Link to comment
Share on other sites

Lets see, it's been a little while since I made my props so I hope I don't leave anything out. I think you just creat the prop like you would a normal part, say like a fuel tank or whatever. Make sure it's set to be in either the kerbal or interior spaces layer so it shows up in the IVA view. Export it to the game using part tools but put it in a props folder and set up a .cfg file like the one's in squads props folder. That should do it I think.

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