Jump to content

Custom Capsule Issues


Recommended Posts

First off, I'd like to ask if there is a better sub-section of the forum for questions like these.. Read on and see why..

I made a capsule in Blender, textured it, exported and brought it into Unity.

The capsule is made up of 2 objects so I could have 2 materials (per something I read from nli2work?? forgive me, I don't remember the full name off-hand).

I pretty much used the Mk1 command pod .cfg as my custom and the Mk1 are about the same size.. Had to tweak it some.

(I'll include the text of my .cfg just in case, but not sure that's the problem...)

I am able to load KSP and use my custom capsule in the VAB without a problem. However, when I try to launch and the physics kick in, the planet goes away. Map view shows stars and that's it. Can't revert, can't do anything else except go to space center. (still shows the stars, not the usual KSC). I can then use the exit arrow on the lower right of the screen to go back to main menu and exit.

I'm thinking it has to do with the fact I created 2 collision meshes in Unity. (One for each object). (Saw a video of someone destroying Kerbol by using a grabber and colliding).

Should I have not done that? If not, what is the best way to put 1 collision mesh around a single object that is actually composed of 2 objects?

Sorry if this sounds like a noob question, but I am in fact a Noob...

Thanks in advance!

--------------------------- .cfg ---------------------------------------------

PART

{

// this is a sample config file, for determining a good file format for defining part parameters

// comment line - ignored by cfg parser

// empty lines, or lines without a '=' sign are also ignored

// all other lines are split at the '=' sign, and the left operand is used to know what parameter we are setting

// diferent parameters require data in different formats (see docs), and each module has it's own parameters (again, see docs)

// each assignment must be in a single line. Lines without assignments will be ignored. (You CAN turn on word wrap, though)

// each keyword here relates to an existing variable in the assigned module. If the keyword isn't found, it is ignored.

// conversely, if a keyword is left unassigned (as in not in the file), it will be initialized with it's default value

// This is done automatically, so any public variable defined in the loaded module can be accessed this way (provided it's value can be parsed)

// --- general parameters ---

name = orionCapsule

module = Part

author = AcesDwn

// --- asset parameters ---

mesh = model.mu

scale = 1

rescaleFactor = 1.25

// --- node definitions ---

// definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z

node_stack_bottom = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1

node_stack_top = 0.0, 0.6223756, 0.0, 0.0, 1.0, 0.0, 0

bulkheadProfiles = size1, size0

//CoPOffset = 0.0, 0.5, 0.0

//CoLOffset = 0.0, -0.35, 0.0

// --- editor parameters ---

TechRequired = start

entryCost = 0

cost = 600

category = Pods

subcategory = 0

title = Orion Command Capsule

manufacturer = Joe's Exploding Parts LLC.

description = Not sure, but if you think of a good one, let us know before our facility blows up again!

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

attachRules = 1,0,1,1,0

// --- standard part parameters ---

mass = 0.8

dragModelType = default

maximum_drag = 0.2

minimum_drag = 0.15

angularDrag = 2

crashTolerance = 14

maxTemp = 2400 // = 3400

vesselType = Ship

// --- internal setup ---

CrewCapacity = 1

INTERNAL

{

name = orionCapsule

}

MODULE

{

name = ModuleCommand

minimumCrew = 1

}

RESOURCE

{

name = ElectricCharge

amount = 50

maxAmount = 50

}

MODULE

{

name = ModuleReactionWheel

PitchTorque = 5

YawTorque = 5

RollTorque = 5

RESOURCE

{

name = ElectricCharge

rate = 0.24

}

}

MODULE

{

name = ModuleScienceExperiment

experimentID = crewReport

experimentActionName = Crew Report

resetActionName = Discard Crew Report

reviewActionName = Review Report

useStaging = False

useActionGroups = True

hideUIwhenUnavailable = True

rerunnable = True

xmitDataScalar = 1.0

usageReqMaskInternal = 5

usageReqMaskExternal = -1

}

MODULE

{

name = ModuleScienceContainer

reviewActionName = Review Stored Data

storeActionName = Store Experiments

evaOnlyStorage = True

storageRange = 1.3

}

RESOURCE

{

name = MonoPropellant

amount = 10

maxAmount = 10

}

MODULE

{

name = ModuleConductionMultiplier

modifiedConductionFactor = 0.003

convectionFluxThreshold = 3000

}

}

---------------- end .cfg ----------------------------

Edited by AcesDwn
Thank you!
Link to comment
Share on other sites

My Unity object is as follows:

Game Object

--Capsule

----Hull

----Docking

I tried removing the mesh colliders from both the hull and the docking objects.

Then I added a box collider around the capsule object. Still didn't work. Same results..

Edited by AcesDwn
Trying to clarify
Link to comment
Share on other sites

My Unity object is as follows:

Game Object

--Capsule

----Hull

----Docking

I tried removing the mesh colliders from both the hull and the docking objects.

Then I added a box collider around the capsule object. Still didn't work. Same results..

Any chance you could put up a screenshot of your unity setup with the hierarchy visible?

Also, is the game throwing an error in the log when this occurs?

Link to comment
Share on other sites

Honestly I don't know if the game is throwing an error in the log.. All I can seem to do is exit after that happens.

I'll grab a screenshot now. (Please know, I am not a designer so it looks bad, but I'll send it...) LOL

