Skip to content

Commit 9545340

Browse files
committed
docs: fix typos
1 parent d502d44 commit 9545340

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

content/6.plugins/5.s2sdk/4.guides/7.pulse-integration.md renamed to content/6.plugins/5.s2sdk/4.guides/7.cs_script-integration.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
---
2-
title: Pulse System Integration
3-
description: How to integrate Valve's Pulse (cs_script) system with Plugify plugins.
2+
title: CS_Script System Integration
3+
description: How to integrate Valve's CS_Script system with Plugify plugins.
44
---
55

66
## Overview
77

8-
Counter-Strike 2 includes **Pulse** (also known as `cs_script`), a JavaScript-based scripting system that provides access to game entities, events, and functionality. The s2sdk plugin enables Plugify language modules to integrate with Pulse by exposing Valve's module resolver, allowing you to use both Plugify plugins and Valve's Pulse system together.
8+
Counter-Strike 2 includes **CS_Script** (a JavaScript-based scripting system that provides access to game entities, events, and functionality. The s2sdk plugin enables Plugify language modules to integrate with CS_Script by exposing Valve's module resolver, allowing you to use both Plugify plugins and Valve's CS_Script system together.
99

10-
For more information about Valve's Pulse system, see:
10+
For more information about Valve's CS_Script system, see:
1111
- [Counter-Strike 2 Scripting API](https://developer.valvesoftware.com/wiki/Counter-Strike_2_Workshop_Tools/Scripting_API)
1212
- [Hello Gordon Tutorial](https://developer.valvesoftware.com/wiki/Counter-Strike_2_Workshop_Tools/Scripting/Hello_Gordon)
1313

1414
## The Timing Challenge
1515

16-
There's an important timing consideration when working with Pulse:
16+
There's an important timing consideration when working with CS_Script:
1717

1818
- **Plugify plugins load early** during server initialization
19-
- **Pulse modules become available later** after the game rules object is created
19+
- **CS_Script modules become available later** after the game rules object is created
2020
- **s2sdk creates a `point_script` entity** once Valve's scripting system is ready
2121

22-
This means you **cannot** import Pulse modules at the top of your plugin file:
22+
This means you **cannot** import CS_Script modules at the top of your plugin file:
2323

2424
```js
25-
// ❌ This will NOT work - Pulse isn't available yet
25+
// ❌ This will NOT work - CS_Script isn't available yet
2626
import { Instance } from "cs_script/point_script";
2727
```
2828

2929
## The Solution: Dynamic Imports
3030

31-
Instead, use the `OnEntityCreated` listener to detect when the `point_script` entity is created, then dynamically import Pulse modules:
31+
Instead, use the `OnEntityCreated` listener to detect when the `point_script` entity is created, then dynamically import CS_Script modules:
3232

3333
```js
3434
// ✅ This works - import after point_script is created
3535
import("cs_script/point_script").then(point_script => {
3636
const { Instance } = point_script;
37-
// Now you can use Pulse functionality
37+
// Now you can use CS_Script functionality
3838
});
3939
```
4040

@@ -48,7 +48,7 @@ import * as s2sdk from ':s2sdk';
4848

4949
export class SamplePlugin extends Plugin {
5050
pluginStart() {
51-
console.log("Plugin started - waiting for Pulse...");
51+
console.log("Plugin started - waiting for CS_Script...");
5252
s2sdk.OnEntityCreated_Register(SamplePlugin.OnEntityCreated);
5353
}
5454

@@ -62,14 +62,14 @@ export class SamplePlugin extends Plugin {
6262
if (className === "point_script") {
6363
console.log(`point_script entity created [handle: ${entityHandle}]`);
6464

65-
// Small delay to ensure Pulse is fully initialized
65+
// Small delay to ensure CS_Script is fully initialized (Optional)
6666
setTimeout(() => {
67-
// Dynamically import Pulse modules
67+
// Dynamically import CS_Script modules
6868
import("cs_script/point_script").then(point_script => {
6969
const { Instance } = point_script;
7070

71-
console.log("Pulse system connected!");
72-
Instance.Msg("Pulse system connected from Plugify!");
71+
console.log("CS_Script system connected!");
72+
Instance.Msg("CS_Script system connected from Plugify!");
7373

7474
// Example: Set up a think function
7575
Instance.SetThink(() => {
@@ -79,7 +79,7 @@ export class SamplePlugin extends Plugin {
7979
Instance.SetNextThink(Instance.GetGameTime());
8080

8181
}).catch(error => {
82-
console.error("Failed to import Pulse module:", error);
82+
console.error("Failed to import CS_Script module:", error);
8383
});
8484
}, 100);
8585
}
@@ -89,9 +89,9 @@ export class SamplePlugin extends Plugin {
8989
::
9090
::
9191

92-
## Detecting Pulse Availability in Other Languages
92+
## Detecting CS_Script Availability in Other Languages
9393

94-
While full Pulse integration is JavaScript-specific, other languages can detect when Pulse becomes available:
94+
While full CS_Script integration is JavaScript-specific, other languages can detect when CS_Script becomes available:
9595

9696
::tabs{variant="card"}
9797
::div{label="c#" icon="vscode-icons:file-type-csharp2"}
@@ -117,7 +117,7 @@ public unsafe class Sample : Plugin
117117

118118
if (className == "point_script")
119119
{
120-
PrintToServer("Pulse system is now available!\n");
120+
PrintToServer("CS_Script system is now available!\n");
121121
// You can now interact with the point_script entity
122122
}
123123
}
@@ -141,7 +141,7 @@ class Sample(Plugin):
141141
class_name = s2.GetEntityClassname(entity_handle)
142142

143143
if class_name == "point_script":
144-
s2.PrintToServer("Pulse system is now available!\n")
144+
s2.PrintToServer("CS_Script system is now available!\n")
145145
```
146146
::
147147
::div{label="c++" icon="vscode-icons:file-type-cpp3"}
@@ -166,7 +166,7 @@ private:
166166
auto className = GetEntityClassname(entityHandle);
167167

168168
if (className == "point_script") {
169-
PrintToServer("Pulse system is now available!\n");
169+
PrintToServer("CS_Script system is now available!\n");
170170
}
171171
}
172172
};
@@ -176,7 +176,7 @@ private:
176176
177177
## Advanced Usage: Hybrid Plugins
178178
179-
You can create powerful hybrid plugins that combine Plugify's multi-language support with Pulse's game integration:
179+
You can create powerful hybrid plugins that combine Plugify's multi-language support with CS_Script's game integration:
180180
181181
```js
182182
import { Plugin } from 'plugify';
@@ -209,7 +209,7 @@ export class HybridPlugin extends Plugin {
209209
static OnPlayerSpawn(name, event, dontBroadcast) {
210210
const userid = s2sdk.GetEventInt(event, "userid");
211211
212-
// Use both s2sdk and Pulse together
212+
// Use both s2sdk and CS_Script together
213213
if (HybridPlugin.pulseReady) {
214214
HybridPlugin.Instance.Msg(`Player spawned: ${userid}`);
215215
}
@@ -223,19 +223,19 @@ export class HybridPlugin extends Plugin {
223223

224224
- **The Plugify V8 module** provides Node.js-like features beyond basic JavaScript. See the [official V8 module documentation](https://github.com/untrustedmodders/plugify-module-v8) for details.
225225

226-
- **Always use dynamic imports** for Pulse modules - static imports at the top of the file will fail.
226+
- **Always use dynamic imports** for CS_Script modules - static imports at the top of the file will fail.
227227

228-
- **Add a small timeout** (e.g., 100ms) after detecting `point_script` to ensure Pulse is fully initialized.
228+
- **Add a small timeout** (e.g., 100ms) after detecting `point_script` to ensure CS_Script is fully initialized.
229229

230230
- **Handle import errors** gracefully using `.catch()` on your import promises.
231231

232-
- **Only JavaScript plugins** can fully integrate with Pulse, but other languages can detect when it becomes available.
232+
- **Only JavaScript plugins** can fully integrate with CS_Script, but other languages can detect when it becomes available.
233233

234234
- **The `point_script` entity** is automatically created by s2sdk once the game rules object exists.
235235

236236
## Common Patterns
237237

238-
### Waiting for Pulse Before Executing Code
238+
### Waiting for CS_Script Before Executing Code
239239

240240
```js
241241
export class MyPlugin extends Plugin {
@@ -250,14 +250,14 @@ export class MyPlugin extends Plugin {
250250

251251
pluginStart() {
252252
MyPlugin.waitForPulse((Instance) => {
253-
console.log("Pulse ready, executing plugin logic...");
253+
console.log("CS_Script ready, executing plugin logic...");
254254
Instance.Msg("Plugin initialized!");
255255
});
256256
}
257257
}
258258
```
259259

260-
### Using Multiple Pulse Modules
260+
### Using Multiple CS_Script Modules
261261

262262
```js
263263
static async loadPulseModules() {
@@ -274,7 +274,7 @@ static async loadPulseModules() {
274274
events: events
275275
};
276276
} catch (error) {
277-
console.error("Failed to load Pulse modules:", error);
277+
console.error("Failed to load CS_Script modules:", error);
278278
return null;
279279
}
280280
}

0 commit comments

Comments
 (0)