Advertisement
Guest User

reaction wheel torque gain patch for tweakable everything

a guest
May 3rd, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.34 KB | None | 0 0
  1. --- E:/gama/kspmodz/TweakableEverything-1.9.1/Source/TweakableReactionWheels/ModuleTweakableReactionWheel.cs    Fri May 01 14:46:02 2015
  2. +++ C:/Users/jazzkutya/Documents/Projects/TweakableReactionWheels/TweakableReactionWheels/ModuleTweakableReactionWheel.cs   Sun May 03 20:22:14 2015
  3. @@ -66,6 +66,11 @@
  4.         [UI_FloatRange(minValue = float.MinValue, maxValue = float.MaxValue, stepIncrement = 1f)]
  5.         public float YawTorque;
  6.  
  7. +       // Stores our value for yaw torque gain.
  8. +       [KSPField(isPersistant = true, guiName = "T. Gain pct", guiActive = true)]
  9. +       [UI_FloatRange(minValue = 0f, maxValue = 100f, stepIncrement = 1f)]
  10. +       public float TorqueGain;
  11. +
  12.         // Construct ALL the objects.
  13.         public ModuleTweakableReactionWheel()
  14.         {
  15. @@ -76,6 +81,7 @@
  16.             this.RollTorque = -1;
  17.             this.PitchTorque = -1;
  18.             this.YawTorque = -1;
  19. +           this.TorqueGain = 100f;
  20.         }
  21.  
  22.         // Runs on start.
  23. @@ -144,6 +150,11 @@
  24.                         this.reactionWheelModule.State = ModuleReactionWheel.WheelState.Disabled;
  25.                     }
  26.                 }
  27. +           }
  28. +           if (HighLogic.LoadedSceneIsFlight && this.reactionWheelModule != null) {
  29. +               this.reactionWheelModule.RollTorque = this.RollTorque*this.TorqueGain/100f;
  30. +               this.reactionWheelModule.PitchTorque = this.PitchTorque*this.TorqueGain/100f;
  31. +               this.reactionWheelModule.YawTorque = this.YawTorque*this.TorqueGain/100f;
  32.             }
  33.         }
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement