Jump to content

[1.2.1] GTIndustries (Updated 24-11-2016)


Warezcrawler

Recommended Posts

This mod have moved to the released section of the forums

 

Ever wished the stock MultiModeEngine could handle more than 2 modes for engines? GTI Multi Mode Engine does exactly this.

The purpose is to introduce an alternative way to switch engine configuration (propellants and other properties). The key source of inspiration comes from InterstellarFuelSwitch by FreeThinker. I find that supplementing it by versatile engines is a great asset. I've added simple intake switching, so intake atm is more attractive, and the days of adding two intake modules to an intake can be over.

Pictures

 

Features:

GTI MultiModeEngine:

  • Multiengine switch (conceptually what InterstellarFuelSwitch does, just for engines)
  • Select which engine ID to affect
  • Availability (Flight, Editor)
  • Propellants, Ratios, IgnoreForISP, DrawGauge
  • Custom naming of Engine configuration
  • Set Engine Type [LiquidFuel, Nuclear, SolidBooster, Turbine, MonoProp, ScramJet, Electric, Generic, Piston]
  • Thrust
  • Heat production
  • Curves: atmosphereCurve, velCurve, atmCurve
  • Technology needed can be defined (currently not working)
  • Engine Exhaust Effect switches when engine is switched
  • UI
    • Override of individual engine Activate, Shutdown and KSPFields in the right click menu
    • UI_CHOOSEOPTION for switching between engine configurations
    • Next/Previous Action
    • Possibility of 8 Individual actions for engine, i.e. first 8 configurations can be accessed directly through actions (custom button defined in VAB or through AGX)

Multi Mode Intakes:

  • Switch intake resources on the fly
    • current resource will be reset to zero (intended)
  • Other setting will remain unchanged for now.
  • Only one intake should be present in any one part. Only the first one is changed.

How: (There are no parts added with GTI Utilities, this is intended for use in other mods)

Spoiler

Add a module to the engine you wish had multiple configurations. These could be different propellants, different ISP etc. like stock switcher

I've tried to comment as best I could in the CGF as well as in the module coding.


For Engines: insert the following module (example)
    MODULE
    {
        name = GTI_MultiModeEngine
        engineID = AirBreathing;AtmBreathing;ClosedCycle;ClosedCycleDarkGoo
        GUIengineID = Air Breathing;Atmosphere Breathing;Rocket;Dark Goo Fusion
        
        availableInFlight = true
        availableInEditor = true
    }

For AirIntakes:
 

    MODULE
    {
        name = GTI_MultiModeIntake

        availableInFlight = true
        availableInEditor = true

        //Resource capacity (generic across all intake resources)
        resMaxAmount = 2
        
        //Resource names for the intake
        resourceNames = IntakeAir;IntakeAtm
        checkForOxygen = true;false
    }

List of Atmosphere Curve in the Kerbol system. Very nice when deciding on form of the curves for the engines.

Spoiler

Use Unity KSPCurveEditor to edit float curves to be used in CFG files, or in this mod. Original post can be found here.

 

1 atmosphere of Pressure = 101.325 Pa

Curve key are:
Hight in meters | Pressure in Pa | In Curve | Out Curve

Planet stats -->
BodyName: Kerbin
Radius: 600000
sphereOfInfluence: 84159286.4796305
GetInstanceID: -213244
atmospherePressureCurve:
bodyItem.atmospherePressureCurve.Curve.keys --> 
key = 0 101.325 0 -0.01501631
key = 1241.025 84.02916 -0.01289846 -0.01289826
key = 2439.593 69.68138 -0.01107876 -0.01107859
key = 3597.11 57.78001 -0.009515483 -0.009515338
key = 4714.942 47.90862 -0.00817254 -0.008172415
key = 5794.409 39.72148 -0.00701892 -0.007018813
key = 6836.791 32.93169 -0.006027969 -0.006027877
key = 7843.328 27.30109 -0.005176778 -0.0051767
key = 8815.22 22.63206 -0.004445662 -0.004445578
key = 10786.42 15.3684 -0.003016528 -0.00301646
key = 12101.4 11.87313 -0.002329273 -0.00232922
key = 13417.05 9.172798 -0.001798594 -0.001798554
key = 16678.47 4.842261 -0.000944854 -0.000944832
key = 21143.1 2.050097 -0.00038941 -0.000389401
key = 26977.92 0.6905929 -0.000125257 -0.000125253
key = 33593.82 0.2201734 -0.000036269 -0.000036268
key = 42081.87 0.05768469 -0.000009063 -0.000009063
key = 49312.13 0.01753794 -0.000003029 -0.000003029
key = 56669.95 0.004591824 -0.000000883 -0.000000883
key = 62300.84 0.001497072 -0.000000308 -0.000000308
key = 70000 0 0 0

