Jump to content

[PLUGIN, 0.14.3] Multiversal Mechatronics - Miscellaneous Modules


r4m0n

Recommended Posts

Here is a collection of useful or silly modules. Most of the useful ones were developed with ideas from CardBoardBoxProcessor for his KOSMOS parts.

Variable family

The variable family of modules work together to allow new fuel types and dual-fuel engines, with an compatible RCS module.

To avoid the current fuel-distribution problems, all modules seek fuel sources on the lower stages first, and drain equally all tanks on a stage.

MuMechVariableTank

The base module for new fuel types. Works exactly as a normal FuelTank, with just one new CFG property:

  • type - A string defining the name of the type of fuel contained in the tank. Only engines with the appropriate fuelType will use it.

MuMechVariableEngine

The LiquidEngine replacement for the Variable family. It has the following advantages:

  • Configurable for single or dual fuel use, with options for the usual liquid and RCS fuel, as long as the new configurable ones.
  • Seeks fuel sources on the lower stages first, and drain equally all tanks on a stage.
  • Can be grouped with other engines and provides a window to toggle each group individually. (useful for creating controllable retro-engines)
  • Efficiency can vary with the atmospheric pressure.
  • Nozzle can start retracted and expand when the engine is activated.

CFG properties:

  • group - A string defining the name of the group the engine will belong to. Default: 'Main engine'.
  • start - A boolean value defining if the engine group will start enabled at launch. Default: 'True'.
  • fuelType - The name of the fuel type the engine will consume (using fuelConsumption). Special names: 'liquid' and 'rcs', for the stock tanks. Default: 'liquid'.
  • fuelConsumption2 - A number defining the fuel consumption for the second fuel type. If set to 0, no it won\'t use a second fuel. Default: 0.
  • fuelType2 - The name of the second fuel type the engine will consume (using fuelConsumption2). Special names: 'liquid' and 'rcs', for the stock tanks.
  • liquidSeekAnywhere - If using 'liquid' fuel, if the fuel lookup should follow the new Seek Everywhere rule or the standard liquid fuel way. Default: false (old way)
  • efficiencyASL - The efficiency of the engine at sea level of pressure. 1 = 100%. Numbers larger or smaller than 0~1 range are useful to change the specific range, but the final efficiency will always be between 0 and 100%. Default: 1 (100%)
  • efficiencyVacuum - The efficiency of the engine at zero pressure. Same as efficiencyASL, and the active efficiency will be linearly interpolated between the two values using the current atmospheric pressure. Default: 1 (100%)
  • nozzleExtension - If different that 0, will extend the engine nozzle by the selected amount when the engine is active. It will look for a 'nozzle' object parented to the 'obj_gimbal' of the engine, or use the 'obj_gimbal' if none is found. The DAE model of the engine should have the nozzle in extended position, and the collider should assume the nozzle retracted. Default: 0
  • nozzleExtensionTime - Amount of time to extend the nozzle, if nozzleExtension is active. Default: 5
  • nozzleAxis - A vector indicating the axis where the nozzle with be extended through.

MuMechVariableRCS

The RCSModule replacement for the Variable family. It has the following advantages:

  • Configurable for single or dual fuel use, with options for the usual liquid and RCS fuel, as long as the new configurable ones.
  • Seeks fuel sources on the lower stages first, and drain equally all tanks on a stage.

CFG properties:

  • fuelType - The name of the fuel type the engine will consume (using fuelConsumption). Special names: 'liquid' and 'rcs', for the stock tanks. Default: 'liquid'.
  • fuelConsumption2 - A number defining the fuel consumption for the second fuel type. If set to 0, no it won\'t use a second fuel. Default: 0.
  • fuelType2 - The name of the second fuel type the engine will consume (using fuelConsumption2). Special names: 'liquid' and 'rcs', for the stock tanks.

Toggle family

The Toggle module is the base of a family of on/off modules with options for multiple dynamic settings, on/off models and rotation, with an optional keyboard interface.

MuMechToggle

The base module, which contains the following modes, configurable in the CFG:

