kRPC: Control the game using C#, C++, Java, Lua, Python...

kRPC: Control the game using C#, C++, Java, Lua, Python...

7.8k Downloads

SASMode don't work

Zoeille opened this issue ยท 6 comments

commented

Like i said in the title, SASMode don't work even if the SAS is on and the Get SASMode return the prograde but in game it didn't put it in retrograde, no error in console or in my app

I use the java api
image
image

commented

Fix for retrograde:

refFrame = vessel.getSurfaceVelocityReferenceFrame();
                        vessel.getAutoPilot().setReferenceFrame(refFrame);
                        vessel.getAutoPilot().setTargetDirection(new Triplet<>(0.0,-1.0,0.0));
commented

SAS is not allowed when AutoPilot is enagled:
https://github.com/krpc/krpc/blob/master/service/SpaceCenter/src/Services/AutoPilot.cs#L261

AutoPilot.Disengage() or set AutoPilot.TargetDirection to -vessel.Velocity.

commented

Yes but even with vessel.getControl() it didn't work at all

commented

What version of KSP and what version of KRPC?

I'm using KSP 1.8.1 and 0.4.9-156-g52544abf (as it's write in the VERSION file)

commented

SAS is not allowed when AutoPilot is enagled:
https://github.com/krpc/krpc/blob/master/service/SpaceCenter/src/Services/AutoPilot.cs#L261

AutoPilot.Disengage() or set AutoPilot.TargetDirection to -vessel.Velocity.

Even Target Direction is wrong :(
image

commented

What version of KSP and what version of KRPC?