Skip to content

Commit 8d94cf5

Browse files
Update NPC scripting docs to reflect bestiary support
- Module description now mentions bosses, enemies, and bestiary entries - create() docs clarify name, fullName, bestiaryId, or sprite ID lookup
1 parent 8eaf4da commit 8d94cf5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/TEdit/Scripting/Examples/tedit-api.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ declare const signs: {
270270

271271
// ─── npcs ────────────────────────────────────────────────────────────────────
272272

273-
/** Query and modify town NPC data. */
273+
/** Query and modify world NPCs (town NPCs, bosses, enemies, and all bestiary entries). */
274274
declare const npcs: {
275275
/** Total number of NPCs. */
276276
readonly count: number;
@@ -282,7 +282,7 @@ declare const npcs: {
282282
setHome(name: string, x: number, y: number, index: number): void;
283283
/** Set home for all NPCs matching name. Returns count of NPCs moved. */
284284
setHomeAll(name: string, x: number, y: number): number;
285-
/** Create a new NPC. Name can be internal name (e.g., "Merchant") or sprite ID. */
285+
/** Create NPC by name, fullName, bestiaryId, or numeric sprite ID. Supports all bestiary entries. */
286286
create(name: string, displayName: string, x: number, y: number): void;
287287
/** Remove first NPC matching name. Returns true if removed. */
288288
remove(name: string): boolean;

src/TEdit/Scripting/ScriptApiMetadata.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ private static List<ApiModule> BuildModules() =>
111111
new("setText", "setText(x, y, text)", "Update sign text"),
112112
]),
113113

114-
new("npcs", "Query and modify town NPC data",
114+
new("npcs", "Query and modify world NPCs (town NPCs, bosses, enemies, and all bestiary entries)",
115115
[
116116
new("count", "count → int", "Total number of NPCs"),
117117
new("getAll", "getAll() → [{name, displayName, spriteId, x, y, homeX, homeY, isHomeless}]", "Get all NPCs including duplicates"),
118118
new("setHome", "setHome(name, x, y)", "Set home for first NPC matching name"),
119119
new("setHome", "setHome(name, x, y, index)", "Set home for Nth NPC matching name (0-based)"),
120120
new("setHomeAll", "setHomeAll(name, x, y) → int", "Set home for all NPCs matching name, returns count"),
121-
new("create", "create(name, displayName, x, y)", "Create a new NPC (name or sprite ID)"),
121+
new("create", "create(name, displayName, x, y)", "Create NPC by name, fullName, bestiaryId, or sprite ID"),
122122
new("remove", "remove(name) → bool", "Remove first NPC matching name"),
123123
]),
124124

0 commit comments

Comments
 (0)