Counter-Strike 2 / News

CS2 moves map scripting into Entities, while keeping the old calls available

Valve’s November 5 update adds entity spawning and bot-control hooks. Several existing methods move or change name, and ConnectOutput now takes a config object.

AI architectural miniature of a Counter-Strike-style bombsite being assembled from modular walls by a blue mechanical arm
Original AI illustration by ClutchScope; conceptual Workshop map construction, not a screenshot or a documented map layout.
In this article
  1. Which calls move where?
  2. New spawning, precaching and bot hooks
  3. Errors should be easier to locate

Counter-Strike 2’s November 5 update gives Workshop map scripts a new top-level Entities export and an Entities.Spawn method. It also reorganizes existing entity lookup and input/output calls, while retaining moved and renamed methods in their old locations as deprecated APIs.

For map authors, the important distinction is that this is a migration, not an announcement that every old call has stopped working. Valve explicitly says the moved and renamed methods remain available in their original locations.

Which calls move where?

The update lists these changes:

  • Instance.ConnectOutput moves to Entities.ConnectOutput and now accepts a config object.
  • Instance.DisconnectOutput moves to Entities.DisconnectOutput.
  • Instance.EntFireAtName becomes Entities.FireInput.
  • Instance.FindEntitiesByName becomes Entities.FindByName.
  • Instance.FindEntitiesByClass becomes Entities.FindByClass.
  • Instance.EntFireAtTarget becomes the entity-level Entity.FireInput.

That last distinction matters: the new top-level export is plural, Entities, while Entity.FireInput is an entity method. A mechanical replacement of every old prefix with the same new prefix would miss it.

Valve also deprecates the singular Instance.FindEntityByName and FindEntityByClass methods. The patch notes do not give a removal deadline.

New spawning, precaching and bot hooks

Alongside Entities.Spawn, Instance.Precache now accepts entities to precache. The update adds Instance.OnBotControl, CSPlayerController.IsControllingBot, CSPlayerController.GetControlledBotPawn and CSPlayerPawn.Reset.

The release notes list the method names but do not supply a complete migration example or the fields for the new ConnectOutput config object.

Errors should be easier to locate

Calling a method on a removed entity now reports that the entity is invalid. ConnectOutput also logs a warning if the target has no output with the requested name.

Those diagnostics address two different problems: an object that is no longer valid, and an output name that does not exist on its target. They give map authors a more specific starting point than treating every failed interaction as the same wiring problem.