Jump to content

New internal props fail to load ingame


Recommended Posts

I've come across a problem that I can't seem to solve, I've created a new set of props for IVA's but more than 2/3 of them fail to load ingame. In the debug log I get this: [Log]: Cannot find InternalProp 'RadarAltimeter'

I don't know what is causing this, It's even more confusing when other props set up in a similar way show up fine.

The PartTools exporter isn't showing any errors either. I have a feeling that it's something really simple too.:huh:

Anyways, Here's the prop setup and config setups (Using ModuleManager, the first is the MM edit, the second is the final config)

Javascript is disabled. View full album

@PROP[RadarAltimeter] {    MODEL {
model = VenStockRevamp/Squad/Parts/IVA/Props/Radargauge
}
}

PROP{
name = RadarAltimeter
MODULE
{
name = InternalRadarAltitude
indicatorName = indicator
increments
{
inc = 0, 0
inc = 34, 100
inc = 70, 200
inc = 110, 300
inc = 145, 400
inc = 180, 500
inc = 215, 1000
inc = 232, 2000
inc = 250, 3000
}
}
MODEL
{
model = VenStockRevamp/Squad/Parts/IVA/Props/Radargauge
}
}

This is the exported Unity Package File

Thanks for reading!

Link to comment
Share on other sites

looks like KSP not finding what it needs to load the part, usually that means MU or one or all of the required texture is not found. I'd look in output_log.txt, search for all hits related to the part that is missing in IVA, and see what the issue is.

Link to comment
Share on other sites

looks like KSP not finding what it needs to load the part, usually that means MU or one or all of the required texture is not found. I'd look in output_log.txt, search for all hits related to the part that is missing in IVA, and see what the issue is.

After Looking through the output_log, I did find a few errors (one of which is below), but most of the problem props lack any sort of description as to why they are failing.

(Filename: C:/buildslave/unity/build/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)

File error:
Failed to read past end of stream.
at System.IO.BinaryReader.ReadByte () [0x00000] in <filename unknown>:0


at System.IO.BinaryReader.Read7BitEncodedInt () [0x00000] in <filename unknown>:0


at System.IO.BinaryReader.ReadString () [0x00000] in <filename unknown>:0


