@s2script/sdk 0.16.0 → 0.18.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/dist/cli.js CHANGED
@@ -4492,7 +4492,7 @@ async function buildPlugin(dir, packagesDir) {
4492
4492
  const allowedBases = [`${unscoped}.gamedata.jsonc`, `${unscoped}.gamedata.json`];
4493
4493
  if (!allowedBases.includes(actualBase)) {
4494
4494
  throw new Error(
4495
- `s2script.gamedata must be named '${unscoped}.gamedata.jsonc' (after the plugin name without its scope, like the framework's own core.gamedata.jsonc), but is '${actualBase}'`
4495
+ `s2script.gamedata must be named '${unscoped}.gamedata.jsonc' (after the plugin name without its scope \u2014 a plugin's gamedata is named for its owner, the plugin itself), but is '${actualBase}'`
4496
4496
  );
4497
4497
  }
4498
4498
  const raw = stripJsonComments(readFileSync8(gdPath, "utf8"));
package/entity.d.ts CHANGED
@@ -3,6 +3,8 @@
3
3
  * NO runtime code: the engine injects the implementation at load time.
4
4
  */
5
5
 
6
+ import type { Vector } from "./math";
7
+
6
8
  /**
7
9
  * A host-liveness-gated handle to a live entity. `id` is a HOST-MINTED monotonic liveness
8
10
  * id — liveness is decided by the host's books (fed by engine create/delete notifications,
@@ -23,6 +25,16 @@ export declare class EntityRef {
23
25
  /** This entity's targetname (`CEntityIdentity::m_name`) — e.g. a map trigger's `"map_start"`. `""` if
24
26
  * the entity has no targetname; `null` if the ref is stale/invalid. */
25
27
  readonly name: string | null;
28
+ /** This entity's target (`CBaseEntity::m_target`) — the targetname of the entity it acts on, e.g. a
29
+ * `func_button`'s target entity. `""` if the entity has no target; `null` if the ref is stale/invalid. */
30
+ readonly target: string | null;
31
+ /** This entity's world-space position (`CGameSceneNode::m_vecAbsOrigin`, reached via
32
+ * `CBaseEntity::m_CBodyComponent` -> `CBodyComponent::m_pSceneNode`) — the same field CS2's
33
+ * `Pawn.origin` exposes for player pawns, readable here on any entity (e.g. ranking candidate
34
+ * `func_button`s by distance to a reference point). There is no meaningful "empty" position, so
35
+ * unlike {@link EntityRef.name}/{@link EntityRef.target}, `null` means exactly one thing: could not
36
+ * read (the ref is stale/invalid, or the field/chain didn't resolve) — never "no position". */
37
+ readonly origin: Vector | null;
26
38
  /** @internal The host mints refs; this is not part of the public API surface. */
27
39
  private constructor();
28
40
  /** True iff the host's books say live AND the identity slot still matches. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s2script/sdk",
3
- "version": "0.16.0",
3
+ "version": "0.18.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",