/dayz-fast-travel

A fast travel mod for DayZ

Primary LanguageC

DayZ Fast Travel

An image of a fast travel board with the travel prompt

This mod adds a fast travel system to DayZ with the aim of improving the player experience and giving server owners additional options to customize the gameplay of their servers. It comes with fast travel boards, which use DayZ's hiking trail boards as a base. Server owners can place these boards freely around the map to allow players to travel quickly between predefined locations if they have the required items. Locations appear as pins on the board, each with an action prompt consisting of the name of the selected location and travel cost.

It is highly customizable, and usage examples include a simple travel network between traders, a way to access hard-to-reach or even walled-in areas with high-value loot at the cost of rare items, and a more immersive replacement for UI-based spawn selection mods.

Core Features

  • Fast travel boards that players can use to quickly travel between predefined locations
  • Adjustable travel costs per location and destination
  • Customizable map markers for each location
  • Varying spawn locations at a chosen destination
  • Two variants of fast travel tickets to use as a starting point

Requirements

The only dependency of this mod is currently the Community Framework as it is used to streamline the networking, and as such, it is required to run the mod.


Setup

Clients

  1. Download the mod from the workshop page
  2. Add the mod, CF and any other mods you need to your -mod launch parameter (each mod is separated by a ";")
  3. Start your game and join your server

Alternatively, it's probably easier to just use either DayZ's launcher or the DayZSA launcher to join a server.

Server

  1. Download the mod from the workshop page
  2. Add the mod, CF and any other mods you need to the -mod launch parameter of your server (each mod is separated by a ";")
  3. Start your server to generate the config file in your server's profile folder
  4. Adjust the values in the config to your liking and spawn fast travel boards wherever you want
  5. Restart your server to load the new config

Spawning the Fast Travel Boards

While there are different ways to spawn objects in DayZ, the fast travel boards of this mod require some additional setup to assign locations to them. To make this process easier, the mods comes with a function that does all of the setup for you, in the form of DC_FastTravel.SpawnBoard(int id, vector position, vector orientation). The first parameter id is the m_ID config variable of whatever location you want to assign and display on the board. The second and third parameters position and orientation are the world-space location and rotation of the board respectively and are passed in as strings.

The actual spawning is done by adding this function to your server mission's init file:

  1. Open the init.c file in your server's mission folder
  2. Spawn the board in the main function using the 'DC_FastTravel.SpawnBoard' function:
