Jump to content

Nocturnal

Members
  • Posts

    1
  • Joined

  • Last visited

Reputation

0 Neutral

Profile Information

  • About me
    Curious George
  1. I am using the plugin and a raspberry pi to turn my Steel Battalion controller into a mission control for my little nephew (and probably me too). At the moment it's a stand alone train controller (makes train noises and lights up when the buttons are pressed), but I may add a screen for this. Since the controller has 5 convenient switches which I want to use (rather than toggles/buttons), I played a little with your code, and I suggest changing the registerAPI calls for SAS, RCS, Lights, Gears and Breaks in Telemachus/src/DataLinkHandlers.cs to something like this... registerAPI(new ActionAPIEntry( dataSources => { if (dataSources.args.Count.Equals(0)) { TelemachusBehaviour.instance.BroadcastMessage("queueDelayedAPI", new DelayedAPIEntry(dataSources, (x) => { dataSources.vessel.ActionGroups.ToggleGroup(KSPActionGroup.Light); return 0d; }), UnityEngine.SendMessageOptions.DontRequireReceiver); return predictFailure(dataSources.vessel); } else { TelemachusBehaviour.instance.BroadcastMessage("queueDelayedAPI", new DelayedAPIEntry(dataSources, (x) => { dataSources.vessel.ActionGroups.SetGroup(KSPActionGroup.Light, bool.Parse(dataSources.args[0])); return 0d; }), UnityEngine.SendMessageOptions.DontRequireReceiver); return predictFailure(dataSources.vessel); } }, "f.light", "Light", formatters.Default)); Which preserves the current function, but also allows for the state to be set directly with f.light[true] or f.light[false]
×
×
  • Create New...