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.

Script for detecting a breach of a pressurised area :)

Discussion in 'Programming Questions and Suggestions' started by Mattizzle, Mar 27, 2015.

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

    Messages:
    5
    If anyone knows if this is possible and could be done and written I'm sure the SE community would love it I can just imagine some windows on a space station being shot open and then some airtight Hangar doors closing to seal the breach automaticly like some Sci fy movie
     
  2. Phoera Senior Engineer

    Messages:
    1,713
    you can read data from airvent which can tell if room not pressured.
     
  3. indigodarkwolf Apprentice Engineer

    Messages:
    115
    This seems like it should be possible by parsing the DetailedInfo of IMyAirVent blocks, but from my experiments with oxygen, any sort of breach is probably going to cause the entire station or ship to go into lockdown. It appears that oxygen evacuates an arbitrarily large area almost instantaneously, to the extent that the oxygen system is capable of detecting that a volume can be pressurized (that volume seems to break down somewhere prior to 2000x2000x2000 large blocks).

    That simply means, though, that any script would have to keep multiple zones in mind, as well as zone adjacency. Once all doors are shut and pressure can be re-established in individual zones, it would have to re-open only the doors between adjacent pressurized areas.

    I don't see how in-game scripts could go about building this graph of zones and adjacency information on their own, though, so that information would have to be supplied by the end-user in the form of configuration variables.
     
  4. Mattizzle Trainee Engineer

    Messages:
    5
    Im hopeless with scripting but instead of calculating whether it's pressurised can we no just detect if a block is missing for example a 2x2 window with blast shutters if any of the windows break the shutters come down sealing it again because we already will know that the room will depressurize if a window is missing
     
  5. Phoera Senior Engineer

    Messages:
    1,713
    you cannot work with not terminal blocks.
     
  6. indigodarkwolf Apprentice Engineer

    Messages:
    115
    As Phoenix says, in-game scripts can only see and use terminal blocks (with a few exceptions where sensors are concerned). It is not possible to detect if a random block is "missing", or to otherwise automatically map out whole ships to get the kind of information you'd need. Well, unless you intend to build your ship entirely (and I mean entirely) out of small cargo containers, or something.
     
  7. mhalpern Senior Engineer

    Messages:
    2,119
    Proper naming of vents and doors, If one REALLY wanted to, they may be able to run a naming script ahead of time, that would use the coordinate system and oxygen system in conjunction to determine what doors and vents correspond to each other, but it may be far easier just to name them properly.
     
  8. indigodarkwolf Apprentice Engineer

    Messages:
    115
    That would be a fine strategy for providing node and edge information to the script. It could be as simple as post-fixing [zone:1], [zone:2], etc. to all air vents, and postfixing [zone:1-2], [zone:1-3], [zone:2-3], etc. to all doors.

    I'm just saying that a script can't discover this information without the user jumping through at least *some* kind of hoop.
     
  9. mhalpern Senior Engineer

    Messages:
    2,119
    Have you seen the interior light naming scripts people made to make graphic displays? It's possible. Might need to name the first door or air vent first but beyond that...
     
Thread Status:
This last post in this thread was made more than 31 days old.