Closed SodaPopinski closed 1 year ago
We are currently figuring out how to trigger action groups the "correct way". My initial guess just to call VesselComponent.SetActionGroup
does not seem to be reliable enough. Once that is sorted out it should be easy to add all the custom action groups
... and I just took a brief glance that new the EngineMode
. In KSP2 this is now much more generic and not just "AirBreathing Y/N`, i guess a preparation for some of the futuristic engines to come.
If I remember correctly one the "Near Future" mods of KSP1 had some Vasimr-like engines that could operate in multiple modes as well.
Anyway, that will take a moment to sort out ;)
Current release: https://github.com/untoldwind/KontrolSystem2/releases/tag/v0.1.7 has bindings for all the custom action groups as well es additional mode information for the engine.
A little script to demonstrate:
use { Vessel } from ksp::vessel
use { CONSOLE } from ksp::console
pub fn main_flight(vessel: Vessel) -> Result<Unit, string> = {
CONSOLE.clear()
CONSOLE.print_line("No Engines: " + vessel.engines.length.to_string())
for(engine in vessel.engines) {
CONSOLE.print_line("No Modes: " + engine.engine_modes.length.to_string())
CONSOLE.print_line("Current mode: " + engine.current_engine_mode.name)
for(mode in engine.engine_modes) {
CONSOLE.print_line(" Name: " + mode.name)
CONSOLE.print_line(" Type: " + mode.engine_type)
}
}
}
How to do the mode-switch via the api I still have to figure out. Hope this is helpful anyway.
Did you have a chance to retest this with the 0.1.1.0 version? If I recollect the RAPIER engines were mentioned in the patchnotes
Closing this for to keep the list of issues manageable. Reopen if it still persists.
Is there a method to activate an action group? I'm using them to toggle RAPIERs between closed and open cycle.