Summary

Hooks

Called when the view is calculated; moves the camera to the map scene while choosing a character.
Called after Catwork has loaded all of its entities; loads the saved map scenes.
Loads the current map's scenes from the schema data and appends them to cwMapScene.storedList.
Called when a player's data stream info should be sent; picks a random map scene for them and sends it.
Saves cwMapScene.storedList to the schema data for the current map.
Called when a player's visibility is set up; adds their map scene's position to their PVS.
Called to check whether the character menu background should be drawn; hides it when a map scene is set.

Hooks

cwMapScene:CalcView(player, origin, angles, fov)

client gamemodes/catwork/plugins/mapscene/plugin/cl_hooks.lua:24

Called when the view is calculated; moves the camera to the map scene while choosing a character.

Spinning scenes slowly sway the camera's yaw back and forth.

Parameters

  • player Player The local player
  • origin Vector The default view origin
  • angles Angle The default view angles
  • fov Number The default field of view, kept as is

Returns

  • Map The view table with origin, angles, fov, vm_origin and vm_angles, or nil when no scene applies

cwMapScene:ClockworkInitPostEntity()

server gamemodes/catwork/plugins/mapscene/plugin/sv_hooks.lua:27

Implements hook ClockworkInitPostEntity

Called after Catwork has loaded all of its entities; loads the saved map scenes.

Loads the current map's scenes from the schema data and appends them to cwMapScene.storedList.

cwMapScene:PlayerSendDataStreamInfo(player)

server gamemodes/catwork/plugins/mapscene/plugin/sv_hooks.lua:7

Implements hook PlayerSendDataStreamInfo

Called when a player's data stream info should be sent; picks a random map scene for them and sends it.

Parameters

  • player Player The player receiving the data

Saves cwMapScene.storedList to the schema data for the current map.

cwMapScene:SetupPlayerVisibility(player)

server gamemodes/catwork/plugins/mapscene/plugin/sv_hooks.lua:20

Called when a player's visibility is set up; adds their map scene's position to their PVS.

Parameters

  • player Player The player whose PVS is built

cwMapScene:ShouldDrawCharacterBackground()

client gamemodes/catwork/plugins/mapscene/plugin/cl_hooks.lua:10

Implements hook ShouldDrawCharacterBackground

Called to check whether the character menu background should be drawn; hides it when a map scene is set.

Returns

  • Boolean False while a map scene is shown, otherwise nil

Defined in