Contributing
mlheur opened this issue ยท 5 comments
I'd like to try and contribute to KER. Specifically I'm hoping to add kerbonaut mass to any command chairs when calculating dV. Before I can get that far, I'm having trouble recreating the build environment to compile a new fork of this.
I've managed to sort out some issues by making the links for game and KSP-Environment to find the dlls. Still I'm ending up with files not found that exist in CYBUTEK's repository. I overlaid both sources to catch those, added them to the project, but that made things worse.
I'm wondering if you could put together a small blurb how someone can mimic your setup: version of VS, plugins, etc; to work from the same base. kOS did a good one at https://github.com/KSP-KOS/KOS/blob/develop/CONTRIBUTING.md that you could plagir^H^H^H^H^H^H^H leverage as a starting point.
Thanks.
I managed to get it working by VAB assignment, thanks to the exist crew manifest code. That code was never being called because of the check against global KerbalCrewMass always being zero. I did some testing, and yeah it's true kerbals are massless inside command pods (never tested other crewed parts). The total mass of the system will change when you leave a command pod and sit in a chair. Bad game implementation but known issue on forums. Submitted PR on that.
As for recreating the build environment, the biggest challenges for me:
- erroneous errors from extra .csproj files being loaded in .sln, and lying around. Wasted a bunch of time trying to resolve UnityVS.CSharp.targets was not found
- creating the game and KSP-Environment relative paths to link against the system and unity DLLs. Personally I fixed with mklink /d, but to each his own.
- various required source files absent in solution explorer, needed to be added to project from repository. A couple of files in Flight\Readouts\Body\ were in conflict against Flight\Readouts\Orbital\ and I guessed how to resolve it, not sure if I made the right choice but it compiles and runs.
- I copied four files over from CYBUTEK's repository. Not sure if I should've done that or removed them from project in solution explorer. It compiles & runs...
I can update the readme with better instructions, I don't think there was much involved, just referencing the games files. However you should also know that kerbals have no mass by default, although it can be changed in the config or by mods. KER does already support this, or at least it did when I fixed it back when I first started working on it.
Thanks, I'll keep plugging away in the meantime.
https://wiki.kerbalspaceprogram.com/wiki/EAS-1_External_Command_Seat
"A seated Kerbal adds 93.75 kg (0.09375 tons) of mass to a vessel and may cause problems when steering small rockets or rovers."
As for the feature I'm talking about; that works great in-flight, a vessel without any kerbal has higher reported dV than the same vessel with a seated kerbal. I'm wanting to see that difference in KER widget while the VAB, at least I've not seen that in any settings so far. I was thinking to toggle the kerbal's mass based on whether anyone's assigned to the chair in VAB, but if that proves too challenging then I was going to add a toggle in the settings page. I did a similar patch for RCS Build Aid, I used a GUI toggle option and I hard coded the kerbal mass from the KSP wiki; I know I should look it up at runtime but am unfamiliar with KSP api.
its pretty easy to do, see here.
https://github.com/jrbudda/KerbalEngineer/blob/master/KerbalEngineer/VesselSimulator/PartSim.cs#L146
I'm pretty sure KER uses the assigned seats during its simulation in the VAB, I think I saw you can assign kerbals to a command seat at design time now? I'm surprised it doesn't just work already.
Yeah, no that doesn't work automatically in VAB the way we're expecting. I tried that this morning on a clean install of 1.5.1 with only KER 1.1.5.4 before posting to you. I see here getCrewAdjustment checks the global variable kerbalCrewMass != 0. As you state, that value is set to 0 in Physics.cfg; but still the mass of a vessel goes up by 93.75kg when you add a kerbal to the command chair on a vanilla install.