Mihara / RasterPropMonitor

Plugin for Kerbal Space Program. This repository is out of date and is primarily of historic interest. See https://github.com/JonnyOThan/RasterPropMonitor
http://forum.kerbalspaceprogram.com/threads/57603
Other
116 stars 66 forks source link

JSI Props Offset in unity #481

Closed DeputyLOL closed 8 years ago

DeputyLOL commented 8 years ago

I don't really know what is going on or if its this mod or not, but now we have part tools that allow you to edit the mk1 cockpit I thought id give it a shot. Problem is that some of the JSI props don't appear where they should in game. image

image

Not sure if this is unity 5, part tools or this mod but I am really confused. I'm also not sure why none of the textures load in correctly.

MOARdV commented 8 years ago

Are you using PartTools 1.1? I haven't migrated to Unity 5 and PT 1.1 yet, but I will need to some time soon, I'm sure. I don't know why the prop would show up so far from its placed location. Have you looked at it in the config file to see if position values look reasonable (close to the other props)?

MOARdV commented 8 years ago

As a follow-up, assuming you're using PartTools 1.1, your best bet would be to ask on the forum: http://forum.kerbalspaceprogram.com/index.php?/forum/80-11-pre-release-modding-discussions/

DeputyLOL commented 8 years ago

ok, I think that it is the models of the props that you use. stock props and asset props work as expected. The monitors and switches work, I think its just your versions of stock props. ill have a look at the forum anyway.

MOARdV commented 8 years ago

ok, I think that it is the models of the props that you use.

RPM uses the exact same models for the stockalike props - they're not even copies of Squad props.

DeputyLOL commented 8 years ago

It might have been me. I might have been using a newer version of unity

DeputyLOL commented 8 years ago

I don't really know what is wrong. I got the correct version of unity and installed part tools correctly... I have noticed that the only props that are affected by the offset is your stock ones. The normal stocks are fine and the props that don't use a stock model are also fine. The offset only occurs in unity, meaning that it will display in game just fine, but the model in unity is in the wrong place. I work my way around it be placing the stock prop and copying the transforms and rotations to the RPM version, then deleting the stock prop.

I have managed to start throwing an IVA together if you want to implement it in RPM. Its not quite finished yet. 20160411161116_1 20160411161132_1 20160411161139_1 20160411161207_1

MOARdV commented 8 years ago

That IVA looks good so far.

As for what's going on - I have no idea why the props don't show up correctly in Unity. Maybe there's a bug somewhere in PartTools?

DeputyLOL commented 8 years ago

Yeah maybe. I've finished an IVA, I wouldn't try and open it in unity until you have the correct versions and part tools. I learnt the hard way that it will either crash unity or completely freeze you computer!

Here's the config anyway: https://www.dropbox.com/s/d17s08cezhiw99l/internal.cfg?dl=0

There is no monitors on the back of the pod / docking mode as you cant click on them at the back.

MOARdV commented 8 years ago

The question about prop placement sounds a lot like the issue on the forum JPLRepo had:

http://forum.kerbalspaceprogram.com/index.php?/topic/136830-new-parttool-problems-spawning-ivas-for-prop-locating/

MOARdV commented 8 years ago

Did you ever get this sorted out?

DeputyLOL commented 8 years ago

No, but I sort of worked around it by placing the stock version where I wanted it, then copying the transforms. It is still very difficult and annoying though.

DeputyLOL commented 8 years ago

Does Part Tools still work for you? Since updating to KSP 1.1.1, part tools doesn't work anymore in unity.

DeputyLOL commented 8 years ago

Nevermind, turned out to be a problem with tweak scale. New version of MM is up BTW.

JPLRepo commented 8 years ago

I actually have exactly the same issue now with the JSIStockAltimeter, JSIStockFuelPanel, JSIStockMono, JSIStockPower props. I have my model set to 0,0,0 in Unity and saved it. I spawned the IVA and placed props. But in game these props above are misplaced... I figured out why.
When you spawn the above props into Unity their Pivot point for their models are offset and you can see their pivot point off to the left. All the other props I placed have their pivot points in the centre of their models and in game are in the right positions:
2016-05-10 18_11_16-unity personal 64bit - endurance unity - endurance emmissives - pc mac linu

This could be related to that PArttools bug mentioned above, but not sure. It's similar behaviour. In that the pivot is not centered and therefore when it is spawned it appears to be placed correctly but in game the prop is being placed with the pivot on the position in the config file and the model/mesh actually offset to the right.

EDIT: Thinking about this further, I am pretty sure this is related to the bug I reported about parttools. I believe these stock props when they were first exported from unity did not have their origin parent gameobject set to 0,0,0 so now when they are spawned they are offset from 0,0,0. Same as when you spawn an IVA (As per my bug).
The work-around is to position another prop in the location you want and copy the location or replace the prop name in the config file.

MOARdV commented 8 years ago

Yippee... One thing I noticed in the new PartTools: when I select a prop, and then I add a prop, the new prop doesn't automatically copy the old props' position and orientation. With Unity 4 and the old PT, they did. It looks like there are a few new "features" to get used to with the latest PartTools.

DeputyLOL commented 8 years ago

MOARdv, It does actually keep the orientation and position In some circumstances. When I was building the MK1 IVA cockpit I had that problem, but when I was working on my Cockpit mod the props would spawn in on the exsisting prop.

DeputyLOL commented 8 years ago

Ok, now this is magically fixed for me.... Ill keep looking at it.

DeputyLOL commented 8 years ago

quick unrelated question. What would cause this: [Error]: RPMVesselComputer: Processing error while processing CUSTOM_GPWS_TOOLOWFLAPS_ALARM: The requested operation caused a stack overflow.

My guess would be that the variable is too complicated or that it references itself at some point. What do you think?

MOARdV commented 8 years ago

My first guess is it's referencing itself and getting trapped in a loop.

DeputyLOL commented 8 years ago

ok thanks. I just noticed them now when my plane forgot to warn me about landing without flaps. Did you fix the HUD offset thing?

DeputyLOL commented 8 years ago

While on the subject of errors, do you know what this means? [EXC 20:06:55.091] ArithmeticException: NAN System.Math.Sign (Double value) Orbit.solveEccentricAnomalyExtremeEcc (Double M, Double ecc, Int32 iterations) Orbit.getRelativePositionAtT (Double T) Orbit.getPositionAtT (Double T) Orbit.getPositionAtUT (Double UT) JSI.RPMVesselComputer.UpdateLandingPredictions () JSI.RPMVesselComputer.FetchVesselData () JSI.RPMVesselComputer.UpdateVariables () JSI.RPMVesselComputer.FixedUpdate ()

MOARdV commented 8 years ago

While on the subject of errors, do you know what this means?

Yeah. It means update to the latest dev build - I found that and worked around it today. :)

MOARdV commented 8 years ago

The original bug here doesn't look like it's something I can take action on, so I'm closing it out.