Planet stats -->
BodyName: Duna
Radius: 320000
sphereOfInfluence: 47921949.369738
GetInstanceID: -214826
atmospherePressureCurve:
bodyItem.atmospherePressureCurve.Curve.keys --> 
key = 0 6.755 0 -0.0007
key = 12000 1.276 -0.000223 -0.000223
key = 20000 0.241 -0.0000422 -0.0000422
key = 35000 0.015 -0.000002787 -0.000002787
key = 50000 0 0 0

Planet stats -->
BodyName: Eve
Radius: 700000
sphereOfInfluence: 85109364.7382441
GetInstanceID: -213032
atmospherePressureCurve:
bodyItem.atmospherePressureCurve.Curve.keys --> 
key = 0 506.625 -0.08693577 -0.08693577
key = 9723.525 113.5 -0.0149408 -0.0149408
key = 20000 24 -0.001997488 -0.001997488
key = 30000 5 -0.0009176 -0.0009176
key = 45000 0.5 -0.000036774 -0.000036774
key = 80000 0.0023 -0.000000603 -0.000000603
key = 90000 0 0 0

Planet stats -->
BodyName: Jool
Radius: 6000000
sphereOfInfluence: 2455985185.42347
GetInstanceID: -215140
atmospherePressureCurve:
bodyItem.atmospherePressureCurve.Curve.keys --> 
key = 0 1519.875 0 -0.05753474
key = 29000 628.0436 -0.01449255 -0.01449255
key = 123450 22.26 -0.001562163 -0.001562163
key = 150000 2 -0.000136147 -0.000136147
key = 170000 0.1 -0.000010013 -0.000010013
key = 200000 0 0 0

Planet stats -->
BodyName: Laythe
Radius: 500000
sphereOfInfluence: 3723645.81113302
GetInstanceID: -215178
atmospherePressureCurve:
bodyItem.atmospherePressureCurve.Curve.keys --> 
key = 0 60.795 0 -0.005216384
key = 5250 33.40898 -0.004252711 -0.004252711
key = 10000 17.78605 -0.002407767 -0.002407767
key = 17000 7.100577 -0.001092064 -0.001092064
key = 22000 3.812421 -0.000467701 -0.000467701
key = 31000 1.312482 -0.000196177 -0.000196177
key = 38000 0.5104055 -0.000078558 -0.000078558
key = 50000 0 0 0


Planet stats -->
BodyName: Sun
Radius: 261600000
sphereOfInfluence: Infinity
GetInstanceID: -212892
atmospherePressureCurve:
bodyItem.atmospherePressureCurve.Curve.keys --> 
key = 0 16 0 0
key = 5000 8.3 -0.001532 -0.001532
key = 10000 0.68 -0.001178053 -0.001178053
key = 10753.09 0.300954 -0.00002961 -0.00002961
key = 14194.01 0.2613179 -0.000000842 -0.000000842
key = 350000 0.1 -0.000000749 -0.000000749
key = 400000 0.04 -0.000000705 -0.000000705
key = 590000 0.00002 -0.000000006 -0.000000006
key = 600000 0 0 0
 

 

Download:

Download from GitHub (including the source code)

Dependencies:
Module Manager by sarbian which is under a "CC share-alike license"

Changelog:

Spoiler

0.10 (24.11.2016)

  • Fixes applied for switching engine mode.
  • Fixes applied for intake switching. Now only the first intake is manipulated, and any resource that is affected by the intake is manipulated as well.
  • MM patch created to add intake switching for all intakes.
  • MM patch created to remove any multi resource and multi intakes added by other mods, as these are irrelevant if using this mod.
  • Migrated to new naming of plugins and modules.
  • Split module plugins into smaller independent dll's.
  • Dependency to the common GTI_Utilities.dll.

0.9-beta (21.11.2016)

  • Update for KSP 1.2.1
  • Applied fix for effects in the module "GTI_EngineClassSwitch_2"
  • "GTI_EngineClassSwitch" module is currently not functioning, and will most likely be removed when I have confirmed that the fixes for "GTI_EngineClassSwitch_2" is stable.

