Shuttle guide for mappers/admins

Mapping Ideas and Sprite Galleries
Post Reply
User avatar
NikNakFlak
In-Game Admin
Joined: Thu Apr 17, 2014 5:08 pm
Byond Username: NikNakflak

Shuttle guide for mappers/admins

Post by NikNakFlak » #76806

Download link as PDF: https://www.dropbox.com/s/pzuiw8f5g142e ... o.pdf?dl=0
Please note, this forum copy paste, is not formatted like the PDF is.
Guide to New Shuttles 3/20/15

Shuttles were recently changed to have some interesting new features but also removing some old ones. There are some restrictions and some pretty technical stuff so make sure you play close attention to what you are doing. Everything needs to be perfect or the shuttle will not work.

Old shuttle code used an area that defined what moved and where it moved to. It was useful because you could put anything inside this area and it would act as the shuttle and you could run fun events. With new shuttle code, you can no longer do this but there is potential for other fun things. New shuttles use a series of objects called Docking_ports. There are several kind of docking_ports and each does something different. These docking ports are hard to find on the map unless you know where they are so I suggest downloading the code and looking at some shuttles on the map.. The docking ports look like pinpointers. You can’t see them in-game as they go inside of turfs. Each shuttle has usually 4 or more of these docking_ports and each one is important. The shuttle console also now plays a crucial part in shuttle control. I’ll go into detail about each one of them now.


/obj/docking_port/mobile This is the docking port that goes on your shuttle you are building. Mobile docking ports will always go on the shuttle. This needs to be placed where a shuttle airlock is or else the shuttle you are building will not dock properly. Basically, the airlock that meets the station airlock is where this docking port should sit.
/obj/docking_port/stationary This docking port goes in the locations you want your shuttle to dock at. Be careful where you place these however and make sure the shuttle has enough room to dock because if you place this in the way of other objects, the shuttle will simply clip over these items and delete them upon docking. You can have as many of these as locations you want the shuttle to be able to go to, however two is normally the standard for simple point A to B shuttles.
/obj/docking_port/stationary/transit This is the docking port that allows the shuttle to go through the “transit zone” that looks like you are traveling through space on your shuttle. This is not required for a shuttle to work but if it’s not placed, the shuttle will teleport instead of “fly”.
/obj/docking_port/mobile/(supply, pod, or emergency) I wouldn't touch any of these, they are already coded so when they are placed, they already have the correct vars in place for their retrospective shuttle or pod as seen above.

Now even though you have all of these things, there are a ton of very important vars that need to be defined in order for your shuttle to work. The first thing to keep in mind when building a shuttle, is that the shuttle must be built out of simulated shuttle turfs and only these turfs. The shuttle will not function using any other type of turf except shuttle turfs and it must be simulated. The good news is that shuttles can be any shape, be as small or as huge as you want it, and the shuttle console can be located anywhere, even off the shuttle if you so choose.

Here is an example shuttle:
Image
Note the location of the airlock. This is very important for the obj/docking_port/mobile MUST GO ON THAT TURF. When you spawn it, it should go into the shuttle/floors contents, so when you edit it, you will need to look into the contents of the floor where the airlock is. This airlock with the mobile docking port in it will control where your shuttle docks. The airlock doesn’t necessarily have to be on the bottom, but it is important where it is placed in relevance to your shuttle. Location of the /obj/docking_port/mobile
Image

After you spawn the /obj/docking_port/mobile, you will need to edit it’s vars. This can be complicated. The very first thing you need to do it is set the dir var for the mobile docking port. If your airlock is on the bottom of your shuttle, such as it is in the above example, the dir should be 1, as it should be defaulted. If the airlock is on the left of your shuttle, the dir needs to be 4. If the airlock is above the shuttle, it should be 2. Finally, if the airlock is on the right, the docking port needs to be 8. Basically, the direction of the docking port should face the inside of your shuttle.

Next, you want to name your shuttle with the docking_port/mobile. The docking port will have a “name” var but this doesn’t actually do anything. You will name your shuttle with the “id” variable. The name does matter, case does matter, and the name should be one word. For example I would name a shuttle “Cruise”. After your name your shuttle with the id variable, you will need to define the size of your shuttle. This is again decently complicated. The vars the control the size of your shuttle are Height and Width. Depending on the direction of your mobile docking port, depends on which direction is height and which direction is which. These vars need to be edited to reflect the actual size of your shuttle. Simply count how many tiles it takes up from tip to tip.
Image
In this example, the shuttle is above the airlock where the mobile docking port is, so the height would be up and down, and the width would left and right. The height for this example would be 4 and the width would be 7. The shuttle walls make it easy to count. Basically,which ever direction the mobile docking port is facing, is the height. If the dir of the mobile docking port is 8 (which means it’s facing left). The height will be left and right while the width is up and down. The height and width of the shuttle is defined by the dir (direction) variable of the mobile docking port located in the airlock.

Once you have finally set your height and width, you have one more set of variables to struggle with. Dwidth and Dheight which tell the shuttle where your mobile/docking port is located on your shuttle. VERY IMPORTANT: While you normally count tiles starting from 1, THESE VARIABLES START FROM 0. THE DIR OF THE MOBILE DOCKING PORT STILL MATTERS HERE.

This airlock is located at the bottom of the shuttle with the mobile docking port dir set to 1, which is up. When we were defining the height variable, we said the shuttle was 4 tiles high because we counted up from 1. When we define it’s Dheight, we count from 0. 0 being the bottom and 3 being the top. That means, because the airlock is on the bottom of the shuttle it’s Dheight is 0. We do the same thing for Dwidth. Start from 0 and count up. Because the airlock is located there, it’s Dwidth would be 1, not 0. Think of the bottom left corner of the shuttle as the coordinates 0,0. Just remember, these Dwidths and Dheights still depend on the dir variable of your mobile docking port. These must be set correctly or the shuttle will bug or not work at all. After you set these variables, you are done var-editing the mobile docking port.


