#Flight Plan
1 messages · Page 4 of 1
.... I've of course renamed it
let me check if i've commited
well then I can only suggest to debug the code step by step to figure out where it's going wrong
You could even copy the code into your own plugin to test it easier
well I've doing that and of course it must be a typo change somewhere
in the FP code i've got an error in this very line :
K2D2Type = Type.GetType($"K2D2.K2D2_Plugin, {K2D2ModGuid}");
The return K2D2Type is null
Oh right that makes sense
you see something ??
It uses K2D2ModGuid as the assembly name
But your assembly name is different
It's K2D2
oh ....
Basically, Flight Plan will need an update
yes but it will break compatibility with prev versions
Well not really
It already has a check for K2D2 < 0.8.1
nothing prevents adding another check for K2D2 < whatever version this will be
we can add a check for 1.0.0 version of K2D2
and it's working
I've sent a pull request @wind mica
Looks like you guys have been busy! I’ll take care of the PR tonight but I’m on a work trip and can’t recompile it until I get home on Friday
@wind mica i heavily doubt you're inclined to do anything about this, but it looks like there's some reports 0.2.2 broke Flight Plan. Just wanted to let you know, hope you're doing well! :) #1078697132875317358 message
Thanks for calling that to my atention! I am inclined to do something about this - though I'll have to take a look to see what's the matter.
glad to hear!
@grizzled vale I'm tracking down this issue, and it's got me really puzzled. I'm back in the saddle with a debug version of 0.2.2 working, and I've tracked things down to line 1029 in NodeManagerPlugin.cs, but I just don't understand what's going on. What's happening is that, in my AddNode method, I get a weird error as soon as it calls CreateManeuverNodeAtUT. I can set up a breakpoint on that line, but if I try to step into that method I instead get a MissingMethodException error message in the log and it takes me instead to the Update method in AlarmClockForKSP2Plugin.
public bool AddNode(double burnUT = 0)
{
RefreshActiveVesselAndCurrentManeuver();
// Define empty node data
// double UT = GameManager.Instance.Game.UniverseModel.UniverseTime;
double UT = Game.UniverseModel.UniverseTime;
if (burnUT < UT)
{
if (activeVessel.Orbit.eccentricity < 1 && Nodes.Count == 0)
{
burnUT = UT + activeVessel.Orbit.TimeToAp;
}
else
{
if (Nodes.Count > 0)
burnUT = Nodes[Nodes.Count - 1].Time + Math.Min(activeVessel.Orbit.period / 10, 600);
else
burnUT = UT + 30;
}
}
Vector3d burnVector;
burnVector.x = 0;
burnVector.y = 0;
burnVector.z = 0;
bool wtf = CreateManeuverNodeAtUT(burnVector, burnUT, 0);
return wtf;
// return CreateManeuverNodeAtUT(burnVector, burnUT, 0);
}```
The bizarre part is that the error message is "MissingMethodException: Method not found: bool KSP.Sim.Maneuver.ManeuverProvider.AddNodeToVessel(KSP.Sim.Maneuver.ManeuverNodeData)"
The CreateManeuverNodeAtUT method calls Game.SpaceSimulation.Maneuvers.AddNodeToVessel(maneuverNodeData). In fact there's only one place in my code where that method gets called and it's on line 611 of NodeManagerPlugin.cs toward the end of the CreateManeuverNodeAtUT method.
I've tried setting a break point on the first line inside CreateManeuverNodeAtUT, but I can't get there.
If the AddNodeToVessel method isn't available from Game.SpaceSimulation.Maneuvers then why does my code compile?
When I ask VS to show me where Game.SpaceSimulation.Maneuvers.AddNodeToVessel is defined it takes me to some code in ManeuverProvider [decompiled]. And when I dig into that I find this
public void AddNodeToVessel(ManeuverNodeData node)
{
this._game.UniverseModel.FindVesselComponent(node.RelatedSimID)?.SimulationObject.FindComponent<ManeuverPlanComponent>()?.AddNode(node);
this.UpdateActiveNode();
}```
good luck bro. it seems that the api we used have changed or moved. the good thing is taht it perhaps has been corrected. you used to have strange and unexpected behaviour using the ManeuverPlanComponent
are you referencing the newest game DLL? if you're using the Nuget package for KerbalSpaceProgram2.GameLibs, then that's still on 0.2.1, and the method exists there
I just updated the Nuget, so you can change your package reference to 0.2.2
That fixed it! I had four places in Node Manager where I was previously reporting on node.showOutOfFuelMessage (which isn't a thing anymore), and one place where I was expecting a bool but the game now returns void.
With those fixed in NM, FP and MNC now work.
It did change, but only very slightly. It was all related to this I'll wager: "Maneuvers can now be created in the map even if a vessel shows 0 delta-V available"
They used to return a bool from AddNodeToVessel indicating if they were able to or not based on available fuel. Now they don't. So dang simple! I would have found this much faster if I'd only realized I needed to point to the new package... Silly of me.
uploaded
Can we add a tag for 0.2.2? I was updating Node Manager and wanted to tag it for that version but only saw selections for up 0.2.1,
Done
Thanks! Sorry to keep bothering you, but I've run into something I'm not sure how to solve. I'm trying to update FP now so that I can release a version that requires NM 0.8.1 and that uses the KSP 0.2.2 nuget. I compiles just fine on my local machine (59 warnings that don't really matter and no errors), but when I do a pull into my GitHub repo I get this
/home/runner/work/FlightPlan/FlightPlan/src/FlightPlan/Directory.Build.targets(81,9): error MSB3073: The command "mono /usr/local/bin/nuget.exe pack "/home/runner/work/FlightPlan/FlightPlan//Package.nuspec" -OutputDirectory "/home/runner/work/FlightPlan/FlightPlan//nuget" -Properties "NoWarn=NU5125;id=FlightPlan;version=0.10.7;authors=schlosrat;description=Plan your (Space) Flight! Set up useful maneuver nodes to get you where you want to be;repositoryType=git;repositoryUrl=https://github.com/schlosrat/FlightPlan"" exited with code 2. [/home/runner/work/FlightPlan/FlightPlan/src/FlightPlan/FlightPlan.csproj]
So I get the same 59 warnings, plus this error and the build fails
There were two files where there were merge conflicts, but I thought I'd sorted those out and they were very simple
When I look at my local machine it's showing no differences between what I've got locally and whats in either the Dev or Master branches
I believe the merge conflicts were in swinfo on the FP version number and in one place where there was a change for K2D2 compatibility a bit ago. That latter one looked to me like Dev and Master both had the same content, but GitHub claimed there was a conflict.
Hmmm... I seem to have gotten past that. I found one minor thing in the csproj where it was incorrectly looking for NM 0.8.0 - but it was resolving to 0.8.1 and moving on. I did fix that, and was somehow able to get it to accept the merge, but now it barfs on uploading the zip to the release
the release .yml seems to have this
`
- name: Extract current version
id: get-version
run: |
version=$(jq -r '.version' plugin_template/swinfo.json)
echo "Version is $version"
echo "version=$version" >> $GITHUB_ENV
echo "release_filename=flight_plan-$version.zip" >> $GITHUB_ENV
echo "zip=$(ls -1 dist/flight_plan-*.zip | head -n 1)" >> $GITHUB_ENV
echo "upload_url=$(wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq '.[0].upload_url' | tr -d ")" >> $GITHUB_ENV
wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq -r '.[0].body' > ./changelog.md
- name: Upload zip to release
uses: shogo82148/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.upload_url }}
asset_path: ${{ env.zip }}
asset_name: ${{ env.release_filename }}
asset_content_type: application/zip
`
backing up just a bit I see that the Extract current version step is not working.
Run version=$(jq -r '.version' plugin_template/swinfo.json) version=$(jq -r '.version' plugin_template/swinfo.json) echo "Version is $version" echo "version=$version" >> $GITHUB_ENV echo "release_filename=flight_plan-$version.zip" >> $GITHUB_ENV echo "zip=$(ls -1 dist/flight_plan-*.zip | head -n 1)" >> $GITHUB_ENV echo "upload_url=$(wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq '.[0].upload_url' | tr -d \")" >> $GITHUB_ENV wget -qO- https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq -r '.[0].body' > ./changelog.md shell: /usr/bin/bash -e {0} env: SPACEDOCK_MOD_ID: 3359 MOD_DISCORD_THREAD_ID: 1201143568274821210 Version is 0.10.7 ls: cannot access 'dist/flight_plan-*.zip': No such file or directory
I'm having essentially the same problem with MNC.
`Run dotnet build "ManeuverNodeController.sln" -c Release
Determining projects to restore...
Restored /home/runner/work/ManeuverNodeController/ManeuverNodeController/src/ManeuverNodeController.Unity/ManeuverNodeController.Unity.csproj (in 3.95 sec).
Restored /home/runner/work/ManeuverNodeController/ManeuverNodeController/src/ManeuverNodeController/ManeuverNodeController.csproj (in 4.13 sec).
ManeuverNodeController.Unity -> /home/runner/work/ManeuverNodeController/ManeuverNodeController/build/bin/plugin/Release/ManeuverNodeController.Unity/Release/netstandard2.1/ManeuverNodeController.Unity.dll
/home/runner/work/ManeuverNodeController/ManeuverNodeController/src/ManeuverNodeController/MncUiController.cs(564,14): warning CS0168: The variable 'pass' is declared but never used [/home/runner/work/ManeuverNodeController/ManeuverNodeController/src/ManeuverNodeController/ManeuverNodeController.csproj]
ManeuverNodeController -> /home/runner/work/ManeuverNodeController/ManeuverNodeController/build/bin/plugin/Release/ManeuverNodeController/Release/netstandard2.1/com.github.xyz3211.maneuver_node_controller.dll
Cannot open assembly '/usr/local/bin/nuget.exe': No such file or directory.
/home/runner/work/ManeuverNodeController/ManeuverNodeController/src/ManeuverNodeController/Directory.Build.targets(85,9): error MSB3073: The command "mono /usr/local/bin/nuget.exe pack "/home/runner/work/ManeuverNodeController/ManeuverNodeController//Package.nuspec" -OutputDirectory "/home/runner/work/ManeuverNodeController/ManeuverNodeController//nuget" -Properties "NoWarn=NU5125;id=ManeuverNodeController;version=1.2.2;authors=XYZ3211;schlosrat;description=Provides an interface to finely tune maneuver nodes.;repositoryType=git;repositoryUrl=https://github.com/schlosrat/ManeuverNodeController"" exited with code 2. [/home/runner/work/ManeuverNodeController/ManeuverNodeController/src/ManeuverNodeController/ManeuverNodeController.csproj]
Build FAILED.`
Builds fine on my local machine. Fails to build on the repo.
@grizzled vale, I'm having issues with build.yml that I don't know how to resolve. Could you take a look?
it's weird that you're getting that
I'm assuming you didn't change anything in the workflow .yml file
the only other thing I can think of is that something changed on GitHub's backend but that's also weird
I've just now been comparing the build.yml between NM and FP since NM worked when I did this. There was a difference, but that was about NM's build.yml downloading NuGet and then later finding and uploading the NuGet package. I tried aligning them and the build step works (the dotnet build "FlightPlan.sln" -c Release part does), but then it can't find the zip. I'm crap at debugging yml and github actions, so I don't really know what might be going on.
I'm not great at it either tbh
Could I have broken something in the dotnet build "FlightPlan.sln" -c Release part so that the subsequent step can't find what it's looking for?
I mean, possibly, if you changed the targets or props files
Where are those? I can go look
You don't mean the bat scripts do you?
Directory.Build.targets?
That one is identical between NM and FP, but just slightly different in MNC.
yep, Directory.Build.props and Directory.Build.targets
I don't seem to have a Directory.Build.props file, or it's not in that same folder
oh nvm I found it
<- is blind
Not a lot of difference there, but some. Looks like probably necesarry ones
yeah, nothing major
@wind mica just letting you know, the zip on Spacedock for 0.10.7 is corrupted, when downloaded it's only 17 MB instead of 40+
Fucking spacedock. I'll re-upload
I've re-uploaded it twice now. Each time I try and pull it back down I get the same crappy 17 MB file. It's fine on GitHub AFAIK, and it's fine on my computer. I'll take this to them on their discord - I think it's a SpaceDock issue.
Seems like it isnt isolated to Flight Plan, so SpaceDock being the problem would explain a few things (screenshot from someone on the r/ksp server)
Yep SpaceDock got borked when someone tried to upload an unusually large mod. Things seem to be OK
One of the best mods I use in KSP2...it is the must!