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.

WindTurbine?

Discussion in 'Programming (In-game)' started by Adraesh, Mar 2, 2019.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Adraesh Trainee Engineer

    Messages:
    3
    Hello,

    I would like to access to all my wynd turbines and retrieve some info from it.It seems that the API does not expose any MyWyndTurbine or IMyWyndTurbine interface at the moment.

    Any tips related to this?

    Thank you very much in advance!
     
  2. Sarekh Senior Engineer

    Messages:
    1,196
    while I am in no way a programmer... should it not be written MyWindTurbine and IMyWindTurbine? Might that be the problem?
     
  3. Adraesh Trainee Engineer

    Messages:
    3
    Hello!

    That's true my bad... But anyway I still can't find any interface with MyWindTurbine or IMyWindTurbine.
     
  4. Der Isy Trainee Engineer

    Messages:
    3
    I'm running into the same issue at the moment.. Looking through the core game files, it seems, that there is no dedicated wind turbine interface at the moment.. But you can use the IMyPowerProducer interface with a bit of filtering:

    Code:
    var turbines = new List<IMyPowerProducer>();
    GridTerminalSystem.GetBlocksOfType(turbines, t => t.BlockDefinition.SubtypeId.Contains("WindTurbine"));
    
    That way, you can use some fields like .MaxOutput or .CurrentOutput - the wind clearance field however is not accessible that way..
     
    • Like Like x 1
  5. Mollymawk Apprentice Engineer

    Messages:
    124
    Its odd how the wind turbines, parachutes, and atmospheric thrusters all work OK on the Ice moon, even though there is no air there.
     
  6. mojomann71 Senior Engineer

    Messages:
    2,005
    @Mollymawk maybe there is air, just not breathable.... :)

    Just making a little fun.

    It is odd that any of them would work on a moon.
     
    • Agree Agree x 1
  7. Mollymawk Apprentice Engineer

    Messages:
    124
    The sky is black all day, you can see the things in space above you. air vents report "No Pressure". Ion Thrusters work too...
    but it is Keens moon, not mine. if they say everything works there that's fine by me..

    The funny bit is, I have been living there a month, using Hydrogen and ion thrusters totally oblivious of this invisible atmosphere, till one day i happened to notice a parachute in the distance.
     
  8. plaYer2k Master Engineer

    Messages:
    3,160
    There is a difference between breathable air and atmosphere.
    Planets (that includes "moons") can have an unbreathable atmosphere that allows "Atmospheric Thrusters", hence the name, to work there. Likewise the atmosphere can be thin enough for the Ion Thrusters to still function to a certain extend.

    The "Moon" (earths moon) for example has
    Code:
    <HasAtmosphere>false</HasAtmosphere>
    
    in its definition while "EarthLike" (earth) got
    Code:
    <HasAtmosphere>true</HasAtmosphere>
    <Atmosphere>
      <Breathable>true</Breathable>
      <OxygenDensity>0.9</OxygenDensity>
      <Density>1.0</Density>
      <LimitAltitude>2.0</LimitAltitude>
      <MaxWindSpeed>80</MaxWindSpeed>
    </Atmosphere>
    

    I think that an easy example could be Jupiter. It's a gas planet with a nicely visible atmosphere but no humanly breathable mixture. Another nice example is the moon Titan. Alternatively, go for Venus and it's thick atmosphere that is also unbreathable.

    So while all planets can have atmospheres, these dont have to be breathable (contain oxygen).

    Thus, the presence of gas doesn't warrant that you can breath it as a human, but it still is a medium being used for machines like propellers etc. and thus you can use wind turbines, atmospheric thrusters, parachutes and many more.


    As I didn't play SE in 2 years and only just casually came across this post looking for some informations in wind turbines myself, I can not help much about what a good way of figuring out if a planet got an atmosphere has is. I think i used to have a small grid small atmospheric thruster on low override to check if it functions (produces effective thrust). Though i am sure that someone else is around knowing a good solution in order to automate this a little, given you got a need for it.
     
  9. Malware Master Engineer

    Messages:
    9,861
    Please avoid using Contains this way, it has no early-out so it'll search the complete subtype names for all entity blocks on your ship. Try to find a better match with Equals, StartsWith or EndsWith.
     
  10. Sticky32 Trainee Engineer

    Messages:
    8
    How would you interface the new hydrogen engine and small battery? IMyGasEngine?
     
  11. Shiolle Trainee Engineer

    Messages:
    13
    You can interface with it through IMyPowerProducer interface. I have browsed through game DLSs and Malware's autogenerated API reference (thank you!) but it doesn't seem to have a dedicated interface yet. IMyPowerPorducer gives you the information about it's properties as a generator, but doesn't say anything about stored hydrogen, of course. I thought that maybe it implements IMyGasTank as well, but it is not the case. You can however get some information about it's hydrogen storage from its DetailedInfo property. It is the same text you see in-game when you select the block in the terminal interface. Just parse the text. For example, here is a very primitive code that determines how much hydrogen (in liters) is currently stored in the tank:

     
Thread Status:
This last post in this thread was made more than 31 days old.