Note: Effects have to be created for each moduleEnginesFX, also see the included demo of the RAPTOR engine. This is basically a copy of the RAPIER, with 2 new engine modes.

0.8-beta (03.05.2016)

  • Specific actions 5-8 implemented
  • various bug have been eliminated
  • Tech tree integration is currently turned off pending a reimplementations since the one it has now is not good enough
  • Comment: Current state has what stock has, plus it can handle N different engine configurations instead of only two. As stated, there is now 8 custom actions, which can switch to a predefined engine configuration, as well as next+previous. There is also the posibility of disabling switching of engine config mid air, if that is what is needed.

0.7-beta (01.05.2016)

  • Updated to KSP 1.1.2
  • Reimplementation of engine switching [GTI_EngineClassSwitch_2]
    • Stock alike approach - thanks to sarbian and stupid_chris for suggestion and answering of questions
  • Implementation availableInFlight and availableInEditor for engineswitch
  • Implementation switching based on moduleEngines with specified engineID's
  • Implementation of actions - next, previous, specific engine configuretations 1-4
  • Implementation of unified toggle, activate, shutdown - these now functions across all engine modules (applied to the active one)
  • Updated module manager to 2.6.24 for KSP 1.1.2
  • Development of engines to go in the mod continues on the side of finishing the plugin itself

0.6-beta (17-04-2016)

  • Effects are now updating when switching
  • Effects are no longer running wild when loading scene
  • The rest of the effects are now implemented.

0.5.1-alpha (12-04-2016)

  • Now it's possible to add a required technology for each engine propellant combination
    • If no switch combination is available, the configuration in the original engine is used unchanged.

0.5-alpha (09-04-2016)

Added support for

  • atmChangeFlow
  • useVelCurve
  • useAtmCurve
  • Engine thrust is not mandatory anymore
    • Now only Fuels and ratios are mandatory settings
  • Now module manager is distributed with Engine Switcher (version 2.6.21)

0.4.2-alpha (07-04-2016)

- Implementation of UI_CHOOSEOPTION in engineSwitch (thanks to blowfish on doing a small guide)
- Resource panel now refreshes when changing air intake

0.4.1-alpha (04-04-2016)

  • Fixed hardcoded resource switching when switching intakes
  • Fixed null references in intake resources
  • Now all resources in the intake part is deleted and replaced by a new one with specified spec. Thanks to Crzyrndm for advise and references regarding ConfigNode.
  • Example MM files for Engine Switching and Intake Switch included in download.

0.4-alpha (03-04-2016)

  • Added Intake Switch to supplement the Engine Switch
    • only very basic at current state. Only the resource is changed right now.

0.3-alpha (02-04-2016) - First post to the forums

 

Credits and sources of code inspiration:

kerbokatz - Afterburner mod

FreeThinker - Interstellar Fuel Switch

blowfish - advice on UI_ functions

Crzyrndm - advice on ConfigNode coding

NathanKell - for coding advise in the forums

sarbian - Module Manager & advice

 

Licence: https://opensource.org/licenses/MIT

Spoiler

MIT License

Copyright (c) 2016 WarezCrawler

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

 

 

Edited by Warezcrawler
MOD update
Link to comment
Share on other sites

2 minutes ago, FreeThinker said:

Good work, this is a great resource for any future development

One thing that you probably also want to incorporate are different for exhaust effects for every propellant

Thanks... I have considered the the effects. This should be possible in later development. I'll put it on the list. Currently I'm working on the intakes to supplement the engines. Like switching from IntakeAir to IntakeAtm, which is usable on Duna.

Link to comment
Share on other sites

  • Fixed hardcoded resource switching when switching intakes
  • Fixed null references in intake resources
  • Now all resources in the intake part is deleted and replaced by a new one with specified spec. Thanks to Crzyrndm for advise and references regarding ConfigNode.
  • Example MM files for Engine Switching and Intake Switch included in download.
Link to comment
Share on other sites

Another update

This release is where the core functionality is ready for use. There is still some development to do, I'm specifically going to look into FreeThinker's suggestion of incorporating different exhaust effects for every propellant. This should however not affect the functionality already implemented.

[1.1] KSP Engine Switch 0.5-alpha

Added support for

  • atmChangeFlow
  • useVelCurve
  • useAtmCurve
  • Engine thrust is not mandatory anymore
  • Now only Fuels and ratios are mandatory settings
  • Now module manager is distributed with Engine Switcher (version 2.6.21)
