mapping_warpers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mapping_warpers [2025/06/11 22:48] valkyrieskiesmapping_warpers [2026/06/22 21:27] (current) arcathiadev
Line 1: Line 1:
 +[[Mapping|Guide to Mapping]] / Warpers
 +
 ====== Guide to Mapping - Warpers ====== ====== Guide to Mapping - Warpers ======
 {{ ::city_warpers.png?400|city_warpers.dm as viewed in Notepad++}} {{ ::city_warpers.png?400|city_warpers.dm as viewed in Notepad++}}
Line 4: Line 6:
 Warpers are invisible tiles which cause a player to be transported from one location to another. The most obvious example of this would be a door on the overworld which takes the player to the interior of a building once it is stepped on. For newcomers to the mapping process these can seem rather intimidating to implement as they do require the mapper to actually write code, but the code in question is actually very simple and easily learned. Warpers are invisible tiles which cause a player to be transported from one location to another. The most obvious example of this would be a door on the overworld which takes the player to the interior of a building once it is stepped on. For newcomers to the mapping process these can seem rather intimidating to implement as they do require the mapper to actually write code, but the code in question is actually very simple and easily learned.
  
-The code for warpers is located in ''trace-alter-map/assets/code/objects/warpers/'', wherein it is split across a number of different folders and files related to different areas. For the majority of projects, the relevant warper code is located within the /districts/ folder separated into different files for each district (e.g: the warper code for any caves and buildings located in District 12 is located within the file district_12_warpers.dm). Some districts may be referred to via older development titles (e.g: The Historic District is referred to as "City", Downtown is "Inner City/Skyscrapers", and the Outskirts are "Country") but by taking a glance at the code within and reading the names of certain warpers or by comparing them to the names of warpers placed in the world via the map tool you can deduce what the name of any location you're uncertain about it called.+The code for warpers is located in ''trace-alter-map/assets/code/objects/warpers/'', wherein it is split across a number of different folders and files related to different areas. For the majority of projects, the relevant warper code is located within the /districts/ folder separated into different files for each district (e.g: the warper code for any caves and buildings located in District 12 is located within the file district_12_warpers.dm). Some districts may be referred to via older development titles (e.g: The Historic District is referred to as "City", Downtown is "Inner City/Skyscrapers", and the Outskirts are "Country") but by taking a glance at the code within and reading the names of certain warpers or by comparing them to the names of warpers placed in the world via the map tool you can deduce what the name of any location you're uncertain about is called.
  
 These files can be edited with BYOND DreamMaker which will likely be the default program set by Windows, however the use of a text editor designed for programming such as [[https://notepad-plus-plus.org/downloads/|Notepad++]] is often preferable for readability and ease of use. It is important you do not use a word processor such as Microsoft Office or LibreOffice when editing code as these programs insert a large amount of invisible special characters for their formatting which will break the code entirely. These files can be edited with BYOND DreamMaker which will likely be the default program set by Windows, however the use of a text editor designed for programming such as [[https://notepad-plus-plus.org/downloads/|Notepad++]] is often preferable for readability and ease of use. It is important you do not use a word processor such as Microsoft Office or LibreOffice when editing code as these programs insert a large amount of invisible special characters for their formatting which will break the code entirely.
Line 18: Line 20:
 • **bound_height** - This specifies the height of the warper in pixels from the bottom. If not set, this will default to 32, which is the height of a single tile in Byond. Generally this is only used to create half-sized warpers positioned on the southern edge of tiles. Usage Example: ''bound_height = 16'' • **bound_height** - This specifies the height of the warper in pixels from the bottom. If not set, this will default to 32, which is the height of a single tile in Byond. Generally this is only used to create half-sized warpers positioned on the southern edge of tiles. Usage Example: ''bound_height = 16''
  
-• **stepDir** - This specifies the direction the player will be facing when they reappear at the destinationBy default it will be whatever direction they were facing when they stepped on the warper, but this can be good for making sure players are facing the direction you feel they should if it's possible they can step on your warper from an odd angle or if your warpers connect in an odd way. Usage example: ''stepDir = NORTH''+• **stepDir** - This specifies the direction the character will emerge towards when they appear on the other sideIt's important to set this correctly otherwise characters may be spawned inside walls or out of bounds. If a warper's destination spawns the player at the bottom edge of a roomthen the stepDir should be set to NORTH so that they emerge above the lower boundary, and similarly, if a warper would spawn a player coming out of a door from a wall, then the stepDir should be set to SOUTH so they appear beneath the doorway. Usage Example: ''stepDir = NORTH''
  
 === An example of how to create a new warper === === An example of how to create a new warper ===
Line 30: Line 32:
 Now, beneath each of these entries we need to begin filling in the variables which define what they do. Indenting one step beneath each, we start with the "warpTo" variable. This defines where the warper tile we are currently working on will send the player. So, when the player steps on the entrance tile, we want it to send them to where the exit is on the interior of the building, so we'll want to use the address of the first exit warper. The address of the warper is got by combining all the definitions they have been grouped within together, so in this case we'll want to use the address ''/obj/warpers/country_warpers/small_cafe/exit_cafe_1''. Next, we want the warper to display the name of the cafe when the player moves their cursor over the door, so on the next line we can add ''displayText = "Cozy Cafe"''. These alone are all we need to do for our entrance, so now we can move on to our exits. Now, beneath each of these entries we need to begin filling in the variables which define what they do. Indenting one step beneath each, we start with the "warpTo" variable. This defines where the warper tile we are currently working on will send the player. So, when the player steps on the entrance tile, we want it to send them to where the exit is on the interior of the building, so we'll want to use the address of the first exit warper. The address of the warper is got by combining all the definitions they have been grouped within together, so in this case we'll want to use the address ''/obj/warpers/country_warpers/small_cafe/exit_cafe_1''. Next, we want the warper to display the name of the cafe when the player moves their cursor over the door, so on the next line we can add ''displayText = "Cozy Cafe"''. These alone are all we need to do for our entrance, so now we can move on to our exits.
  
-Because there's only a single tile on the other side, we can give both of our exit tiles the same destination, ''warpTo = /obj/warpers/country_warpers/small_cafe/entrance''. Because they are sending our players back to the overworld however, we don't use the displayText variable, but instead the simpler ''isExit = true'' variable, which should automatically detect where in the overworld the player is sent and set things accordingly. Our exit is at the bottom of the building we have just mapped, and so we don't want it to occupy an entire tile and be too obtrusive on the interior space, so we can make it half-sized by adding the variable ''bound_height = 16'' to each of them. This helps make it feel more like the player is stepping down into an unseen exit and isn't getting abruptly whisked away if they step too close to the tile. Finally, let's say we want to make sure the player is facing a certain direction when they exit - to do this, we can simply add the variable ''stepDir = SOUTH'' to each exit definition.+Because there's only a single tile on the other side, we can give both of our exit tiles the same destination, ''warpTo = /obj/warpers/country_warpers/small_cafe/entrance''. Because they are sending our players back to the overworld however, we don't use the displayText variable, but instead the simpler ''isExit = true'' variable, which should automatically detect where in the overworld the player is sent and set things accordingly. Our exit is at the bottom of the building we have just mapped, and so we don't want it to occupy an entire tile and be too obtrusive on the interior space, so we can make it half-sized by adding the variable ''bound_height = 16'' to each of them. This helps make it feel more like the player is stepping down into an unseen exit and isn't getting abruptly whisked away if they step too close to the tile. Finally, we want to make sure the player emerges in the correct direction when they appear on the other side - to do this, we add the variable ''stepDir = NORTH'' to the entrance definition ''stepDir = SOUTH'' to each exit definition.
  
 Now, with those definitions created, save your changes to the file and then open the mapkit anew. Compile the code anew (Ctrl+K) and the warpers you have defined should now appear in the sidebar of the map editor under ''obj > warpers > country_warpers > small_cafe''. All that remains is to place the entrance warper tile on the door you intend to be your entrance (making sure to remove any dense tile that was previously there) and to place each exit over the 2 tile doormat of the interior (and because the entrance warper sends the player to the warper defined as exit_cafe_1, place that one on whichever side you would rather players emerge into the building from). Now, with those definitions created, save your changes to the file and then open the mapkit anew. Compile the code anew (Ctrl+K) and the warpers you have defined should now appear in the sidebar of the map editor under ''obj > warpers > country_warpers > small_cafe''. All that remains is to place the entrance warper tile on the door you intend to be your entrance (making sure to remove any dense tile that was previously there) and to place each exit over the 2 tile doormat of the interior (and because the entrance warper sends the player to the warper defined as exit_cafe_1, place that one on whichever side you would rather players emerge into the building from).
  
 And there you go, you've successfully created warp tiles! And there you go, you've successfully created warp tiles!
 +
 +{{tag>guides mapping meta}}
  • mapping_warpers.1749682132.txt.gz
  • Last modified: 2025/06/11 22:48
  • by valkyrieskies