← all updates

Map Scripting Gains Custom HUD Layouts, a Scripted Player Camera and Bomb-Phase Events

40 changes

This update is entirely Map Scripting. Scripted maps can now draw their own UI through custom_hud_layout entities — Panel, Label, Image and Button types styled with CSS, with no events or client-side scripting — and a new cs_player_camera entity controls a player's view without moving their pawn. The API adds events for the start and abort of bomb plants and defuses, plant timing and abort methods on the C4, entity move-type control and several CSPlayerPawn helpers, and deprecates planter and defuser on the bomb events. Script errors and unhandled promise rejections now reach the console.

scripting

  • reworkAdded custom_hud_layout entity: custom_hud_layouts are the entry point for scripted maps to provide custom UI.
  • reworkAdded custom_hud_layout entity: Panel, Label, Image, and Button panel types are supported.
  • reworkAdded custom_hud_layout entity: Styling with css is supported.
  • reworkAdded custom_hud_layout entity: Events and client side scripting are not supported.
  • reworkAdded custom_hud_layout entity: Maintains state during tools mode reloads.
  • reworkAdded cs_player_camera entity: Gives control of a player's view without moving their pawn.
  • reworkAdded cs_player_camera entity: Can be configured to let the player look around from the scripted position.
  • reworkAdded Instance.Delay
  • reworkAdded Instance.OnBombPlantStart
  • reworkAdded Instance.OnBombPlantAbort
  • reworkAdded Instance.OnBombDefuseStart
  • reworkAdded Instance.OnBombDefuseAbort
  • reworkAdded Instance.OnCustomHudClicked
  • reworkAdded Instance.IsDedicatedServer
  • reworkAdded Entity.Move
  • reworkAdded Entity.GetMoveType
  • reworkAdded Entity.SetMoveType
  • reworkAdded CSPlayerPawn.GetC4
  • reworkAdded CSPlayerPawn.GetDefuseTarget
  • reworkAdded CSPlayerPawn.IsBuyMenuOpen
  • reworkAdded CSPlayerPawn.GetCamera
  • reworkAdded C4.GetPlantStartTime
  • reworkAdded C4.GetPlantFinishTime
  • reworkAdded C4.AbortPlant
  • reworkAdded CustomHudLayout.SetHasClass
  • reworkAdded CustomHudLayout.SetHasClassForPlayer
  • reworkAdded CustomHudLayout.SetDialogVariableString
  • reworkAdded CustomHudLayout.SetDialogVariableStringForPlayer
  • reworkAdded CustomHudLayout.SetInputCaptureEnabled
  • reworkAdded CustomHudLayout.IsInputCaptureEnabled
  • reworkAdded CSPlayerCamera.IsEnabled
  • reworkAdded CSPlayerCamera.SetEnabled
  • reworkAdded CSPlayerCamera.SetIsControllingAngles
  • reworkAdded enum CSMoveType
  • fixCorrected types for some events where parameters were maybe undefined.
  • reworkErrors encountered during initial script run are now logged to the console.
  • reworkUnhandled promise rejections are now logged to the console.
  • reworkAdded the column number to errors caught during the CompileModule step of script loading.
  • reworkDeprecated planter from Instance.OnBombPlant event
  • reworkDeprecated defuser from Instance.OnBombDefuse event
Valve's original notes
[p]\[ MAP SCRIPTING ][/p][list][*][p]Added custom_hud_layout entity:[/p][list][*][p]custom_hud_layouts are the entry point for scripted maps to provide custom UI.[/p][/*][*][p]Panel, Label, Image, and Button panel types are supported.[/p][/*][*][p]Styling with css is supported.[/p][/*][*][p]Events and client side scripting are not supported.[/p][/*][*][p]Maintains state during tools mode reloads.[/p][/*][/list][/*][*][p]Added cs_player_camera entity:[/p][list][*][p]Gives control of a player's view without moving their pawn.[/p][/*][*][p]Can be configured to let the player look around from the scripted position.[/p][/*][/list][/*][*][p]Added Instance.Delay[/p][/*][*][p]Added Instance.OnBombPlantStart[/p][/*][*][p]Added Instance.OnBombPlantAbort[/p][/*][*][p]Added Instance.OnBombDefuseStart[/p][/*][*][p]Added Instance.OnBombDefuseAbort[/p][/*][*][p]Added Instance.OnCustomHudClicked[/p][/*][*][p]Added Instance.IsDedicatedServer[/p][/*][*][p]Added Entity.Move[/p][/*][*][p]Added Entity.GetMoveType[/p][/*][*][p]Added Entity.SetMoveType[/p][/*][*][p]Added CSPlayerPawn.GetC4[/p][/*][*][p]Added CSPlayerPawn.GetDefuseTarget[/p][/*][*][p]Added CSPlayerPawn.IsBuyMenuOpen[/p][/*][*][p]Added CSPlayerPawn.GetCamera[/p][/*][*][p]Added C4.GetPlantStartTime[/p][/*][*][p]Added C4.GetPlantFinishTime[/p][/*][*][p]Added C4.AbortPlant[/p][/*][*][p]Added CustomHudLayout.SetHasClass[/p][/*][*][p]Added CustomHudLayout.SetHasClassForPlayer[/p][/*][*][p]Added CustomHudLayout.SetDialogVariableString[/p][/*][*][p]Added CustomHudLayout.SetDialogVariableStringForPlayer[/p][/*][*][p]Added CustomHudLayout.SetInputCaptureEnabled[/p][/*][*][p]Added CustomHudLayout.IsInputCaptureEnabled[/p][/*][*][p]Added CSPlayerCamera.IsEnabled[/p][/*][*][p]Added CSPlayerCamera.SetEnabled[/p][/*][*][p]Added CSPlayerCamera.SetIsControllingAngles[/p][/*][*][p]Added enum CSMoveType[/p][/*][*][p]Corrected types for some events where parameters were maybe undefined.[/p][/*][*][p]Errors encountered during initial script run are now logged to the console.[/p][/*][*][p]Unhandled promise rejections are now logged to the console.[/p][/*][*][p]Added the column number to errors caught during the CompileModule step of script loading.[/p][/*][*][p]Deprecated planter from Instance.OnBombPlant event[/p][/*][*][p]Deprecated defuser from Instance.OnBombDefuse event[/p][/*][/list]

Published by Valve on Steam.