- - - Updated - - -

Is this what you meant?

unitysetup.jpg

Link to comment
Share on other sites

Honestly I don't know if the game is throwing an error in the log.. All I can seem to do is exit after that happens.

I'll grab a screenshot now. (Please know, I am not a designer so it looks bad, but I'll send it...) LOL

It is, but it looks simple enough that I don't think the setup is your problem. I'm curious about that internal your cfg is pointing to, there is no Orion capsule in the default spaces, is that something you've added from another mod? If not, that's one likely culprit there. Try changing it back to whatever the default for the Mk1 pod is and see if it works.

And don't worry about your model, here's one of my early ones:

9OsCOnWm.png

Edited by Randazzo
Link to comment
Share on other sites

Internal? I'm not sure I know what you mean, but Heck! I just found the log you were referring to.. I think you're right. (Please forgive me as a noob..)

Here's a section of the log I found, and yes.. an error.. Does this confirm your thoughts?

---------- Log clip ---------------------

[LOG 01:14:16.477] ------------------- initializing flight mode... ------------------

[LOG 01:14:18.279] Loading ship from file: C:/Program Files (x86)/Steam/steamapps/common/Kerbal Space Program/KSP_Data/../saves/JoeScienceGame/Ships/VAB/Auto-Saved Ship.craft

[WRN 01:14:18.294] [Part]: PartModule indexing mismatch at orionCapsule, index 4.

Node 'ModuleConductionMultiplier' found in loaded data, but 'FlagDecal' is defined in prefab.

Looking for ModuleConductionMultiplier in other indices...

[WRN 01:14:18.296] ...ModuleConductionMultiplier module found at index 5.

[WRN 01:14:18.296] [Part]: PartModule indexing mismatch at orionCapsule, index 5.

Node 'ModuleTripLogger' found in loaded data, but 'ModuleConductionMultiplier' is defined in prefab.

Looking for ModuleTripLogger in other indices...

[WRN 01:14:18.297] ...ModuleTripLogger module found at index 6.

[LOG 01:14:18.321] Untitled Space Craft loaded!

[LOG 01:14:19.758] putting ship to ground: 9.925836

[LOG 01:14:19.762] [untitled Space Craft]: Ready to Launch - waiting to start physics...

[LOG 01:14:19.768] Crewmember Stalie Kerman assigned to Orion Command Capsule, seat # 0 (crew seat index: 0)

[LOG 01:14:19.769] [FLIGHT GLOBALS]: Switching To Vessel Untitled Space Craft ----------------------

[LOG 01:14:19.770] setting new dominant body: Kerbin

FlightGlobals.mainBody: Kerbin

[LOG 01:14:19.773] Clouds: Volume Destroyed

[LOG 01:14:19.808] Clouds: Volume Initialized

[LOG 01:14:19.809] Clouds: Volume Enabled=False

[LOG 01:14:19.810] Reference Frame: Rotating

[LOG 01:14:19.814] Cannot find InternalPart 'orionCapsule'

[EXC 01:14:19.815] ArgumentException: The thing you want to instantiate is null.

UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message)

UnityEngine.Object.Instantiate (UnityEngine.Object original)

Part.AddInternalPart (.ConfigNode node)

Part.CreateInternalModel ()

Part.SpawnCrew ()

Vessel.SpawnCrew ()

