public void receiveThrottle(RadioControl sender, float throttle, int transmitChannel) { if (this == sender || channel != transmitChannel) { MonoBehaviour.print("I am the sender or channels are not equal:" + channel + ", " + transmitChannel); return; } print("Listener:" + vessel.vesselName + "received command" + group); this.vessel.ctrlState.mainThrottle = throttle; indicateReceive(true); }
public void receiveCommand(RadioControl sender, int group, int transmitChannel, int agxGroup) //AGX Edited, agxGroup only used if AGX installed { if (this == sender || channel != transmitChannel) { MonoBehaviour.print("I am the sender or channels are not equal:" + channel + ", " + transmitChannel); return; } print("Listener:" + vessel.vesselName + "received command" + group + "|" + agxGroup); Helper.fireEvent(this.part, (int)group, (int)agxGroup); indicateReceive(true); }
/* * public void transmitRotationTo(Vector3 target, bool playSound){ * foreach (var listener in Utility.radioListeners) { * if(listener != null && listener.vessel!= null) * listener.receiveRotation (this, Quaternion.LookRotation((target-listener.vessel.findWorldCenterOfMass()).normalized), (int) channel, playSound); } * indicateSend (); * * * }*/ public void receiveRotation(RadioControl sender, Quaternion targetUp, int transmitChannel, bool playSound) { if (this == sender || channel != transmitChannel || this.vessel == FlightGlobals.ActiveVessel) { MonoBehaviour.print("I am the active vessel or the sender or channels are not equal:" + channel + ", " + transmitChannel); return; } this.vessel.ActionGroups.SetGroup(KSPActionGroup.SAS, true); print("Listener:" + vessel.vesselName + "received command" + group); this.vessel.Autopilot.SAS.LockHeading(targetUp, true); this.vessel.Autopilot.SAS.Update(); indicateReceive(playSound); }
/* public void transmitRotationTo(Vector3 target, bool playSound){ foreach (var listener in Utility.radioListeners) { if(listener != null && listener.vessel!= null) listener.receiveRotation (this, Quaternion.LookRotation((target-listener.vessel.findWorldCenterOfMass()).normalized), (int) channel, playSound); } indicateSend (); }*/ public void receiveRotation(RadioControl sender, Quaternion targetUp, int transmitChannel, bool playSound) { if (this == sender || channel != transmitChannel || this.vessel == FlightGlobals.ActiveVessel) { MonoBehaviour.print("I am the active vessel or the sender or channels are not equal:" + channel + ", " + transmitChannel); return; } this.vessel.ActionGroups.SetGroup(KSPActionGroup.SAS, true); print("Listener:" + vessel.vesselName + "received command" + group); this.vessel.Autopilot.SAS.LockHeading(targetUp, true); this.vessel.Autopilot.SAS.Update(); indicateReceive(playSound); }
//AGX Edited, agxGroup only used if AGX installed public void receiveCommand(RadioControl sender, int group, int transmitChannel, int agxGroup) { if (this == sender || channel != transmitChannel) { MonoBehaviour.print("I am the sender or channels are not equal:" + channel + ", " + transmitChannel); return; } print("Listener:" + vessel.vesselName + "received command" + group + "|" + agxGroup); Helper.fireEvent(this.part, (int)group, (int)agxGroup); indicateReceive(true); }