Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Check altitude

Discussion in 'Programming (In-game)' started by Sich, May 16, 2018.

  1. Sich Trainee Engineer


    I try to make a drone who get in space and then come back to land.

    I usually use "Visual Script Builder" to make my scripts and it's work fine.
    But I want something that isn't possible with this site.

    To go down on the planet I shutdown all the engine from my drone.
    This to not use too much fuel, and because of the speed bug in gravity.

    I need something like "If altitude < 1500m do start all engine".

    I have find this script : https://steamcommunity.com/sharedfiles/filedetails/?id=1103394724 and I will try to use it. But this seem really to "big" for what I need... I only need how to check the current altitude and start my engine or a timer.

    Someone have some idea about that ?
    Or maybe how to check if the parachute hatch is open ? Then I add a parachute hatch on my drone and set the auto opening at 1500m.

    I hope that someone can help me :)

    I have find the way to do that. I have use this :
    v0.TryGetPlanetElevation( MyPlanetElevation.Surface, out alt );
    Last edited: May 16, 2018
  2. Wicorel Senior Engineer

    Every IMyShipController and a way to get Elevation.

    controller.TryGetPlanetElevation(MyPlanetElevation.Surface, out elevation);
    That will tell you the height of that controller above the surface.
  3. Sich Trainee Engineer

    Yep thx it's exactly what I have use for my script !