MCPcopy Index your code
hub / github.com/Peterclark1996/s2ts

github.com/Peterclark1996/s2ts @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
126 symbols 173 edges 18 files 66 documented · 52%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Source 2 TypeScript

A counter strike 2 quick typescript project setup with bundler that automatically bundles all .ts typescript files.

[!IMPORTANT]
Now valve have officaily supported their JS interface, this project has been stripped back to a glorified typescript + rollup setup. This project is no longer needed, I would recommend setting up typescript and some bundler yourself, or using this boilerplate project https://github.com/Source2ZE/cs_script_boilerplate

Installation

Run npx create-s2ts@latest at the root of your map folder. The folder should be something like /Steam/steamapps/common/Counter-Strike Global Offensive/content/csgo_addons/<map-name>. This will setup a node project and create an example script.

npx create-s2ts@latest

Run the install.

npm install

Usage

Once installed you can run with the start command:

npm run start
  • While running, s2ts will look for any file updates to .ts files in your /scripts/vscripts folder and bundle them into a js file with no external dependencies so they can run in counter strike.

  • While the workshop tools are running, the bundled .js files in the build folder will be compiled and accessable in your point_script entity.

  • Documentation for Valves scripting API

Extension points exported contracts — how you extend this code

BulletTrace (Interface)
* Configuration object for `Instance.TraceBullet` * @example {damage:30, rangeModifer:.85, penetration:1} // Glock
packages/s2ts/types/point_script.d.ts
BulletTraceResult (Interface)
* Result entry for `Instance.TraceBullet`
packages/s2ts/types/point_script.d.ts
BaseTraceConfig (Interface)
(no doc)
packages/s2ts/types/point_script.d.ts
TraceResult (Interface)
(no doc)
packages/s2ts/types/point_script.d.ts
ModifyPlayerDamageEvent (Interface)
(no doc)
packages/s2ts/types/point_script.d.ts

Core symbols most depended-on inside this repo

tryWriteFile
called by 5
packages/create-s2ts/src/index.ts
standardisePath
called by 3
packages/s2ts/src/cli.ts
processFileAtPath
called by 2
packages/s2ts/src/cli.ts
transpileFromTypeScript
called by 2
packages/s2ts/src/compiler/transpile.ts
tryCreateFolder
called by 2
packages/create-s2ts/src/index.ts
start
called by 1
packages/s2ts/src/cli.ts
processFileData
called by 1
packages/s2ts/src/cli.ts
bundleImports
called by 1
packages/s2ts/src/compiler/rollup.ts

Shape

Method 63
Function 19
Class 18
Interface 16
Enum 10

Languages

TypeScript100%

Modules by API surface

packages/s2ts/types/cspointscript.d.ts71 symbols
packages/s2ts/types/point_script.d.ts36 symbols
scripts/generateInstanceDocs.ts6 symbols
packages/s2ts/src/cli.ts4 symbols
packages/create-s2ts/src/index.ts3 symbols
packages/s2ts/src/compiler/version.ts1 symbols
packages/s2ts/src/compiler/transpile.ts1 symbols
packages/s2ts/src/compiler/rollup.ts1 symbols
packages/s2ts/src/compiler/publicMethods.ts1 symbols
documentation/src/pages/index.tsx1 symbols
documentation/src/components/DocsOutdatedAlert.tsx1 symbols

For agents

$ claude mcp add s2ts \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact