Mapscenes shows views of the map behind the intro and the main menu. Staff place camera points with the Mapscene tool, which is tied to the 'mapscenes' permission; the points are saved per map and sent to every client. While the ShouldMapsceneRender hook returns true, the client's view shows the points one after another. The camera is controlled by the config keys mapscenes_speed (seconds spent on a point), mapscenes_animated (glide from point to point instead of cutting) and mapscenes_rotate_speed (how fast a view that does not glide turns).

Summary

Hooks

Replaces the view with the current mapscene point while the ShouldMapsceneRender hook returns true.
Loads the mapscene points when the framework loads its data.
Sends all mapscene points to a player who has finished loading.
Registers the 'mapscenes' permission.
Draws a marker, a direction line and a label for every mapscene point while the local player holds the mapscene tool and has the 'mapscenes' permission.
Saves the mapscene points when the framework saves its data.

Methods

Adds a mapscene camera point, sends it to all clients and saves the list.
load()server
Reads the mapscene points from the plugin data of the current schema and map, replacing the current list.
save()server
Writes the mapscene points to the plugin data of the current schema and map.

Hooks

Mapscenes:CalcView(_client, _origin, _angles, _fov)

client plugins/mapscenes/plugin/cl_hooks.lua:52

Replaces the view with the current mapscene point while the ShouldMapsceneRender hook returns true. Depending on the config it cuts to the next point with a fade, glides between the points or slowly rotates the camera.

Parameters

  • _client Player
  • _origin Vector
  • _angles Angle
  • _fov Number

Returns

  • Map view table with origin and angles, or nil if no mapscene is shown

Mapscenes:LoadData()

server plugins/mapscenes/plugin/sv_plugin.lua:17

Implements hook LoadData

Loads the mapscene points when the framework loads its data.

Mapscenes:PlayerInitialized(actor)

server plugins/mapscenes/plugin/sv_plugin.lua:12

Implements hook PlayerInitialized

Sends all mapscene points to a player who has finished loading.

Parameters

  • actor Player

Mapscenes:RegisterPermissions()

shared plugins/mapscenes/plugin/sh_plugin.lua:18

Implements hook RegisterPermissions

Registers the 'mapscenes' permission.

Mapscenes:RenderScreenspaceEffects()

client plugins/mapscenes/plugin/cl_hooks.lua:10

Draws a marker, a direction line and a label for every mapscene point while the local player holds the mapscene tool and has the 'mapscenes' permission.

Mapscenes:SaveData()

server plugins/mapscenes/plugin/sv_plugin.lua:22

Implements hook SaveData

Saves the mapscene points when the framework saves its data.

Methods

Mapscenes:add_point(pos, ang)

server plugins/mapscenes/plugin/sv_plugin.lua:44

Adds a mapscene camera point, sends it to all clients and saves the list. Serverside only.

Parameters

  • pos Vector camera position
  • ang Angle camera angles

Reads the mapscene points from the plugin data of the current schema and map, replacing the current list. Does not send them to clients. Serverside only.

Writes the mapscene points to the plugin data of the current schema and map. Serverside only.

Defined in