Summary
Hooks
cwMapScene.storedList.cwMapScene.storedList to the schema data for the current map.Hooks
cwMapScene:CalcView(player, origin, angles, fov)
client gamemodes/catwork/plugins/mapscene/plugin/cl_hooks.lua:24Called 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_originandvm_angles, or nil when no scene applies
cwMapScene:ClockworkInitPostEntity()
server gamemodes/catwork/plugins/mapscene/plugin/sv_hooks.lua:27Implements 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:7Implements 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:20Called 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:10Implements 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