Vessel.MakeActive ()

FlightGlobals.setActiveVessel (.Vessel v, Boolean force)

FlightGlobals.SetActiveVessel (.Vessel v)

ShipConstruction.AssembleForLaunch (.ShipConstruct ship, System.String landedAt, System.String flagURL, .Game sceneState, .VesselCrewManifest crewManifest)

FlightDriver.Start ()

[WRN 01:14:19.845] [FlagDecal Warning!]: Flag quad object is given as flagTransform, but no object found in model with that name

[LOG 01:14:20.010] [CHATR] Capsule starts the exchange...

[LOG 01:14:20.011] [CHATR] Capsule starts the exchange...

[LOG 01:14:20.089] [scenarioDestructibles]: Loading... 0 objects registered

[LOG 01:14:20.091] Loading Depletion Nodes

[LOG 01:14:20.092] DepNodeCount: 0

[LOG 01:14:20.092] Loading Biome Nodes

[LOG 01:14:20.093] BiomeNodeCount: 7

[LOG 01:14:20.093] Loading Planet Nodes

[LOG 01:14:20.094] PlanetNodeCount: 3

[LOG 01:14:22.464] Clouds: Volume Enabled=True

[LOG 01:14:22.510] [PlanetariumCamera]: Focus: Untitled Space Craft

[WRN 01:14:22.587] [CurrencyWidgetsApp]: No live widgets to Despawn!

[LOG 01:14:27.036] [untitled Space Craft]: ground contact! - error: 0.038m

[LOG 01:14:27.037] Unpacking Untitled Space Craft

--------------- End log clip ----------------------

Link to comment
Share on other sites

Internal? I'm not sure I know what you mean, but Heck! I just found the log you were referring to.. I think you're right. (Please forgive me as a noob..)

Here's a section of the log I found, and yes.. an error.. Does this confirm your thoughts?

Perhaps, it's certainly broken! ;)

And nevermind about the reaction wheel module, it's fine.

But change this:

INTERNAL
{
name = orionCapsule
}

to this:

INTERNAL
{
name = mk1PodCockpit
}

Link to comment
Share on other sites

Randazzo, you are incredible!!! (I'd love an explanation about the Internal section, but that could be another post sometime..)

I changed it back to the mk1 and IT FLEW!!! Some screenshots for you since you helped SO much! (It's always the simple things isn't it... lol)

orion1.pngorion2.png

Link to comment
Share on other sites

Congrats! Glad I could help. :)

That internal line references another model to represent the IVA of the vehicle. It's an actual model and the default ones are located at .../GameData/Squad/Spaces. When you put OrionCapsule in there, the game was looking for a corresponding model directory and couldn't find it, and thusly the universe divided by zero and imploded.

I'm not sure about that last bit, but the rest is true.

Link to comment
Share on other sites

OH!!

So if I were to texture the inside, I'd have to put it in the spaces directory or something (Not there yet)....

I just left it thinking it was needed.. Hmm..

Well thanks again!!! I can breathe now.. LOL!! :-)

- - - Updated - - -

Randazzo,

Does that mean that having 2 mesh colliders on my 2 seperate objects would have worked then?

Or would that be a problem?

It's working now with the Box Collider, but wouldn't the 2 mesh colliders be better (more in line with the model) ?

Just a curious follow up.. It's working so I won't knock that.... :-)

Link to comment
Share on other sites

OH!!

So if I were to texture the inside, I'd have to put it in the spaces directory or something (Not there yet)....

I just left it thinking it was needed.. Hmm..

Well thanks again!!! I can breathe now.. LOL!! :-)

- - - Updated - - -

Randazzo,

Does that mean that having 2 mesh colliders on my 2 seperate objects would have worked then?

Or would that be a problem?

It's working now with the Box Collider, but wouldn't the 2 mesh colliders be better (more in line with the model) ?

Just a curious follow up.. It's working so I won't knock that.... :-)

I've never had a problem with multiple colliders on a single object. They shouldn't actually collide with each other (unless they are animated or move), at least not that I've experienced.

Link to comment
Share on other sites

Randazzo,

You were certainly right about having many collision meshes.. Shouldn't be an issue.. (I have no animations)

I actually added 2 capsule colliders as well for the "Airlock" and the "Ladder"...

Thanks again for pointing me in the right direction!

Aces

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