Jump to content

How To Make Airlocks Function (WIP)


Recommended Posts

Introduction

This guide assumes basic knowledge of StrongDMM's forms and functions. If you don't know how to use StrongDMM, please use the following forum guides (1, 2, 3) as an introduction to the very, very basics.

If you're returning to mapping after a while away from the server, you may have noticed that the old "airlock templates" have been marked as "deprecated".

image.png.aa7530f1859b058d6ba7bed59e56421e.png

These templates have been made obsolete by the introduction of a far smoother system; airlock markers! This allows you to create custom airlocks from scratch, and not have to worry about building your entire ship around a limited amount of templates. You also don't have to worry about matching frequencies, which is a lifesaver.

image.thumb.png.3d19ec8652f359b066effbb76d65e363.png

Of course, like all BYOND code, it's not that simple. There is still a process to making your airlocks actually work, and several variables that you will have to keep track of to create an airlock that cycles properly. There are three main kinds of airlocks in the game; docking ports, shuttle airlocks, and what I will call (somewhat redundantly) EVA airlocks.

For this guide, I will be using the Elyran Corvette as an example map. I highly recommend you open up StrongDMM yourself and take a look at it as you follow.


Setting Up An Airlock

Open up StrongDMM, then navigate to [your repo]/maps/helper in StrongDMM. These are helper maps. They give a few examples of airlocks, shuttles, and docking ports that work, as well as some button sprites and markers with pixel shifting already applied.

With that on hand, you can return to your map. Your basic EVA airlock is going to look a bit like this:

image.png.3b7f2dccc980828f0cf61e5219f6f622.png

You have two doors, one inside and one outside, some plating, and a vent that leads to a nearby air canister. Now, it's time to apply your airlock markers.

image.png.24433962e359ce68519c4fc4be35ddc8.png

You now have the basic airlock markers applied to your doors. Excellent, but we're not done. As you can see in the above images and in the helper file, you also need to apply interior and exterior markers. If your door is inside the ship, apply an interior marker on top of the airlock marker. If your door is outside the ship, apply an exterior marker. It should look like this:

image.png.adda0e1dd54fc996b12222bdcf49db63.png

Good! Now, you need a couple of buttons. This will provide access to your airlock, and keep it sealed from the vacuum of space. It will also allow your airlock to cycle in and out. Let's go back to our helper map...

image.png.a88751cf0ce05589e1235ff11499b3a1.png

As you may already know, wall-mounted interactables like APCs, air alarms, and buttons aren't actually on the wall tile; they're on the tile in front of the wall, and are pixel-shifted to look like they hang on the wall. When you select an airlock controller from the airlock helper map, for example, you pick one that's pixel-shifted to look like it's hanging on your desired wall, but it's actually placed on a tile that an airlock marker is on.

At the far-left block of controllers, the one with "airlock" in the middle, pick an airlock controller that hangs nicely on the south wall of the airlock.

image.png.82e23724ed97b4ae8c8cd27080d654d7.png

Remember, this controller is on that tile with the airlock marker in the middle! Don't actually put it on the wall tile.

image.png.8a5ab9c64a60b1b339aa39c1c8fabf11.png

Now it's time to apply access buttons. You'll need one on the interior door, and one on the exterior door.

image.png.4e600f40fe893029ab916a1a70a0fe48.png

Remember, these are placed on the "airlock exit" and "airlock interior" tiles, not the walls.

You'll also need to apply an airlock sensor. This will go on the inside of your EVA airlock (shuttle airlocks have a slight exception), and makes sure your airlock cycler senses the air pressure appropriately.

image.png.d3141127d14278707259d7d00bbee987.png

It looks pretty complete! But we're not quite done yet.


Marker Variables

If you've been following the tutorial with the Elyran corvette, you may have noticed something about the airlock marker variables. This is what the markers on this airlock look like:

image.png.d5ed48a9123d02808536f4c8984ef88d.png

The master_tag and the name together make the airlock detect where it is, and that it's an airlock. req_one_access is the access on the airlock; you can check out what number indicates what access in access.dm, code/__DEFINES. For now, the master_tag and the name are the most important ones.

If you're making an airlock that just goes inside and outside the ship, all you need to do is set both of those variables to something like "airlock_shipname_starboard" (or port). Do this with all the markers, and make sure there are no typoes!

Good job! You just made your first airlock. But if you're thinking of making a shuttle airlock, things are going to get a bit more complex.


Shuttle Airlocks

Let's take a look at the shuttle airlock on the Elyran corvette's shuttle. Looks pretty business as usual...

image.thumb.png.126fc68625d2cb7859aceb2ae37bed2d.png

You might note there's another marker there, the OUT marker. This indicates that your airlock is going to be dealing with the atmosphere of a planet, and needs to pump atmosphere from outside the airlock into the airlock. You only need to apply these markers on the inside of the airlock-- your external air pumps are going to be marked with EXTERIOR.

