Skip to content

Manifest file

Eliot Partridge edited this page Dec 3, 2020 · 1 revision

The map manifest file is used to inform the gamemode of every task, sabotage, and location label used in your map. You will need to write a manifest very early in your map's development, as the gamemode will not properly load you map without one. Fortunately, creating a manifest is quite simple.

Manifest file template

Manifest file template
local MANIFEST = {
  PrintName = "Your Map's User-Friendly Name",

  Map = {
    UI = (function () -- Fancy closure hack; UI elements only need to be defined clientside
      if CLIENT then return {
        -- See "Map overview" for details on this block
        BackgroundMaterial = Material('path/to/background.png', 'smooth'),
        OverlayMaterial = Material('path/to/overlay.png', 'smooth'),
        Position = Vector(0, 0),
        Scale = 1,
        Resolution = 1,

        -- Any location labels your map needs
        -- NOTE: Label position coords are in range [0..1], where (0, 0) is the top-left
        -- of the image, and (1, 1) is the bottom right
        Labels = {
          {
            Text = 'Cafeteria', -- NOTE: This can be a LANG string; see "Localization" for details
            Position = Vector(512/1024, 512/1024), -- Perfectly centered
          },
          -- ...
        },
      } end
    end)(),
  },

  Tasks = {
    -- Comment out/add entries here as needed
    -- NOTE: Only include tasks you've placed buttons for in your level; if the gamemode tries to
    -- assign a task that doesn't have all the task buttons it needs, things will break!
    'divertPower',
    'alignEngineOutput',
    'calibrateDistributor',
    'chartCourse',
    'cleanO2Filter',
    'clearAsteroids',
    'emptyGarbage',
    'fixWiring',
    'inspectSample',
    'primeShields',
    'stabilizeSteering',
    'startReactor',
    'submitScan',
    'swipeCard',
    'unlockManifolds',
    'uploadData',
    'fuelEngines',
  },

  Sabotages = {
    -- List any sabotages your map uses
    -- NOTE: Only include sabotages your map is prepared to handle (eg, sabotage buttons for reactor/O2, doors for doors),
    -- otherwise things will break!
    {
      Handler = 'reactor', -- Internal name of the sabotage; see "Sabotages"
      UI = (function ()
        if CLIENT then return {
          Icon = Material('au/gui/map/sabotage_reactor.png', 'smooth'),
          -- Same system as location labels above
          Position = Vector(462/1024, 512/1024),
        } end
      end)(),
      CustomData = {
        -- How long the sabotage lasts until failure/ending, in seconds
        -- Only used by reactor/O2/doors
        -- All of these have a sane default value; only set this if you want to change it
        Duration = 40,
        -- How long until this sabotage can be used again
        -- All sabotages default to 30 seconds
        Cooldown = 30,
      },
    },
    -- Doors sabotage; one needed per set of doors in your level
    {
      Handler = 'doors',
      UI = (function ()
        if CLIENT then return {
          Icon = Material('au/gui/map/sabotage_doors.png', 'smooth'),
          Position = Vector(562/1024, 512/1024),
        } end
      end)(),
      CustomData = {
        -- The name of the entity to control. Should be a func_door, but can be anything that takes
        -- Open and Close inputs
        Target = 'sabotage_door_foobar',
      },
    },
    -- ...
  },
}

return MANIFEST

Manifest file sections

Map.UI

Defines data used for the map overview UI. See Map overview for more information.

NOTE: UI blocks such as this only need to exist on the CLIENT realm. Defining them on the server may cause errors. The template file contains closure hacks which ensure the data is only created on the client.

Map.UI.Labels

Location labels and other text elements to place on your map overview.

  • Text: The text the label should contain. Can be localized; see Localization for more details.
  • Position: The position of the label on the overview (0, 0 is top-left, 1, 1 is bottom-right)

Tasks

Any tasks your map uses. Only specify tasks for which your map has the necessary buttons for, otherwise things will break.

See the tasks directory for a list of available tasks.

Sabotages

Any sabotages your map uses. Only specify sabotages for which your map is prepared to handle (eg, sabotage buttons for reactor/O2, doors for doors), otherwise things will break.

  • Handler: The sabotage to trigger when this is activated. See the sabotages directory for a list of default sabotages.

  • UI:

    • Icon: The Material to use when displaying this sabotage on the sabotage map for imposters.
    • Position: Where to position this material on the map

    NOTE: UI blocks such as this only need to exist on the CLIENT realm. Defining them on the server may cause errors. The template file contains closure hacks which ensure the data is only created on the client.

  • CustomData:

    • Cooldown: How long to make imposters wait to use this sabotage again after it has already been triggered, in seconds
    • Duration: (For reactor/O2/doors): How long, in seconds, until the sabotage ends. For reactor/O2, this determines how long Crewmates have until they fail. For doors, this determines how long the doors remain closed for.
    • Other entries as needed by specific sabotages

External resources