Jump to content

Why doesn't this work?


Recommended Posts

why wont this code work?

 PART
{

// --- general parameters ---
name = phoenix
module = Part
author = Crasher925

// --- asset parameters ---
MODEL
{
model = Crasher\Parts\phoenix\Phoenix
}
scale = 1
rescaleFactor = 1

// --- node definitions ---

NODE
{
name = Bottom
transform = Bottom
}

// --- editor parameters ---
cost = 1800
category = Pods
subcategory = 0
title = Kerran Empire Pheonix class Command Pod
manufacturer =Jebram Kerman Phoenix co.
description =The Kerran Empire made this pod standard issue on all Phoenix class vessels.

//attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,0,1,1,0

// --- standard part parameters ---
mass = 4
dragModelType = default
maximum_drag = 0.20
minimum_drag = 0.15
angularDrag = 2
crashTolerance = 45
maxTemp = 3400
fuelCrossFeed = True




vesselType = Ship

// --- internal setup ---
CrewCapacity = 3

INTERNAL
{
name = PodCockpit
}

MODULE
{
name = ModuleCommand
minimumCrew = 1
}
RESOURCE
{
name = ElectricCharge
amount = 150
maxAmount = 150
}

MODULE
{
name = ModuleSAS
}

MODULE
{
name = ModuleReactionWheel
PitchTorque = 15
YawTorque = 15
RollTorque = 15
}

}

Link to comment
Share on other sites

The only thing I can think of off the bat is that your model reference doesn't need to be an absolute path. Mine is just model = model.mu and it works just fine. The long-form is, I think, more for referencing a model in another directory. Try making a separate .cfg file without any of the command pod things, see if it loads then.

Link to comment
Share on other sites

Unless I'm much mistaken, it's the path to the model [mesh] that's giving you problems.

Instead of

MODEL

{

model = Crasher\Parts\phoenix\Phoenix

}

scale = 1

rescaleFactor = 1

you'd want something like

//asset parameters

mesh = model.mu //essentially your model file as written by unity; can be called anything .mu

scale = 1

rescaleFactor = 1

I could be wrong - just never seen the MODEL tag used to do that.

Link to comment
Share on other sites

Just to clarify, the .mu file is this?

YourKSPFolder/GameData/Crasher/Parts/phoenix/Phoenix.mu

with that exact capitalization? And if your config file in that same folder?

If it is, then change the MODEL definition to the old style to see if it will load:

mesh = Phoenix.mu

If it does, then its an issue with the exported .mu file coming out of Unity.

You can open up your log file while the parts are loading to find any errors KSP is throwing when trying to load that part, it might narrow it down.

Link to comment
Share on other sites

The current Config is:

 PART
{
// --- general parameters ---
name = PheonixCockpit
module = Part
author = Crasher925

// --- asset parameters ---
mesh = Pheonix_Cockpit.mu
scale = 1
rescaleFactor = 1

// --- node definitions ---

NODE
{
name = Bottom
transform = Bottom
}

// --- editor parameters ---
cost = 1800
category = Pods
subcategory = 0
title = Kerran Empire Pheonix class Command Pod
manufacturer = Jebram Kerman Phoenix co.
description = The Kerran Empire made this pod standard issue on all Phoenix class vessels.

//attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,0,1,1,0

// --- standard part parameters ---
mass = 4
dragModelType = default
maximum_drag = 0.20
minimum_drag = 0.15
angularDrag = 2
crashTolerance = 45
maxTemp = 3400
fuelCrossFeed = True




vesselType = Ship

// --- internal setup ---
CrewCapacity = 3

INTERNAL
{
name = PodCockpit
}

MODULE
{
name = ModuleCommand
minimumCrew = 1
}
RESOURCE
{
name = ElectricCharge
amount = 150
maxAmount = 150
}

MODULE
{
name = ModuleSAS
}

MODULE
{
name = ModuleReactionWheel
PitchTorque = 15
YawTorque = 15
RollTorque = 15
}

}

the error in the log says:

 [LOG 18:16:11.919] Load(Model): Crasher/Parts/Pheonix_Cockpit/Pheonix_Cockpit
[ERR 18:16:11.921] File error:
Failed to read past end of stream.
at System.IO.BinaryReader.FillBuffer (Int32 numBytes) [0x00000] in <filename unknown>:0
at System.IO.BinaryReader.ReadInt32 () [0x00000] in <filename unknown>:0
at A..ReadMesh (System.IO.BinaryReader br) [0x00000] in <filename unknown>:0
at A..ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0
at A.. (.UrlFile ) [0x00000] in <filename unknown>:0
[WRN 18:16:11.927] Model load error in 'G:\Games\KSP_win\GameData\Crasher\Parts\Pheonix_Cockpit\Pheonix_Cockpit.mu'

idk what what to do

Link to comment
Share on other sites

try to remove the underscore from your file name.

If that doesn't fix it, then you're dealing with a bad export from unity. Is the mu file something like a few bytes in size.

You might want to go into Unity and clear out your scene, make a new gameobject and re-attach the Part tools script, and then set your model up again, there are a few things that can break the scene hierarchy and make it export oddly (like a weird animation for instance) and redoing it is the easiest way.

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