You might also notice that this airlock has three air sensors; one on the interior of the shuttle, one on the inside of the airlock, and one on the exterior. Like with the EVA airlock, they're necessary to sense air-- you need to place the exterior air sensor on the EXTERIOR marker tile, and the sensor on a regular airlock marker tile.

You might also also have noticed the big green DOCK/SHUTTLE marker. We'll get to that later. For now, let's look at the variables on a shuttle's airlock marker.

image.png.ebe3997add3c8c02f0b924d1a40e5fc3.png

The variables that are important for the purpose of this airlock are shuttle_tag, master_tag, and name (also req_one_access, but that's not as immediately important at the moment). This time, the master_tag variable is not a variable you can set within StrongDMM; it's already defined in the shuttle's code. Thus, we need to pop open VSCode and find elyra_corvette.dm, the ship map's code file.

image.png.2333545288b1d615278bd3a7d9261d6f.png

By Control-F-ing "airlock_elyran_shuttle", we find ourselves at the part of the .dm file that defines the shuttle's airlock code. dock_target is what allows the shuttle to, well, dock with docking ports (another thing we'll get to later). Simply copy and paste this variable into the master_tag and name variables in StrongDMM.

shuttle_tag can be found much the same; by control-f. Keen eyes may note that this same variable is applied to the shuttle control console; if you're going to make a map from scratch, you need to make a subtype of the shuttle control console to make the shuttle go woooosh (but that's a tutorial for another time).

image.png.6a6be2766f7468b754b42759fcbb1150.png

From there, it's pretty much setting up the airlock as you would an EVA airlock.

But here we come to the most intensive part of setting up an airlock; docking ports.


Hangar Docks

On an away ship, you usually have a shuttle so your ghostrole squad can go and explore away sites, as well as dock with the Horizon. Wherever your shuttle initially spawns is going to be called its hangar, for brevity's sake.

Remember that green marker I mentioned in the last section? Here's where it makes a comeback. It's called a shuttle landmark, and indicates where and what direction a shuttle docks.

A shuttle landmark is, akin to the shuttle_tag variable, defined in a ship's .dm file. Simply control-f shuttle_landmark...

image.png.e2fb5fab13501aded06c38ea234e56fc.png

This block of code actually creates two shuttle landmarks, which can be found as objects in StrongDMM; one for the hangar of the Elyran corvette, and one for its transitory section on its map (that's what the big square of space on every ship map except the Horizon is for).

image.thumb.png.eb8ae8a1b80240111d185c50c72210c5.png

welp

Anyway, once you've defined the landmark, setting it down is easy; fiddle with the direction variable until the dock lines up with wherever the shuttle docks, and the shuttle lines up with the bit that is a shuttle.

image.png.32fe5dc51b4dbb99fe70c67f645e4b0f.png

If the variables don't look something like this, you may have a problem.

image.png.1ff240ca81a4caa8ebbf5cd3b1c43cba.png

And here's the part that trips everybody up; the docking port controller. See this thing that I conspicuously included in the screenshot of the Corvette's hangar?

image.png.dd5dbc78d4830a6ab0fb1c4d4bd27df1.png

It looks like an airlock controller, but it's actually a docking port controller. Yes, they're two different types of objects, despite looking exactly the same, and they can be found in the airlock guidelines helper map.

You can sample one and slap it on the wall of your hangar, nearby the aforementioned shuttle. But there's something else we need to do; if you guessed edit the variables, you're right.

image.png.7d6be724cdd5bb867bf326a86705406b.png

Aha. The id_tag is the only thing you really need to worry about here. But like the shuttle landmark, the id_tag is a defined variable in the code.

image.png.51627455a5d289f21e92e3e9b7906b5b.png

Actually, it's right under the shuttle landmark for the hangar! Convenient. Add the variable defined as docking_controller ("elyran_shuttle_dock") to the id_tag on the docking controller.

You got it working! Now all you need to do is make sure the actual piping is correct...

Also, it is time to TEST THAT GODDAMN AIRLOCK.

This is actually pretty simple to do. Simply boot up a test server, spawn in your ship, and see if the airlock doors are automatically bolted open at roundstart. If they aren't, or the buttons are unresponsive, something's buggy. Make sure all of your variables that I've mentioned have been appropriately edited; typoes will be your bane. Also make sure your markers are all set, and you set the air sensors at appropriate places.

Congrats (for the time it takes me to write the rest of the guide on how to make docking ports)! Give yourself a pat on the back. You just made a functional airlock, which is easily the hardest part of making a ship (right next to setting up ship weapons which, don't ask me).

Edited by La Villa Strangiato
  • Thanks 3
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...