Jump to content

woodywood245

Members
  • Posts

    153
  • Joined

  • Last visited

Everything posted by woodywood245

  1. Sensor Reporter 1.4 for kOS 0.9 Now Available LICENSE Hi guys, So I finally decided to write my own mod. Now that kOS allows mod developers to register plugin functions with it, I decided to write a plugin that filled a hole that I thought really needed to be filled. The Sensor Reporter for kOS mod can be used to grab sensor information and use it in kOS scripts. This mod can also be used to toggle sensors on and off programatically through kOS scripts. http://kerbalspaceprogram.com/sensor-reporter-kos/ The mod uses ModuleManager to modify stock sensor parts. Sensor Reporter does not work with the Hot Beverage Inc. sensor mod. (Thanks for letting me know, Camacha) Sensors have to be attached to the same craft as the kOS computer, otherwise the functions will not become exposed. Also, in order to get valid data, the sensors must be powered and turned on. I took a few hours out of the day to make this, so it's probably not perfect, though it's not complicated. Update! As of version 1.4, kOS 0.7 is no longer being supported. All single-precision returning functions have been removed. Do not use sensor!____f() functions anymore; they won't work. On the upside, I've added four new math functions, and a new vessel function: math!log(number) - returns the base-10 logarithm of the given number. math!logb(number, base) - returns the logarithm of the given number of the given base. math!ln(number) - returns the natural logarithm of the given number. math!e() - returns the natural log base constant e. vessel!isp() - returns the sum of specific impulse of all active engines. Also, I've moved all non-sensor functions to a PartModule called kOSExtensions. These functions are available regardless of whether you have any sensors on the spacecraft. Sensor functions are still only available if you add the appropriate sensors. Update! As of version 1.3.2, function names no longer use colons. Colons are replaced with exclamation points. Therefore: print sensor:grav(). Becomes print sensor!grav(). Also, the toggle functions now return a boolean value, the result of which is the result of the toggle. You MUST use SET or LOCK with toggle functions as of the latest version, otherwise they will not work. These changes have been made in response to the new expressions evaluation system in kOS 0.9, which stops the original system from working correctly. Be sure you adjust your existing code accordingly. Update! As of version 1.3.x, there are 8 new functions: - math!pi() and math!pif() return representations of pi in double-precision and single-precision floats, respectively. Use the latter in kOS 0.7. - physics!gravconst() and physics!gravconstf() return representations of the Gravitational Constant in double-precision and single-precision floats, respectively. Use the latter in kOS 0.7. - vessel!velocity() and vessel!velocityf() return the current orbital velocity of the vessel in double-precision and single-precision floats, respectively. Use the latter in kOS 0.7. - eta!apoapsis() - returns the seconds to apoapsis as a double-precision float. - eta!periapsis() - returns the seconds to periapsis as a double-precision float. The last two are intended as a "fix" to the current problem in kOS, where eta!apoapsis and eta!periapsis do not return values that work with math or comparison operators.
×
×
  • Create New...