untoldwind / KontrolSystem2

Autopilot scripting system for KSP2
Other
54 stars 14 forks source link

issue with TWR algorithm #172

Open MathewUlanowski opened 1 month ago

MathewUlanowski commented 1 month ago

It appears that if the throttle is set to 0 it registers the current TWR as the current max possible TWR steps to replecate this issue

  1. have code that uses the TWR value example below
    
    use { Vessel, DeltaVSituation } from ksp::vessel
    use { CONSOLE } from ksp::console
    use { current_time, sleep, yield } from ksp::game
    use { add_time_series } from ksp::telemetry

pub fn main_flight( vessel: Vessel) -> Result<Unit, string> = { while(true) { let twr = vessel.delta_v.stage(vessel.staging.current).value.get_TWR(DeltaVSituation.Altitude) CONSOLE.print_at(3,3,"TWR: " + twr.to_string())

    yield()
}

}


2. set the throttle to 0 and observe the max TWR
3. increase the throttle and it displays the current TWR
untoldwind commented 1 month ago

I am not sure this could be easily fixed as I am using the the algorithm from the game. I.e. the value returned by the API should be the same as displayed in the game UI for the stage-information.