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

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

7.8k Downloads

Dont work "conn.Drawing().AddDirection()"

HyperPos opened this issue ยท 3 comments

commented

Even the standard example C# does not work:

using System;
using KRPC.Client;
using KRPC.Client.Services.Drawing;
using KRPC.Client.Services.SpaceCenter;

class VisualDebugging
{
    public static void Main ()
    {
        var conn = new Connection ("Visual Debugging");
        var vessel = conn.SpaceCenter ().ActiveVessel;

        var refFrame = vessel.SurfaceVelocityReferenceFrame;
        conn.Drawing ().AddDirection(
            new Tuple<double, double, double>(0, 1, 0), refFrame);
        while (true) {
        }
    }
}

Error:
"System.ArgumentNullException: 'Value cannot be null.
Parameter name: shader
Server stack trace:
at (wrapper managed-to-native) UnityEngine.Material.CreateWithShader(UnityEngine.Material,UnityEngine.Shader)
at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00007] in <5aeafee3fea24f37abd1315553f2cfa6>:0
at KRPC.Drawing.Drawable1[T].set_Material (System.String value) [0x0000c] in <82f4ee9c3604449bbd2dc8f3a69fa0cf>:0 at KRPC.Drawing.Drawable1[T]..ctor (System.Type rendererType) [0x00041] in <82f4ee9c3604449bbd2dc8f3a69fa0cf>:0
at KRPC.Drawing.Line..ctor (Vector3d lineStart, Vector3d lineEnd, KRPC.SpaceCenter.Services.ReferenceFrame referenceFrame, System.Boolean visible) [0x00000] in <82f4ee9c3604449bbd2dc8f3a69fa0cf>:0
at KRPC.Drawing.Drawing.AddDirection (KRPC.Utils.Tuple`3[T1,T2,T3] direction, KRPC.SpaceCenter.Services.ReferenceFrame referenceFrame, System.Single length, System.Boolean visible) [0x00028] in <82f4ee9c3604449bbd2dc8f3a69fa0cf>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in :0 '
"

commented

I experienced the same issue using Python. At the beginning, the game lags and I shut down the script. Afterwards, this error keeps showing up.

commented

I experienced the same issue using Python. Do you know how to solve it?

commented

Was fixed in #585