at A..ReadTextures (System.IO.BinaryReader br, UnityEngine.GameObject o) [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

(Filename: C:/buildslave/unity/build/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)


Model load error in 'F:\SteamLibrary\steamapps\common\Kerbal Space Program\GameData\VenStockRevamp\Squad\Parts\IVA\Props\Navball.mu'

And when I re-export the nav-ball in Unity it gives me this:

File error: Cannot Cast from source type to destination type.
at KSPParttools.BitmapWriter.Write2D (UnityEngine.Texture texture, System.String newPath,TextureType) [0x00000] in <filename unknown>:0

I might just try re-exporting all of the models and re-do the unity setup for this one. :huh:

Link to comment
Share on other sites

It looks like PartTools is not able to convert source texture to MBM during export. MU file might still be written, but no textures exported, giving the errors you see in output_log.

Are you assigning DDS textures in Unity, if so try different format like JPG or TGA? could be a material some where with no texture assigned. they're bright purple for visibility, but if you have small parts they might be missed.

Link to comment
Share on other sites

It looks like PartTools is not able to convert source texture to MBM during export. MU file might still be written, but no textures exported, giving the errors you see in output_log.

Are you assigning DDS textures in Unity, if so try different format like JPG or TGA? could be a material some where with no texture assigned. they're bright purple for visibility, but if you have small parts they might be missed.

Oops, It seems that I did give the navball a DDS texture, Well I guess that solves one problem.

Hmm, even after re-exporting most of the models (and caught that a number of them had more than one UV map assigned in blender), They still don't show up.

Link to comment
Share on other sites

yeah, trouble shooting can be a pain. Parts don't show up in VAB for a lot of different reasons, what fixes one doesn't necessarily fix the others. Just have to dig through output_log.txt for the error messages. i use Notpad ++ to list all the log entries with the keyword I search for, and check each one.

always have unity console in verbose mode during export so you can see any warnings or errors. Anything during export almost guarantees the part not loading.

KSP load process goes through all the DLLs first; then MUs, Textures, Configs, and Compiles Parts last. DLLs can be ignored unless you are writing plugins or if your parts is dependent on a plugin, it'd be the last thing to check at any rate.

Search backwards in the logs...

Compile errors tells you what part is missing;

Config errors mean the config file needs to be looked at... bad syntax, punctuation, capitalization, brackets, etc

Texture error can mean missing texture file, wrong path in the config, wrong texture name, unrecognized format, etc.

MU error can mean bad texture reference in the MU, bad animation curves, or other exotic problems people never encountered yet.

I'm pretty certain extra UV sets isn't a problem, Unity only reads from UV0 unless you are using Standard Shader from Unity 5 (which you shouldn't for KSP). Extra channels are dropped somewhere along the line, even if not they are harmless in game.

Link to comment
Share on other sites

yeah, trouble shooting can be a pain. Parts don't show up in VAB for a lot of different reasons, what fixes one doesn't necessarily fix the others. Just have to dig through output_log.txt for the error messages. i use Notpad ++ to list all the log entries with the keyword I search for, and check each one.

always have unity console in verbose mode during export so you can see any warnings or errors. Anything during export almost guarantees the part not loading.

KSP load process goes through all the DLLs first; then MUs, Textures, Configs, and Compiles Parts last. DLLs can be ignored unless you are writing plugins or if your parts is dependent on a plugin, it'd be the last thing to check at any rate.

Search backwards in the logs...

Compile errors tells you what part is missing;

Config errors mean the config file needs to be looked at... bad syntax, punctuation, capitalization, brackets, etc

Texture error can mean missing texture file, wrong path in the config, wrong texture name, unrecognized format, etc.

MU error can mean bad texture reference in the MU, bad animation curves, or other exotic problems people never encountered yet.

I'm pretty certain extra UV sets isn't a problem, Unity only reads from UV0 unless you are using Standard Shader from Unity 5 (which you shouldn't for KSP). Extra channels are dropped somewhere along the line, even if not they are harmless in game.

How do you get the Unity console into verbose mode?

I've checked the log several times, and unfortunately most of the parts just have "Cannot find InternalProp 'x'" when they are compiled. There are several more errors that I've found, but they are secondary to getting the model loaded in the first place. (the square button model isn't named correctly in the parts .cfg, for example.)

Here's my log file if your curious:

http://www./view/0ll23jgoqkaablr/output_log.txt

After a bit more testing, It seems that one of the models loaded into the game just fine if I remove the Internal Space layer and loaded it as a part instead of a prop. I also tried to set a stock Unity cube as a prop but that had the same "Cannot find InternalProp 'x'".

Link to comment
Share on other sites

How do you get the Unity console into verbose mode?

After a bit more testing, It seems that one of the models loaded into the game just fine if I remove the Internal Space layer and loaded it as a part instead of a prop. I also tried to set a stock Unity cube as a prop but that had the same "Cannot find InternalProp 'x'".

Unity Console will list Warnings and Errors in Yellow and Red respectively. default window just shows the entry, selecting an entry will expand a window below full error message

as for layers, double check capitalization and layer # for Internal Space? in your screencaps, the layer is labeled "internal space" instead of "Internal Space"

MFD.mu seems to have same error as Navball.mu, check Unity make sure it doesn't have DDS texture assigned.

SquareButton has this error, looks to be something Internal Module related. If you're using Squad's internal light module, could be that; use RPM's internal light switch instead. Or could be something related to ModuleManager modifications. Or the config file is pointed to a nonexistant GameObject in the MU.

NullReferenceException: Object reference not set to an instance of an object
at InternalButtonLight.OnAwake () [0x00000] in <filename unknown>:0

at InternalModule.Load (.ConfigNode node) [0x00000] in <filename unknown>:0

at InternalProp.AddModule (.ConfigNode node) [0x00000] in <filename unknown>:0

at InternalProp.Load (.ConfigNode node) [0x00000] in <filename unknown>:0

at PartLoader.LoadInternalProp (.UrlConfig urlConf) [0x00000] in <filename unknown>:0

at PartLoader+.MoveNext () [0x00000] in <filename unknown>:0
UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
:MoveNext()

(Filename: Line: -1)

I'd try without the any ModuleManager modifications see if all props to load. Seems like most of your props' MU, Texture, and Configs are loading correctly.

Might help speed things along by searching for specific errors, so you can find Props with same problem, like MFD and Navball.

And little silver lining maybe... KSP tends (before 0.9) to stop loading parts/props altogether when it runs into an error, so some of your Props might be fine on their own, but didn't load because an earlier Prop couldn't load properly.

PS, could you expand this error in Unity Console, if possible, and paste the full error message for me?

File error: Cannot Cast from source type to destination type.
at KSPParttools.BitmapWriter.Write2D (UnityEngine.Texture texture, System.String newPath,TextureType) [0x00000] in <filename unknown>:0

Edited by nli2work
Link to comment
Share on other sites

Unity Console will list Warnings and Errors in Yellow and Red respectively. default window just shows the entry, selecting an entry will expand a window below full error message

as for layers, double check capitalization and layer # for Internal Space? in your screencaps, the layer is labeled "internal space" instead of "Internal Space"

And little silver lining maybe... KSP tends (before 0.9) to stop loading parts/props altogether when it runs into an error, so some of your Props might be fine on their own, but didn't load because an earlier Prop couldn't load properly.

I don't think that Internal Space is caps sensitive, I've made several successful IVA's with the 'internal space' tag set to layer 20.

I just tried overwriting the props directly and after a bit of config editing they load into the game now. The part loader seems to be a picky eater. :huh:

That's one problem solved, now to get everything pointing in the right direction ( though for the life of me, I cannot figure out if the compass and the altimeter are pointing in the right directions(s), but eh, one thing at a time. Thanks for the help!

Just one more thing, my throttle isn't functioning. What does the throttle module look for in the part? (the throttle lever dosn't react to any input, with the keyboard or by clicking. The debug log gives NRE's presumably because It cannot find the throttle's lever).

PS, could you expand this error in Unity Console, if possible, and paste the full error message for me?

File error: Cannot Cast from source type to destination type.
at KSPParttools.BitmapWriter.Write2D (UnityEngine.Texture texture, System.String newPath,TextureType) [0x00000] in <filename unknown>:0

Here's what I get when I expand it:

File error: Cannot cast from source type to destination type.  at KSPPartTools.BitmapWriter.Write2D (UnityEngine.Texture texture, System.String newPath, TextureType texType) [0x00000] in <filename unknown>:0 
at KSPPartTools.PartWriter.WriteTexture (UnityEngine.Texture texture, System.String path, System.String filePath, KSPPartTools.TextureDummy tex, System.String filename) [0x00000] in <filename unknown>:0
at KSPPartTools.PartWriter.WriteTextures (System.IO.BinaryWriter bw) [0x00000] in <filename unknown>:0
at KSPPartTools.PartWriter.Write (System.String modelName, System.String filePath, UnityEngine.Transform target, TextureFormat textureFormat) [0x00000] in <filename unknown>:0


UnityEngine.Debug:LogError(Object)
KSPPartTools.PartWriter:Write(String, String, Transform, TextureFormat)
KSPPartTools.PartToolsInspector:DrawWriterGUI()
KSPPartTools.PartToolsInspector:OnInspectorGUI()
PartToolsEditor:OnInspectorGUI() (at C:/Users/Ven/Documents/KsPMAKE/Assets/PartTools/Editor/PartToolsEditor.cs:18)
UnityEditor.DockArea:OnGUI()


Link to comment
Share on other sites

That's one problem solved, now to get everything pointing in the right direction ( though for the life of me, I cannot figure out if the compass and the altimeter are pointing in the right directions(s), but eh, one thing at a time. Thanks for the help!

Just one more thing, my throttle isn't functioning. What does the throttle module look for in the part? (the throttle lever dosn't react to any input, with the keyboard or by clicking. The debug log gives NRE's presumably because It cannot find the throttle's lever).

Yeah Compass and Navball orientations took a bit of trial and error for me. Don't have any good rules for those, just rotate by 90; test. You can pull the stock Navball into the scene, remove the script component on it and access the objects in the navball, a sort of reference. :D

Throttle prop needs a collider for click detection, set as Trigger in Unity IIRC; and an object to rotate. Default rotate axis is X IIRC. you can specify something to match your part setup I think, instead of orienting your object to match default axis.

Edited by nli2work
Link to comment
Share on other sites

  • 1 year later...

@nli2work maybe you can help me with making a navball prop.

I started by importing the stock iva navball via the mu importer into blender, so i can focus of getting the axis right. But for the love of god i cannot get it right ingame. I only just managed to get a navball that, is some sort of "inverted". Top is bottom, prograde is retrograde, normal is antinormal etc. See the screeny. Stock one on the left, my re-exportet one on the right, just without the base rendered to allow a better view on the actual navball for now.problemy0oh2.jpg

So if you or anyone could show a screenshot of a working navball prop from unity with the axis highlighted?

Also, can somebody tell me what the lines

        iconUp = 0, 1, 0
        anchorName = Anchor

do?

As of now, this prop drove me insane.. :wink:

Link to comment
Share on other sites

https://www.dropbox.com/s/wrloa6dq7bowf9j/InternalProps.zip?dl=0

try the RFNavBall prop in there see if it helps, it's part of the RFProps unitypackage. It's been a long while since I touched anything KSP things are very fuzzy. But if you know exactly how the visible mesh is flipped, it should be simple matter of flipping the mesh in blender without changing the pivot orientation to fix it in KSP. Blender (and Max) compounds the problem as well by having Z up instead of Y up like KSP/Unity.

I don't know anything about the new config entries though... last I made any props was 0.9.

Link to comment
Share on other sites

Got it to work. Aligned the Axis according to your prop, and then it was just a rotation of 180 around x and z (blender axis) of the mesh data, like you said.

Thanks!

PS: also like the use of particles/additive shader to avoid the sorting issues that coplaner alpha blended materials have while maintaining the smother edges! Nice!

Edited by InsaneDruid
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...