Edited by Warezcrawler
Link to comment
Share on other sites

Another update. Now this update bring us into a beta. Key functionality have been implemented, and now the next step will be to create MM patches to stock engine to include in the mod.

Please do not hesitate if you have issues or suggestions for further development.

@FreeThinker I finally got the effects to update as needed. Thank you for the suggestion and help.

[1.1] KSP Engine Switch 0.6-beta

Change status from alpha to beta

  • main functionality now implemented
    • Engine Switch
    • Engine Effect switch
    • Intake Switch

Latest changes

  • Effects are now updating when switching
  • Effects are no longer running wild when loading scene
  • The rest of the effects are now implemented.
Edited by Warezcrawler
Link to comment
Share on other sites

  • 2 weeks later...
9 hours ago, FreeThinker said:

An progress to report?

I've had less time for this than I had in the beginning. But, progress of sorts have been made - just not published.

I had mayor issues with effects not doing as expected.... I went for trying to manipulate the effects at runtime, to stop them running wild (which the last update did not fix entirely for all engines?!?!?!).
During my inquaries regarding this, sarbian & stupid_chris suggested using a more stock alike approach, i.e. instead of changing the engine & effects, I would remove the GUI and shutdown the ones not in use. This approach has the advantage of not requirering as much coding to get functionality (the engines in the CFG has everything already). This also means that my tech requirement functionality is out right now, but it is still something I when in again.

I've been working on that for some hours, while other bug (because of the KSP patches) have annoyed me... Like phantom forces on takeoff....

But let's see if there can be a newer version of this mod for later today maybe.

Link to comment
Share on other sites

Aim is more functionality.

Rapier has two modes only, mine is for as many modes as you would want.

No integration to tech tree, except on part level, I want modes to be dependant on the progress made in technology.... This makes it possible to get an engine early on in the game, which get better and more versatile in late game. Previously you would need multiple parts to achieve this.

No additional cost for having switching possible... I am planning on putting additional cost on having multiple modes, just not sure how at this point. So for now it's just free, as with the rapier.

Hopefully I will in time integrate with the research and development mod which I love. In that mod you can use science to improve parts. Great for late game when the tech tree is maxed out!!!!

Not that I'm saying can all those things right now, especially now that I had to start all over to fix the effects thing.

Link to comment
Share on other sites

2 minutes ago, Warezcrawler said:

Aim is more functionality.

Rapier has two modes only, mine is for as many modes as you would want.

No integration to tech tree, except on part level, I want modes to be dependant on the progress made in technology.... This makes it possible to get an engine early on in the game, which get better and more versatile in late game. Previously you would need multiple parts to achieve this.

No additional cost for having switching possible... I am planning on putting additional cost on having multiple modes, just not sure how at this point. So for now it's just free, as with the rapier.

Hopefully I will in time integrate with the research and development mod which I love. In that mod you can use science to improve parts. Great for late game when the tech tree is maxed out!!!!

Not that I'm saying can all those things right now, especially now that I had to start all over to fix the effects thing.

I looked through the RAPIER engine .cfg and found this module:

MODULE
	{
		name = MultiModeEngine
		primaryEngineID = AirBreathing
		secondaryEngineID = ClosedCycle
	}

It's restricted to two modes. I don't think 'tertiaryEngineID' is a valid line.

Link to comment
Share on other sites

3 minutes ago, MatterBeam said:

I looked through the RAPIER engine .cfg and found this module:


MODULE
	{
		name = MultiModeEngine
		primaryEngineID = AirBreathing
		secondaryEngineID = ClosedCycle
	}

It's restricted to two modes. I don't think 'tertiaryEngineID' is a valid line.

Exactly my point.... We are missing so much :P

EDIT: Plus mine can be configured so that switching can be restricted to the VAB for example... I.e. no advanced mid air switching, if that is what you need.

Edited by Warezcrawler
elaboration
Link to comment
Share on other sites

  • Updated to KSP 1.1.2
  • Reimplementation of engine switching [GTI_EngineClassSwitch_2]
    • Stock alike approach - thanks to sarbian and stupid_chris for suggestion and answering of questions
  • Implementation availableInFlight and availableInEditor for engineswitch
  • Implementation switching based on moduleEngines with specified engineID's
  • Implementation of actions - next, previous, specific engine configuretations 1-4
  • Implementation of unified toggle, activate, shutdown - these now functions across all engine modules (applied to the active one)
  • Updated module manager to 2.6.24 for KSP 1.1.2

  • Development of engines to go in the mod continues on the side of finishing the plugin itself