Toggleable drag:

  • toggle_drag - Boolean, when active the default angularDrag, maximum_drag and minimum_drag will change when the part is on or off. Default: False.
  • on_angularDrag - Value for angularDrag when the object is on.
  • off_angularDrag - Value for angularDrag when the object is off.
  • on_maximum_drag - Value for maximum_drag when the object is on.
  • off_maximum_drag - Value for maximum_drag when the object is off.
  • on_minimum_drag - Value for minimum_drag when the object is on.
  • off_minimum_drag - Value for minimum_drag when the object is off.

Toggleable resistance:

  • toggle_break - Boolean, when active the default crashTolerance, breakingForce and breakingTorque will change when the part is on or off. Default: False.
  • on_crashTolerance - Value for crashTolerance when the object is on.
  • off_crashTolerance - Value for crashTolerance when the object is off.
  • on_breakingForce - Value for breakingForce when the object is on.
  • off_breakingForce - Value for breakingForce when the object is off.
  • on_breakingTorque - Value for breakingTorque when the object is on.
  • off_breakingTorque - Value for breakingTorque when the object is off.

Toggleable model:

  • toggle_model - Boolean, when active the selected object in the part model will change when the part is on or off. Default: False.
  • on_model - Name of the object in the model that will be shown when the part is on.
  • off_model - Name of the object in the model that will be shown when the part is off.

Toggleable collision (not working well):

  • toggle_collision - Boolean, when active the part collider will be disabled when the part is off, and enabled when on. Currently buggy, use at your own risk. Default: False.

Toggleable rotation:

  • rotate_model - Name of the object in the model that will be rotated.
  • onRotateSpeed - Speed to rotate the object when on, in deg/s. If 0, the object won\'t rotate when on. Default: 0.
  • onRotateAxis - Axis to rotate the object around when on, in local coordinates.
  • onKey - String with the key to toggle the object on/off. The object will start off and go on when active, independent of the key. Default: P.
  • keyRotateSpeed - Speed to rotate the object when using keys, in deg/s. If 0, the object won\'t rotate using keys. Default: 0.
  • keyRotateAxis - Axis to rotate the object around when using keys, in local coordinates.
  • rotateKey - String with the key to rotate the object counter-clockwise. Default: 9.
  • revRotateKey - String with the key to rotate the object clockwise. Default: 0.

MuMechRadiator

Derived from MuMechToggle (ie: has all the same properties), the only new thing in it is that it permanently displays it\'s current temperature. Set its heatConductivity and heatDissipation to properly simulate a radiator.

MuMechSolarPanel

Derived from MuMechToggle (ie: has all the same properties), this module will generate 'power' (as in, any fuel type for a MuMechVariableTank) when the part is on. CFG properties:

  • fuelType - The name of the fuel type the solar panel will produce. Default: 'Energy'.
  • power - A number defining the amount of fuel it generates per second while active. Default: 0.1.

Download here(latest version always included in MechJeb)

Source code available here, GPL license

Edited by r4m0n
Link to comment
Share on other sites

Dual fuel engines? does it mean we could get stack like:

Liquid oxygen tank

Liquid hydrogen tank

some pipes :)

'real engine' which uses mixture of both?? 8)

Yup, it would go something like that in the CFGs:

LOX tank:

module=MuMechVariableTank

type = LOX

LH2 tank:

module=MuMechVariableTank

type = LH2

Engine:

module=MuMechVariableEngine

fuelConsumption = 1

fuelType = LOX

fuelConsumption2 = 1

fuelType2 = LH2

Just for kicks, one of the tests I did before:

7NACp.png

Link to comment
Share on other sites

There is only one problem with 'explicitely bipropellant' engines: without tweakables, going only by units of tanks and half-tanks, hitting the right mixture ratio would be a chore...

I don\'t think I understood properly... You can set the amount of fuel in the tank, and in the engines you select the consumption rate in units/s for full throttle... Else than the consumption changing during flight, I think this is sufficient for most cases.

Link to comment
Share on other sites

I don\'t think I understood properly... You can set the amount of fuel in the tank, and in the engines you select the consumption rate in units/s for full throttle...

I mean, either you have matching pairs of fuel and oxidizer tanks for every combination (is that what you want to do?), or you get much less design options because you need to balance the two components with rough blocks. Either option doesn\'t seem very attractive. With tweakables, we\'ll be able to exactly adjust tank sizes and this could be less problematic, but until then, isn\'t it better to say 'this tank is filled with LO2/LH2, this other one UDMH/N2O2, there is a bulkhead somewhere that divides them'?

