Ezriilc / HyperEdit

A plugin for Kerbal Space Program.
http://www.Kerbaltek.com/hyperedit
GNU General Public License v3.0
41 stars 30 forks source link

Planet editor does not change atmospherePressureSeaLevel #52

Closed sworisbreathing closed 5 years ago

sworisbreathing commented 6 years ago

In the current HyperEdit 3 beta for KSP 1.4, the planet editor does not seem to change the atmospheric sea-level pressure.

To reproduce:

  1. Create a ship in SPH with an atmosphere sensor.
  2. Load the ship on the runway.
  3. Activate the pressure sensor (right-click and Toggle Display). It should read around 100kPa.
  4. Open the planet editor and change the atmospherePressureSeaLevel value to something else (halve it, double it, copy from another planet... doesn't really matter), and click Apply.
  5. Note the value on the pressure sensor. It still reads around 100kPa instead of whatever you tried to change it to.

I'm seeing this on KSP 1.4.3 with the making history expansion installed (Mac version). I noticed it because I was trying to test a SSTO design for Eve by copying the conditions to Kerbin, however it doesn't appear to be an issue with the copy function - even editing the value in the planet editor seems to have no effect.

sworisbreathing commented 6 years ago

Not sure if it's related but according to https://wiki.kerbalspaceprogram.com/wiki/API:CelestialBody, atmospherePressureSeaLevel is a float representing the pressure in atm. The planet editor in Hyperedit uses a double representing pressure in kPa.

Ezriilc commented 6 years ago

I'm sorry for the delay in replying here.

I'm not fluent in C#. Can you possibly provide a PR to fix this? Thanks in advance!

Ezriilc commented 6 years ago

Just to ping you, @sworisbreathing ^^

Ezriilc commented 5 years ago

There may be something wrong with the code in this PR. Since I don't really know Git very well, I can't be sure. In my efforts to merge things, I seem to have borked the project.

sworisbreathing commented 5 years ago

@Ezriilc I know Git pretty well. Maybe I can help you get it back on track.

sworisbreathing commented 5 years ago

Ok, there seem to be other issues unrelated to this PR. I've figured out how to get it building on my mac. I'll open another PR to get the project building again.

Ezriilc commented 5 years ago

I have some PRs that should take care of at least some of this. I will report back when I figure what is going on.

craidler commented 5 years ago

Double or Float? Thats all we need to know. We have now #57, #58 and #60 - all messing around with the type of atmo pressure ;-)

sworisbreathing commented 5 years ago

Definitely double.

The KSP Wiki says it's a float but the official API documentation says double.

screenshot

I still can't figure out why it doesn't take effect though.

sworisbreathing commented 5 years ago

temperature also seems to be affected by this bug. gravity works though.

craidler commented 5 years ago

Maybe it recalculates back to original values based on other atmo properties? Might decompile to see how its actually being used.

sworisbreathing commented 5 years ago

found it. it's the atmospherePressureCurve (which is conditionally used based on atmosphereUsePressureCurve). I'm working on adding it to the editor, but it's basically a wrapper for an array of Keyframe objects.

Right now the tricky part is figuring out how to create a text area in C#. The JSON representation is pretty big.

craidler commented 5 years ago

https://docs.unity3d.com/ScriptReference/GUI.TextArea.html