Next, you will place your first stationary docking port. Make sure the location you spawn it in, can fit your shuttle. When your shuttle is moved to this stationary docking port, it will be on the airlock, so judge the size of your shuttle around the airlock. You will need to set width, height, Dwidth, and Dheight exactly the same as what you set it for the docking_port/mobile. After you do that, you will need to edit the id variable. It needs to be the exact id you had for the mobile docking port but with a tag at the end. Since in this tutorial, we need our shuttle “Cruise” we should call this first stationary docking port Cruise_beach. You can call it anything as long as it’s in this format Shuttlename_word. Cruise_away, Cruise_space, Cruise_armoury. The id is important and you will need to remember it to input it into the shuttle console later. On top of var editing the id, you should var-edit the name of this docking port to something. The name will show up in the shuttle console so name it something to do with the location. Once you have done that, you are done with this docking port.

Do the exact same thing with another docking (You need at least two or what’s the point of a shuttle if it only goes to one location). Just make sure you set the Height, Width, Dheight, and Dwidth the same for this docking port as well. These four variables will be the same for all docking ports of the same shuttle. Each stationary docking port needs to have a different id tag and name from other stationary docking ports but it still must follow the format of “Shuttlename_word”. Make sure to name it something different too.

This next step is optional. If you want the shuttle to “Fly through space” when it moves locations, you will need a /obj/docking_port/stationary/transit. If you don’t care about this and do not care if your shuttle just “teleports” to it’s location, you can skip this step. If you choose to do this step however, you will need to go to the centcom Z-level and go to the upper left corner of the z-level where all the moving space tiles are. Make sure you have a copy of the map editor open or at least know where the other shuttle transit docking ports are so you don’t accidently put your shuttle on top of any other existing docking ports. Shuttles can crash into each other. All pods, the escape shuttle, the syndicate shuttle, the mining shuttle, and the supply shuttle all have transit docking ports and you will need to make sure you shuttle does overlap them. Again, make sure the Height, Width, Dheight, and Dwidth variables are the same for this transit docking port as they are for all your other docking ports. The id for this docking port will need to be “Shuttlename_transit”. In our example it would be “Cruise_transit”.

The last step is adding a shuttle console. It does not need to be located on the shuttle. You will need to spawn in a /obj/machinery/computer/shuttle to do this. If you place it on the shuttle, it will probably be unpowered. To cheat around this, modify the “use_power” variable to 0, the “stat” variable to 0, and then change the icon_state from “shuttle0” to just “shuttle”. This will make a functioning shuttle computer that doesn’t require power and looks powered. You will need to edit some variables for this as well. The “shuttleid” variable will need to have the exact same id as the mobile docking_port. Next, you will need to edit the “possible_destinations” variable. In here, simply input the names of all your stationery docking_port ids. These must be identical to the ids of the various stationary docking_ports. You can add more than one by splitting them up with a ;
For example: Cruise_beach;Cruise_space;Cruise_home
With this done, you should be able to pilot the shuttle and fly it around to any stationary docking ports you put. That’s all there is to making new shuttles. If you want to avoid this horrible mess of making a new shuttle, an easy way to “Hijack” a shuttle is to simply edit the location of the stationary docking ports for the admin ferry. They are located just outside the airlock where it docks at centcom and the airlock where it docks at the station. Simply look into the contents of the tile where the stationary docking port for the admin ferry is, Mark it using the dropdown menu and then pick a new place where you want to the shuttle to go. Pick a tile, edit the contents of said tile by clicking the E, add variable, and the marked object (which in this case is one of the stationary docking ports for the admin ferry) should be the last option. Click it, and press ok, but select “No” when it asks if you want to associate the variable with a list. This is the standard procedure for variable editing the location of any object and it works for docking_ports too. The admin ferry should now move to this new location and to the location of the other stationary docking port.

That’s all for this shuttle guide. Ping NikNakFlak in IRC if you have questions or need help.

PLEASE COMMENT OR EDIT THIS GUIDE IF I HAVE MADE AN ERROR OR IT COULD BE IMPROVED
User avatar
Stickymayhem
Joined: Mon Apr 28, 2014 6:13 pm
Byond Username: Stickymayhem

Re: Shuttle guide for mappers/admins

Post by Stickymayhem » #76807

I feel super bad for not telling you how to do this now. Sorry I was just lazy
Image
Image
Boris wrote:Sticky is a jackass who has worms where his brain should be, but he also gets exactly what SS13 should be
Super Aggro Crag wrote: Wed Oct 13, 2021 6:17 pm Dont engage with sticky he's a subhuman
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Shuttle guide for mappers/admins

Post by oranges » #76830

Wow son, put this on the wiki to replace my shit section in teh mapping guide
User avatar
NikNakFlak
In-Game Admin
Joined: Thu Apr 17, 2014 5:08 pm
Byond Username: NikNakflak

Re: Shuttle guide for mappers/admins

Post by NikNakFlak » #77727

This is going to be updated soon with better pictures and easier to understand paragraphs.
Allohsnackbar
Joined: Fri Jan 23, 2015 4:00 pm

Re: Shuttle guide for mappers/admins

Post by Allohsnackbar » #77732

Stickymayhem wrote:I feel super bad for not telling you how to do this now. Sorry I was just lazy
Sticking shilling his shuttle shenanigans
Post Reply

Who is online

Users browsing this forum: No registered users