Link to comment
Share on other sites

I mean, either you have matching pairs of fuel and oxidizer tanks for every combination (is that what you want to do?), or you get much less design options because you need to balance the two components with rough blocks. Either option doesn\'t seem very attractive. With tweakables, we\'ll be able to exactly adjust tank sizes and this could be less problematic, but until then, isn\'t it better to say 'this tank is filled with LO2/LH2, this other one UDMH/N2O2, there is a bulkhead somewhere that divides them'?

That works if you only have one thing that always consumes the same proportion of fuel. Now, say you have an Ion engine that uses H2 and Power, and you have a Solar Collector that fill the Power tank with time?

Or you have an LOX/LH2 engine, but you also have a Life Support System that slowly uses LOX? Now you unbalance the consumption.

Link to comment
Share on other sites

Turning on/off drag... combined with animation...

AIRBRAKES?!

I\'m working on this now. Though for the sake of me not worrying about animation for now I\'m planning on deriving them from landing gear (done) I eventually want to make them work only off of a custom bind, especially if people want to activate the brakes without putting down landing struts.

I know C# but I don\'t even know where to start, or how to access KSP\'s functions,so I\'m sort of high and dry at the moment.

Link to comment
Share on other sites

I\'m working on this now. Though for the sake of me not worrying about animation for now I\'m planning on deriving them from landing gear (done) I eventually want to make them work only off of a custom bind, especially if people want to activate the brakes without putting down landing struts.

I know C# but I don\'t even know where to start, or how to access KSP\'s functions,so I\'m sort of high and dry at the moment.

Well, I\'m a bit of a spaceplane freak. Ever since I was testing the drone for Tosh I\'ve been wanting to get some airbrakes so I could actually have some control over the speed of my planes, particularly when following something else in the air or bombing. I don\'t know how it would work; the only airbrakes I\'ve encountered IRL are in the Vigilant T1 - they\'re literally little blocks that pop up out of the wing perpendicular to the airflow. IDK how they would work on a C7 plane, but I\'d guess it would be more likely like the sort of airbrakes you get on large aircraft. And guess what, I have no idea how those work.

Good luck if you want to create airbrakes for normal spacecraft, though!

Link to comment
Share on other sites

Large aircraft use spoilers, which are so named because deploying them spoils the airflow, both creating drag and cutting out lift by breaking up the wing surface:

DSCF0645.JPG

Unfortunately calculating things like lift reduction (and employing it) isn\'t going to be very practical, though it could be done. One alternative is a significantly rarer style, which I haven\'t actually seen on any other aircraft, but is employed by the A-10 (and damn hard to find pictures of), which is to use split ailerons:

a10_13.jpg

This does also reduce lift, but is much more significant as a drag-creator, so more straightforward to implement realistically.

Link to comment
Share on other sites

Yeah, the split-ailerons look like something that would work fairly well in KSP. You don\'t really have to simulate loss of lift perfectly at this time - I\'m sure Harv will include realistic airbrakes in a speculated spaceplane-centric update. All we can really do using this plugin is simulate an increased drag, and then see what that does to the behaviour of the plane. It\'ll be as sketchy as the current wing system, but it\'s something. Not sure how we could integrate an animation into it, though.

Link to comment
Share on other sites

Lol spoilers

Large aircraft use spoilers, which are so named because deploying them spoils the airflow, both creating drag and cutting out lift by breaking up the wing surface:

DSCF0645.JPG

Now on a serious note, would it be possible to mix the oxygen plugin that is being created with the LOX or would that just be to hard?

Link to comment
Share on other sites

  • 2 weeks later...

Updated! New stuff:

The VariableEngine now can vary efficiency with the atmospheric pressure, and start with the nozzle retracted, extending when active.

New module for Solar Panels!

Link to comment
Share on other sites

Nice work!

I tried it but it doesen´t work.

I used 2 tanks

-Xenon

-Energy

Engine

but it doesen´t work

could you help me please?

I\'ll need quite a bit of info more than that to help you. If you can post the part.cfg files in pastebin or something, that should be enough for me to spot the problem.

Link to comment
Share on other sites

I wonder if it is possible to make variable RCS engines? So that they can be grouped and enabled separately. If it is not possible with current release, can one expect an update with this feature?

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...