Link to comment
Share on other sites

I would recommend to upload your mods in zip format instead or rar. The big advantage is that any windows machine can unpack it, this in contrast to rar which requires special tools which are not free. It will also make it easier to host your mod on curse or spacedock, as they only accept zip format. Also you mod is too small to justify and saving in compression

Edited by FreeThinker
Link to comment
Share on other sites

1 hour ago, FreeThinker said:

I would recommend to upload your mods in zip format instead or rar. The big advantage is that any windows machine can unpack it, this in contrast to rar which requires special tools which are not free. It will also make it easier to host your mod on curse or spacedock, as they only accept zip format. Also you mod is too small to justify and saving in compression

Lol... Didn't know that. I've used winrar for so long now..... Just a FYI, 7zip (free) can unzip rar files just fine.... And I do believe that winzip can too.... But I will consider what you are saying the next time I release. Giv me a yell if this is an issue right now, then I will convert til zip before next release.

Link to comment
Share on other sites

@FreeThinker I'm working on integration with the tech tree, but I'm not sure how I want to approach it, and was considering that you might have a suggestion.

What I've done right now, and are not quite happy with, is to add a minimum required tech for each switch possibility, and a max tech.

Minimum gives itself, and is just that you need a specific tech before the engine unlocks.
Maximum is than when you reach a specific tech the engine config becomes obsolete.

I'm considering adding cost for each configuration, but the fit is ambiguous.

It seem overly complicated somehow.... So I'm not that happy about the design. What do you think?

Link to comment
Share on other sites

  • Specific actions 5-8 implemented
  • various bug have been eliminated
  • Tech tree integration is currently turned off pending a reimplementations since the one it has now is not good enough

Current state has what stock has, plus it can handle N different engine configurations instead of only two. As stated, there is now 8 custom actions, which can switch to a predefined engine configuration, as well as next+previous. There is also the posibility of disabling switching of engine config mid air, if that is what is needed.

Downloads

Link to comment
Share on other sites

This looks very slick, as I have in the past tried making the multimode engine module into a three mode engine (by just adding "tertiary mode" to the config:D) and the wall of NRE's in my log said "no." Something to consider, and this might already work already (haven't tested) is RealPlume engine effects. Lower priority obviously.

Cheers.

Link to comment
Share on other sites

2 minutes ago, Deimos Rast said:

This looks very slick, as I have in the past tried making the multimode engine module into a three mode engine (by just adding "tertiary mode" to the config:D) and the wall of NRE's in my log said "no." Something to consider, and this might already work already (haven't tested) is RealPlume engine effects. Lower priority obviously.

Cheers.

This plugin does work as it is. It's very alike the stock one, just have a few additions. Therefore I would expect that it would work fine with other mods that enhances the engines/effects if it work with the stock switcher.

I'm considering pulling all actual parts from the mod, and distribute it as a pure plugin, for other mods to use, like interstellar fuel switch.

Link to comment
Share on other sites

33 minutes ago, riocrokite said:

interesting mod, is it possible to switch between engine mods like that:

A->B->A (first hotkey from action groups)

A->C->A (second hotkey from action groups)

A,B,C being 3 different modes of operation?

The Actions key switching options I've implemented are (assuming only 4 engine configurations, remember we can have as many as we want)

Next
A->B->C->D->A....

Previous
C->B->A->D->C....

The last way is Individual, which I interpret your last one to be? I.e. one action key for a specific configuration. This way you can always jump directly to the configuration you want, no matter if it the 7th configuration and you are on the 2nd.

I recommend the mod AGX for all action key setups, especially because your can change them while in flight.

Link to comment
Share on other sites

@Warezcrawler  Perhaps it's also an idea to replace the switch buttons by UIChooseOption (like I did in IFS) , which takes up less space and gives feedback about the number of switch options.

I myself intend replace all mu switch buttons by UIChooseOption

Edited by FreeThinker
Link to comment
Share on other sites

2 hours ago, FreeThinker said:

@Warezcrawler  Perhaps it's also an idea to replace the switch buttons by UIChooseOption (like I did in IFS) , which takes up less space and gives feedback about the number of switch options.

I myself intend replace all mu switch buttons by UIChooseOption

It is already UIChooseOption. Has been since I switched from 1.05 to 1.1 builds.

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...