@s2script/sdk 0.34.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s2script/sdk",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "license": "MIT OR Apache-2.0",
5
5
  "description": "s2script SDK — the builtin capability types (imported as @s2script/sdk/entity, …) plus the `s2s` CLI for building Source 2 / CS2 plugins.",
6
6
  "type": "module",
package/sound.d.ts CHANGED
@@ -73,6 +73,19 @@ export interface PrecacheContext {
73
73
  * precache, and its resources stay unusable until the next map change.
74
74
  */
75
75
  add(path: string): boolean;
76
+ /**
77
+ * Precache an entity class: everything that class needs to spawn (its models, particles and
78
+ * soundevents, and the classes it precaches in turn), the same precache the engine runs for each
79
+ * entity a map spawns. Use it for a class the map doesn't already contain, before you create one.
80
+ *
81
+ * @example
82
+ * pc.addEntity("chicken");
83
+ * pc.addEntity("prop_physics_multiplayer");
84
+ *
85
+ * Returns true when the engine ran the class's precache. It does not check the class name: an
86
+ * unknown class precaches nothing and still returns true. Same TIMING rule as {@link add}.
87
+ */
88
+ addEntity(classname: string): boolean;
76
89
  }
77
90
 
78
91
  /**
package/usermessages.d.ts CHANGED
@@ -43,6 +43,14 @@ export interface UserMessageView {
43
43
  readBool(path: string): boolean | null;
44
44
  /** Scalar string/bytes read. Dotted nested paths supported. null if absent/repeated/no message. */
45
45
  readString(path: string): string | null;
46
+ /** Repeated UTF-8 strings in order; [] when empty, null on wrong type/missing/invalid UTF-8/expired view.
47
+ * Dotted paths through singular sub-messages are supported. Requires matching runtime support. */
48
+ readStrings(path: string): string[] | null;
49
+ /** Edit a scalar int32/uint32/fixed32 field on the current message, preserving all other fields.
50
+ * Returns false for invalid type/range/path, a missing parent, or an expired view.
51
+ * Later handlers see edits; Continue/Changed delivers them, Handled/Stop suppresses the send.
52
+ * Requires matching runtime support. */
53
+ setInt(path: string, value: number): boolean;
46
54
  }
47
55
 
48
56
  /**