void main()
{ 
  DC_FastTravel.SpawnBoard(1, "3692.1 403.512 5988.1", "163 0 0"); //Green Mountain with m_ID = 1 in the config
  DC_FastTravel.SpawnBoard(2, "8345.2 293.5 6002", "193 0 0"); // Kumyrna with m_ID = 2 in the config

   //Remaining code in main...

Depending on the map you are using, you'll have to adjust the board texture to display the correct map. To change which version spawns, you can add a fourth mapID parameter to the SpawnBoard function in the following form: DC_FastTravel.SpawnBoard(id, position, orientation, mapID); By default this mod supports Chernarus (0), Livonia (1), and Valning (2). While both Chernarus and Livonia are included in DayZ, Valning additionally requires the Valning Tourist Map mod by Sylver to display the right map on the board


Configuration

The config gets created automatically once you start the server for the first time after installing the mod. After the config file has been generated, you can navigate to the server's profile folder to find it. It should be labeled DC_FastTravelConfig. If you haven't set a profile folder for your server yet, you might want to consider doing so with the -profiles launch parameter, as it makes it easier to find the config and any log files in general. The config itself is a normal JSON file and can therefore be edited rather easily. The following table explains its contents:

Variable Explanation Example Note
m_CreateLogs Decides whether logs should be created in the script*.log files
"m_CreateLogs": 1
m_MessageDisplayTime The display time in seconds for messages
"m_MessageDisplayTime": 3.0
Currently unused
m_Locations An array that contains the information of all configured locations
"m_Locations": [
    {
        "m_ID": 1,
        "m_Name":"Green Mountain",
        "m_MarkerCoordinates": [
            ...
        ],
        "m_MarkerType": 0,
        "m_LocationCoordinates": [
            ...
        ],
        "m_VisitableLocations": [
            ...
        ]
    },
    {
        "m_ID": 2,
        "m_Name":"Kumyrna",
        "m_MarkerCoordinates": [
            ...
        ],
        "m_MarkerType": 0,
        "m_LocationCoordinates": [
            ...
        ],
        "m_VisitableLocations": [
            ...
        ]
    }
]
Each location block contains a m_ID, m_Name, m_MarkerCoordinates, m_MarkerType, m_LocationCoordinates, and m_VisitableLocations

Consecutive location blocks are separated by commas
m_ID The ID of a location
"m_ID": 4
This is an arbitary integer used to identify a location independent of its name. It is used as the id parameter when spawing the board as well as the m_LocationID variable to set this location as visitable from another
m_Name The displayed name of the location on the board
"m_Name": "Cherno"
m_MarkerCoordinates The location of the marker for this location on the board
"m_MarkerCoordinates": [
    3692.1,
    -1,
    5988.1
]
The marker is independent of any other location data and could, for example, be placed on the side of the map while the actual spawn points are located in the center of the map

The y-value is unused and should remain set to -1. If all components are set to -1, the first position in m_LocationCoordinates will be used instead
m_MarkerType The type of marker to be used
"m_MarkerType": 0
This can usually be left set to 0, as it is only needed if you want to assign a custom pin to this location

Should be one of the entries in m_LocationMarkerTypes
m_LocationCoordinates An array of possible spawn locations when a player is traveling to this location
"m_LocationCoordinates": [
    {
        "m_Coordinates": [
            3699.5,
            -1,
            5991
        ],
        "m_Radius": 4
    },
    {
        "m_Coordinates": [
            4374,
            -1,
            1273
        ],
        "m_Radius": 10
    }
]
Each spawn point consists of m_Coordinates and a m_Radius

Consecutive spawn points are separated by a comma

The actual spawn position when traveling to a location is chosen at random from all its spawn points and within the chosen spawn point from a random location in m_Radius around m_Coordinates that offers enough space for the player

In tight areas such as buildings, it is preferable to define multiple smaller spawn points instead of a single big one, as that could lead to players spawing inside the walls of the object
m_Coordinates The center of a spawn point
"m_Coordinates": [
    3699.5,
    -1,
    5991
]
If the y-value is set to -1, the terrain height at that xz-position will be used instead
m_Radius The radius around a spawn point that a location can be chosen from
"m_Radius": 4
m_VisitableLocations An array of locations that can be visited from a location
"m_VisitableLocations": [
    {
        "m_LocationID": 2,
        "m_RequiredTokenClassName": "DC_FastTravelTicket",
        "m_RequiredTokenQuantity": 1
    },
    {
        "m_LocationID": 5,
        "m_RequiredTokenClassName": "DC_FastTravelTicket",
        "m_RequiredTokenQuantity": 1
    }
]
Consecutive locations are separated by a comma

Setting m_RequiredTokenClassName to "" and m_RequiredTokenQuantity to "0" will make fast traveling to this location free
m_LocationID The m_ID variable of the location you want to set as visitable
"m_LocationID": 2
m_RequiredTokenClassName The class name of the item that is required to fast travel to this location
"m_RequiredTokenClassName": "DC_FastTravelTicket"
m_RequiredTokenQuantity The amount of m_RequiredTokenClassName required in your inventory to fast travel
"m_RequiredTokenQuantity": 2
m_LocationMarkerTypes A map of possible marker pins
"m_LocationMarkerTypes": {
    "0": "DC_FastTravelMarkerNeedle"
}
Usually doesn't need to be touched, as it is only used for defining custom markers

Troubleshooting

From my experience, the cause of most issues is a simple syntax error in the config file. Therefore, the first thing you should try is running the config through some JSON validator like this one.

If there are no errors in your config, check that you didn't set a float value instead of an integer one for certain variables in the config, e.g., setting the location id to 1.0 instead of just 1.

In case none of the above is the case, feel free to add me on either Discord (deadcraft) or Steam, and I'll try to assist you with the problem.


Usage & Monetization

  • Distributing, reuploading, and repacking of this mod or any of its contents is not allowed
  • Derivatives and modifications of this mod require my prior permission
  • Monetizing features of this mod is prohibited
  • Should your server break Bohemia Interactive's monetization guidelines in any way, you are also prohibited from using this mod on your server