@kingdomsconnected/types 1.5.0 → 1.5.1

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.
@@ -5,6 +5,13 @@ declare global {
5
5
  * Native events dispatched through `Events.on`. Each property is the exact callback argument tuple for that event.
6
6
  */
7
7
  interface EventMap {
8
+ /**
9
+ * Dispatched once per session, when the local player can play: the session is established and the game has taken its own loading screen down. The game raises that moment itself -- it is its own gameplay-start signal, not a guess from timing.
10
+ *
11
+ * Resources are running long before this, so it is not the moment a resource may start listening; it is the moment the player is looking at the world. Put what the player should see on arrival here -- a welcome, a first page -- rather than in `resourceStart`, which runs behind the loading screen. The server raises its own `playerReady` for this player right after.
12
+ */
13
+ playerReady: [player: Player];
14
+
8
15
  /**
9
16
  * Dispatched when this player starts or stops following a server quest in the game's journal, whichever way it happened: the track button, the game auto-tracking a quest that turns active, or the untrack that follows finishing or failing one. Local to this machine and raised before the server is told; the server raises its own `questTrackingChanged` when the report arrives. Repeats are filtered, so it only fires on an actual change. Handler promises are not awaited.
10
17
  */
@@ -3555,7 +3562,7 @@ declare global {
3555
3562
  send(text: string): void;
3556
3563
 
3557
3564
  /**
3558
- * Changes visibility of the native chat overlay without opening its input field.
3565
+ * Changes visibility of the native chat overlay without opening its input field. Hidden, the overlay also stops opening on its key. The choice holds for the rest of the session and resets to visible on disconnect, so a resource that replaces the chat calls this once at startup.
3559
3566
  * @param visible Whether the chat overlay is rendered.
3560
3567
  */
3561
3568
  setUIVisible(visible: boolean): void;
@@ -3797,6 +3804,18 @@ declare global {
3797
3804
  */
3798
3805
  getRange(): number;
3799
3806
 
3807
+ /**
3808
+ * Switches how far this player's voice carries. A request: the server paces it, decides the radius, and may move the player itself.
3809
+ * @param tier Voice tier: 0 whisper, 1 normal, 2 shout.
3810
+ */
3811
+ setTier(tier: number): void;
3812
+
3813
+ /**
3814
+ * Reads the voice tier this player is on.
3815
+ * @returns 0 whisper, 1 normal, 2 shout.
3816
+ */
3817
+ getTier(): number;
3818
+
3800
3819
  /**
3801
3820
  * Rebinds push-to-talk. Unknown key names throw.
3802
3821
  * @param key Case-insensitive key name, using the same names as Key.bind.
@@ -50,11 +50,44 @@ declare global {
50
50
  */
51
51
  playerSpawning: [player: Player];
52
52
 
53
+ /**
54
+ * Dispatched once when the animation a `playAnimation` request started is over. `fragment` is the request's. `reason` says how: `finished` when a one-shot played to its end, `interrupted` when it was playing and something cut it short (a hit, a weapon drawn, a teleport), `refused` when the game would not start it at all, `stopped` for `stopAnimation`, `replaced` for another `playAnimation`.
55
+ *
56
+ * The first three come from the player's own client, sent from the moment the game's animation system ended it, so this is the place to chain the next animation. A `loop` never finishes by itself and only ends `stopped` or `replaced`. A request with no fragment -- one that only holds a prop or a tag -- raises nothing.
57
+ */
58
+ playerAnimationEnd: [player: Player, fragment: string, reason: 'finished' | 'interrupted' | 'refused' | 'stopped' | 'replaced'];
59
+
60
+ /**
61
+ * Dispatched when a player has picked up another player's body, before the server accepts it -- the place to decide who may carry whom. Return `false` from a handler and the carry is refused: the carrier's client is told to let go at once, and no `playerCarry` follows. Handlers run synchronously, so the decision cannot wait on anything awaited.
62
+ *
63
+ * The pick-up is the game's own "grab" prompt, which it offers only over a body that is down -- dead or unconscious -- so a player a script revives at once is never there to carry. The carrier's game has already started the pick-up when this runs.
64
+ */
65
+ playerCarrying: [carrier: Player, carried: Player];
66
+
67
+ /**
68
+ * Dispatched once a carry is accepted: the carried body is on the carrier's shoulder on every client, and `carrier.carrying` names it. It rides there until `playerPutDown`.
69
+ */
70
+ playerCarry: [carrier: Player, carried: Player];
71
+
72
+ /**
73
+ * Dispatched once a carry is over, however it ended: the carrier dropped the body, `putDown` asked them to, the carried player was revived, or either of them left. A player who is leaving is still readable here; the event comes before their body is destroyed.
74
+ */
75
+ playerPutDown: [carrier: Player, carried: Player];
76
+
53
77
  /**
54
78
  * Dispatched once a joining player is really standing in the world: their level is up, their body is where `playerSpawning` put it, and the ground under it has loaded. Anything that acts on an arriving player -- kit, a welcome line, a marker -- belongs here rather than in `playerConnect`, which fires while they are still loading the level, or in `playerSpawning`, where the body is still mid-placement.
79
+ *
80
+ * The player may still be looking at the game's loading screen; `playerReady` follows once they are not.
55
81
  */
56
82
  playerSpawned: [player: Player];
57
83
 
84
+ /**
85
+ * Dispatched once per connection, after `playerSpawned`, when the player can play: their own client reports that the game has taken its loading screen down. The game raises that moment itself -- it is its own gameplay-start signal, not a guess from timing.
86
+ *
87
+ * That player's client resources were already running at `playerSpawned`, so this is not needed to make sure a `player.emit` is received. It is for what the player should actually see on arrival -- a welcome, a first page, a camera shot -- which shown earlier would play behind the loading screen. A client that never gets that far, or disconnects first, never raises it.
88
+ */
89
+ playerReady: [player: Player];
90
+
58
91
  /**
59
92
  * Dispatched immediately after a horse is created and replicated, whether by `Horse.spawn`, the `/horse` command, or anything else.
60
93
  */
@@ -229,6 +262,11 @@ declare global {
229
262
  */
230
263
  npcRevive: [npc: Npc];
231
264
 
265
+ /**
266
+ * Dispatched once when the animation a `playAnimation` request started is over; `fragment` is the request's. `reason` is `finished`, `interrupted`, `refused`, `stopped` or `replaced`, as for `playerAnimationEnd`. The first three come from the client simulating the NPC. One that nobody simulates plays nothing, so its one-shot ends `refused` as soon as it is asked for, and one cut off by a change of simulator ends `interrupted`: the new simulator does not replay what it did not see start.
267
+ */
268
+ npcAnimationEnd: [npc: Npc, fragment: string, reason: 'finished' | 'interrupted' | 'refused' | 'stopped' | 'replaced'];
269
+
232
270
  /**
233
271
  * Dispatched when a player presses use on an NPC whose `interactable` is on. The client reports the press and the server confirms the distance against the position it already replicates, so a claim it does not agree with never reaches here.
234
272
  */
@@ -266,6 +304,13 @@ declare global {
266
304
  */
267
305
  doorInteract: [player: Player, door: Door, action: "open" | "close" | "lock" | "unlock" | "lockpick", keySide: boolean];
268
306
 
307
+ /**
308
+ * Dispatched when a player presses a container's prompt, before anything happens: the player's client holds the game's own handler until the server answers. `action` is `open`, `unlock` -- a key turned, which opens it in the same use -- or `lockpick`, the minigame starting; a successful pick then opens it without asking again.
309
+ *
310
+ * Return false to refuse it: the prompt does nothing, and no transfer screen, key or minigame ever appears. Every handler runs whatever an earlier one returned, and an async handler cannot refuse. The server has already refused what the game's own rules forbid -- a player out of reach, a container another player has open, opening a locked one, picking one that cannot be -- so this only sees what the game would allow. Closing is never asked.
311
+ */
312
+ stashInteract: [player: Player, stash: Stash, action: "open" | "unlock" | "lockpick"];
313
+
269
314
  /**
270
315
  * Dispatched when a player submits a plain chat line. Turn `Chat.setDefaultRelay(false)` off to own delivery yourself.
271
316
  */
@@ -721,6 +766,16 @@ declare global {
721
766
  */
722
767
  readonly mounted: boolean;
723
768
 
769
+ /**
770
+ * The player whose body this one carries on their shoulder, or null. Set once `playerCarry` has fired, cleared once `playerPutDown` has.
771
+ */
772
+ readonly carrying: Player | null;
773
+
774
+ /**
775
+ * The player carrying this one's body, or null.
776
+ */
777
+ readonly carriedBy: Player | null;
778
+
724
779
  /**
725
780
  * The horse this player is riding, or null when they are on foot.
726
781
  */
@@ -782,7 +837,9 @@ declare global {
782
837
  /**
783
838
  * Makes this player's body play one of the game's animations, on their own screen and on everybody else's -- a wave, a bow, a woodcutter's swing with the axe in hand. It is state rather than a one-off: a player who streams in or joins while it plays sees it too, and it lasts until `stopAnimation` or the next `playAnimation`, even after a one-shot has finished.
784
839
  *
785
- * The animation is the game's own, so the game can cut it short: a hit, a fall or drawing a weapon ends it, and so can the player walking off from one that leaves the legs free. `loop` starts it again when that happens.
840
+ * A new `playAnimation`, `stopAnimation` and `teleport` cut a running animation at once rather than waiting for it to finish. The game can cut it short too: a hit, a fall or drawing a weapon ends it, and so can the player walking off from one that leaves the legs free. `loop` starts it again when that happens, and keeps a one-shot going pass after pass with no gap between them.
841
+ *
842
+ * `playerAnimationEnd` fires once when the animation this request started is over, and says how. A loop ends only by being stopped or replaced.
786
843
  *
787
844
  * A hand tag is only half of holding something. `r_bucket` makes the body move as if it carried a bucket, but the bucket itself is a `props` entry.
788
845
  * @param fragment A Mannequin fragment, as `Animations.list` names it. `""` plays none and only puts the props and tags on, which with a hand tag like `r_bucket` makes the player carry something while they walk.
@@ -792,10 +849,35 @@ declare global {
792
849
  playAnimation(fragment: string, options?: { tags?: string; loop?: boolean; lockMovement?: boolean; props?: { item?: string; model?: string; hand?: 'right' | 'left'; joint?: string; position?: Vector3 | Partial<Vector3>; rotation?: Quaternion | Vector3 | Partial<Vector3> } | { item?: string; model?: string; hand?: 'right' | 'left'; joint?: string; position?: Vector3 | Partial<Vector3>; rotation?: Quaternion | Vector3 | Partial<Vector3> }[] }): boolean;
793
850
 
794
851
  /**
795
- * Ends what `playAnimation` started, takes its props away and hands the body back to the game.
852
+ * Ends what `playAnimation` started at once, takes its props away and hands the body back to the game. A stance tag the animation set goes with it, so without `standUp` a seated player pops upright.
853
+ *
854
+ * The stand-up is an animation of its own: it raises its own `playerAnimationEnd`, fragment `StandUp` or `GetUp`, once the player is on their feet, and a `playAnimation` during it replaces it.
855
+ * @param options `standUp` plays the game's own way back to standing when the animation held the body in a sitting or lying stance tag (`sittingNoTable`, `lyingGround`): `StandUp` or `GetUp`, in the variant that fits that stance. Without it, or for a stance the game authors no way out of (`beggarKneel`), the body goes straight back to standing.
796
856
  * @returns True when the request went out; false for a player with no body yet.
797
857
  */
798
- stopAnimation(): boolean;
858
+ stopAnimation(options?: { standUp?: boolean }): boolean;
859
+
860
+ /**
861
+ * Sets this player's facial expression, on their own screen and on everybody else's, alongside whatever their body plays. It is state: a player who streams in sees it, and it lasts until the next call.
862
+ *
863
+ * The expression is the eyes, brows and mood. It never moves the mouth -- the game's own `FE_DialogueSpeaking` animates only the eyes and leaves the mouth to the voice line being spoken. `setTalking` is the mouth.
864
+ *
865
+ * A mood tag is one of the body's own tags, so it can change the mood of the body's idle too, for as long as the expression holds.
866
+ * @param fragment A fragment on the face's own scope: `FE_Default`, `FE_DialogueIdle` or `FE_DialogueSpeaking` for a held mood, or an `ADLG_FA_*` gesture (`ADLG_FA_Smile`, `ADLG_FA_Wink`, `ADLG_FA_Laugh`, `ADLG_FA_Surprise`...) that plays once. `""` hands the face back to the game.
867
+ * @param options `tags` pick the variant: for the `FE_*` fragments the mood, `happy`, `angry`, `sad`, `nervous`, `pensive`, `arogant` or `drunk`, as `Animations.list("FE_")` spells them.
868
+ * @returns True when the request went out; false for a player with no body yet. Throws for an argument it cannot use.
869
+ */
870
+ setFacialExpression(fragment: string, options?: { tags?: string }): boolean;
871
+
872
+ /**
873
+ * Moves this player's mouth as if they were talking, on their own screen and on everybody else's, until told to stop -- for text chat, voice chat or a scene. It is a looping talk animation, not lip-sync: it follows no words.
874
+ *
875
+ * The game's own lip-sync wins while it plays a voice line on the same body, and the loop comes back after it.
876
+ * @param talking Whether the mouth moves.
877
+ * @param style How: `neutral` (the default), `happy`, `drunk` or `chew`.
878
+ * @returns True when the request went out; false for a player with no body yet. Throws for a style it does not know.
879
+ */
880
+ setTalking(talking: boolean, style?: 'neutral' | 'happy' | 'drunk' | 'chew'): boolean;
799
881
 
800
882
  /**
801
883
  * Asks this player's own client to wear a different body -- face, hair, beard and skin. The owning client is authoritative for its body, so this is a request that lands on their next frame rather than a write; read `player.appearance` back to see what they actually put on.
@@ -888,6 +970,12 @@ declare global {
888
970
  */
889
971
  dismount(): Horse | null;
890
972
 
973
+ /**
974
+ * Has this player put down the body on their shoulder, with the game's own put-down. It is an instruction to their client, so the carry ends when that put-down lands: `playerPutDown` follows then, and `carrying` reads null from that moment.
975
+ * @returns True when the order went out; false when they carry nobody or have no connection.
976
+ */
977
+ putDown(): boolean;
978
+
891
979
  /**
892
980
  * Puts this player in a horse's saddle, the way the game's own forced mount does -- their client plays the climb. It is an instruction to their client, so the seat is reported back like any other mount: `horseMounting` can still refuse it, and `horseMount` and `player.horse` follow once it lands. The player has to be standing near the horse; teleport them beside it first.
893
981
  * @param horse The horse to climb onto.
@@ -2013,9 +2101,11 @@ declare global {
2013
2101
  teleport(position: Vector3 | Partial<Vector3>, rotation?: Quaternion | Vector3 | Partial<Vector3>): boolean;
2014
2102
 
2015
2103
  /**
2016
- * Makes the NPC play one of the game's animations -- chopping wood with an axe in hand, drawing water, sitting, drinking -- on every client, the one simulating it included. It is state rather than a one-off: a client that streams the NPC in, and the next one to simulate it, play it too, until `stopAnimation` or the next `playAnimation`.
2104
+ * Makes the NPC play one of the game's animations -- chopping wood with an axe in hand, drawing water, sitting, drinking -- on every client, the one simulating it included. It is state rather than a one-off: a client that streams the NPC in, and the next one to simulate it, play it too, until `stopAnimation` or the next `playAnimation`, which both cut it at once.
2105
+ *
2106
+ * Give it something to do that keeps it in place, `hold` or `lookAt`: an order to walk makes the legs fight a full-body animation. A hit or a fall can cut the animation short; `loop` starts it again, and keeps a one-shot going pass after pass with no gap.
2017
2107
  *
2018
- * Give it something to do that keeps it in place, `hold` or `lookAt`: an order to walk makes the legs fight a full-body animation. A hit or a fall can cut the animation short; `loop` starts it again.
2108
+ * `npcAnimationEnd` fires once when the animation this request started is over, and says how.
2019
2109
  * @param fragment A Mannequin fragment, as `Animations.list` names it -- or, as before, a row of the shipped emote catalog, which plays that gesture once and is not remembered.
2020
2110
  * @param options `tags` pick the variant, `loop` repeats it until stopped, `props` puts up to two models in its hands. `lockMovement` does nothing here: an NPC standing still is its intent's business.
2021
2111
  * @returns True when the request went out; false for a dead NPC. Throws for a prop or option it cannot use.
@@ -2023,10 +2113,29 @@ declare global {
2023
2113
  playAnimation(fragment: string | number, options?: { tags?: string; loop?: boolean; lockMovement?: boolean; props?: { item?: string; model?: string; hand?: 'right' | 'left'; joint?: string; position?: Vector3 | Partial<Vector3>; rotation?: Quaternion | Vector3 | Partial<Vector3> } | { item?: string; model?: string; hand?: 'right' | 'left'; joint?: string; position?: Vector3 | Partial<Vector3>; rotation?: Quaternion | Vector3 | Partial<Vector3> }[] }): boolean;
2024
2114
 
2025
2115
  /**
2026
- * Ends what `playAnimation` started, takes its props away and hands the body back to its intent.
2116
+ * Ends what `playAnimation` started at once, takes its props away and hands the body back to its intent. The stand-up `standUp` asks for is an animation of its own and raises its own `npcAnimationEnd`.
2117
+ * @param options `standUp` plays the game's own way back to standing when the animation held the body in a sitting or lying stance tag: `StandUp` or `GetUp`, in the variant that fits. Without it the body goes straight back to standing.
2027
2118
  * @returns True when the request went out.
2028
2119
  */
2029
- stopAnimation(): boolean;
2120
+ stopAnimation(options?: { standUp?: boolean }): boolean;
2121
+
2122
+ /**
2123
+ * Sets the NPC's facial expression on every client, alongside whatever its body plays. It is state: a client that streams the NPC in, and the next one to simulate it, show it too, until the next call.
2124
+ *
2125
+ * The expression is the eyes, brows and mood; it never moves the mouth, which is `setTalking`. A mood tag is one of the body's own tags, so it can change the mood of its idle too.
2126
+ * @param fragment A fragment on the face's own scope: `FE_Default`, `FE_DialogueIdle` or `FE_DialogueSpeaking` for a held mood, or an `ADLG_FA_*` gesture (`ADLG_FA_Smile`, `ADLG_FA_Wink`, `ADLG_FA_Laugh`, `ADLG_FA_Surprise`...) that plays once. `""` hands the face back to the game.
2127
+ * @param options `tags` pick the variant: for the `FE_*` fragments the mood, `happy`, `angry`, `sad`, `nervous`, `pensive`, `arogant` or `drunk`, as `Animations.list("FE_")` spells them.
2128
+ * @returns True when the request went out; false for a dead NPC. Throws for an argument it cannot use.
2129
+ */
2130
+ setFacialExpression(fragment: string, options?: { tags?: string }): boolean;
2131
+
2132
+ /**
2133
+ * Moves the NPC's mouth as if it were talking, on every client, until told to stop. Pair it with `say` for a line of text. It is a looping talk animation, not lip-sync: it follows no words, and the game's own lip-sync wins while the NPC speaks a voice line of its own.
2134
+ * @param talking Whether the mouth moves.
2135
+ * @param style How: `neutral` (the default), `happy`, `drunk` or `chew`.
2136
+ * @returns True when the request went out; false for a dead NPC. Throws for a style it does not know.
2137
+ */
2138
+ setTalking(talking: boolean, style?: 'neutral' | 'happy' | 'drunk' | 'chew'): boolean;
2030
2139
 
2031
2140
  /**
2032
2141
  * Puts a line of speech over the body on every client that can see it.
@@ -2615,38 +2724,83 @@ declare global {
2615
2724
  interface Gate extends Entity {}
2616
2725
 
2617
2726
  /**
2618
- * Replicated container handle.
2727
+ * Replicated container handle: one a script spawned, or one the level places.
2619
2728
  */
2620
2729
  class Stash {
2621
2730
  /**
2622
- * Creates a script wrapper for an existing container with this ID; use Stash.spawn() to spawn one.
2731
+ * Creates a script wrapper for an existing container with this ID; use Stash.spawn() to spawn one, or Stash.find() for one the level places.
2623
2732
  * @param id Network entity identifier.
2624
2733
  */
2625
2734
  constructor(id: number);
2626
2735
 
2627
2736
  /**
2628
- * The identity every client turns into the same native container. Minted by the server from 1, and not `id`, which is the replication entity's.
2737
+ * The identity every client turns into the same native container, for one a script spawned. Minted by the server from 1, and not `id`, which is the replication entity's. 0 for a container the level places.
2629
2738
  */
2630
2739
  readonly stashId: number;
2631
2740
 
2632
2741
  /**
2633
- * How many stacks the server is holding. Contents are not replicated -- they are pulled when a player opens the container and pushed back when they close it -- so this is the only view of what is in one.
2742
+ * The EntityGuid every client finds this container under, as sixteen lowercase hex digits: the level's own for a container the level places, the one minted when a script spawned it otherwise. Every container has one, and `Stash.find` takes it back.
2743
+ */
2744
+ readonly guid: string;
2745
+
2746
+ /**
2747
+ * The level's own EntityGuid for a container the level places, as sixteen lowercase hex digits; empty for one a script spawned. The same on every machine, so it is the identity to store a container under; `Stash.find` takes it back.
2748
+ */
2749
+ readonly levelGuid: string;
2750
+
2751
+ /**
2752
+ * The entity name the level gives the container, or `spawned_stash_<stashId>` for one a script spawned.
2753
+ */
2754
+ readonly name: string;
2755
+
2756
+ /**
2757
+ * How many stacks the server is holding. Contents are not replicated -- they are pulled when a player opens the container and pushed back when they close it -- so this is the only view of what is in one. A container linked to another in the level opens that one's contents, and reads them here too.
2634
2758
  */
2635
2759
  readonly itemCount: number;
2636
2760
 
2637
2761
  /**
2638
- * The network ID of the player who has it open, or 0. While it is held, the game's own lock keeps every other client out.
2762
+ * The network ID of the player who has its contents open, or 0. While it is held, every other player's open is refused before their transfer screen appears.
2639
2763
  */
2640
2764
  readonly holderId: number;
2641
2765
 
2766
+ /**
2767
+ * Whether the container is locked. Assignment reaches every client that has it streamed in. A locked container offers only its key and its lockpick; a script locking one marks it `lockedByServer`, which the generated home or shop key does not open. Unlocking it by any route the server accepted clears both.
2768
+ */
2769
+ locked: boolean;
2770
+
2771
+ /**
2772
+ * Whether the lock was set by a script rather than by the level. The generated home or shop key does not open a container locked from here.
2773
+ */
2774
+ readonly lockedByServer: boolean;
2775
+
2776
+ /**
2777
+ * Whether the container offers the lockpick while locked. Starts as the level authored it; assignment reaches every client, and a pick on one that cannot be is refused.
2778
+ */
2779
+ lockpickable: boolean;
2780
+
2781
+ /**
2782
+ * The item class GUID of the key that unlocks the container, as `player.giveItem` takes it. Reads the level's own key until a script assigns one; empty when it has none. Assigning a class makes every client ask for that class instead, so a player holding it is offered "unlock and open"; assigning an empty string restores the level's. An unknown class is refused and logged. The server does not see inventories: which key a player holds is their client's to say, and `stashInteract` is where a script checks its own record.
2783
+ */
2784
+ keyItem: string;
2785
+
2786
+ /**
2787
+ * The horizontal unit direction a player has to face the container along to be offered it: the game's own use check only offers a chest to a body standing behind this axis and looking along it. Stand at `position - useDirection * distance` to face it.
2788
+ */
2789
+ readonly useDirection: Vector3;
2790
+
2791
+ /**
2792
+ * Whether the level builds this container locked, which is the state it has at boot. False for one a script spawned.
2793
+ */
2794
+ readonly startsLocked: boolean;
2795
+
2642
2796
  /**
2643
2797
  * Formats this container handle for logging and debugging.
2644
- * @returns The stash ID, its shared identity, how much is in it and who has it open.
2798
+ * @returns The stash ID, its level GUID, how much is in it, who has it open and whether it is locked.
2645
2799
  */
2646
2800
  toString(): string;
2647
2801
 
2648
2802
  /**
2649
- * Despawns this container on every client and forgets what was in it. Anything inside goes with it.
2803
+ * Despawns this container on every client and forgets what was in it. Anything inside goes with it. Does nothing to a container the level places.
2650
2804
  */
2651
2805
  destroy(): void;
2652
2806
 
@@ -2660,7 +2814,7 @@ declare global {
2660
2814
  static spawn(position?: Vector3 | Partial<Vector3>, rotation?: Vector3 | Quaternion, virtualWorld?: number): Stash;
2661
2815
 
2662
2816
  /**
2663
- * Lists every container the server currently has.
2817
+ * Lists every container the server currently has: every one the level places, which exist from boot in the global world, and every one a script spawned. In another virtual world a level container is built the first time anything there reaches it, so this lists only those.
2664
2818
  * @returns One handle per live container, in no particular order.
2665
2819
  */
2666
2820
  static all(): Stash[];
@@ -2673,7 +2827,24 @@ declare global {
2673
2827
  static getById(id: number): Stash | null;
2674
2828
 
2675
2829
  /**
2676
- * Despawns containers, and everything in them with them.
2830
+ * Looks a container up by its EntityGuid: one the level places, by the level's own identity for it, which survives a restart and is the same on every machine, and is found in any virtual world; or one a script spawned, in the virtual world it was spawned in, for as long as it exists.
2831
+ * @param guid The container's EntityGuid as hex, with or without an `0x` prefix, as `stash.guid` prints it.
2832
+ * @param virtualWorld Optional virtual world to look in; omitted looks in the global one, where every body starts.
2833
+ * @returns The container's handle, or null when no container has that GUID there.
2834
+ */
2835
+ static find(guid: string, virtualWorld?: number): Stash | null;
2836
+
2837
+ /**
2838
+ * Finds the container nearest a point, level or spawned. The server knows where every container the level places stands, so this answers at once, without asking a client.
2839
+ * @param position The point to measure from, usually a player's position.
2840
+ * @param maxDistance How far to look, in metres; omitted looks 5 m, about the reach the game gives a chest.
2841
+ * @param virtualWorld Optional virtual world to look in; omitted looks in the global one.
2842
+ * @returns The nearest container's handle, or null when none is that close.
2843
+ */
2844
+ static nearest(position: Vector3 | Partial<Vector3>, maxDistance?: number, virtualWorld?: number): Stash | null;
2845
+
2846
+ /**
2847
+ * Despawns containers a script spawned, and everything in them with them. The level's own stay.
2677
2848
  * @param virtualWorld Optional virtual world to clear; omitted clears every one of them.
2678
2849
  * @returns How many containers were removed.
2679
2850
  */
@@ -3174,6 +3345,26 @@ declare global {
3174
3345
  * Whether the game has it for a woman's body.
3175
3346
  */
3176
3347
  female: boolean;
3348
+
3349
+ /**
3350
+ * The in/loop/out sequence this fragment is a part of, shared by every fragment in it (`BakerMill` for `BakerMillIn`, `BakerMillLoop` and `BakerMillOut`), or empty when it is not part of one. The game does not record sequences; this is read from the fragment names, so treat it as a strong hint rather than a guarantee.
3351
+ */
3352
+ sequence: string;
3353
+
3354
+ /**
3355
+ * Which part of its `sequence` this is: the way in, the middle part the body stays in, the way out, or a variation played in place of the middle. `loop` is the middle whether or not it ends by itself -- `oneShot` says that, and `playAnimation`'s `loop` repeats it. Empty when `sequence` is.
3356
+ */
3357
+ phase: "in" | "loop" | "out" | "variation" | "";
3358
+
3359
+ /**
3360
+ * The fragment a second actor plays against this one, for the game's two-person animations (`TiedUpOut_Master` for `TiedUpOut_Slave`), or empty. Each actor plays its own fragment; read from the fragment names, like `sequence`.
3361
+ */
3362
+ partner: string;
3363
+
3364
+ /**
3365
+ * Whether, with these tags, the fragment also animates a second character the game binds to the body -- a corpse carried, a horse groomed, a smith's workpiece. `playAnimation` binds none, so only this body moves.
3366
+ */
3367
+ slaveBody: boolean;
3177
3368
  }
3178
3369
 
3179
3370
  /**
@@ -4245,9 +4436,9 @@ declare global {
4245
4436
  getRange(): number;
4246
4437
 
4247
4438
  /**
4248
- * Overrides how far one player's voice carries, for whisper and shout modes.
4439
+ * Overrides how far one player's voice carries, whichever voice tier they chose.
4249
4440
  * @param player Player whose voice carries the given distance.
4250
- * @param range Audibility radius in world units; values <= 0 return them to the server-wide range.
4441
+ * @param range Audibility radius in world units; values <= 0 return them to the radius of their voice tier.
4251
4442
  */
4252
4443
  setPlayerRange(player: Entity, range: number): void;
4253
4444
 
@@ -4258,6 +4449,34 @@ declare global {
4258
4449
  */
4259
4450
  getPlayerRange(player: Entity): number;
4260
4451
 
4452
+ /**
4453
+ * Sets how far a voice tier carries. Players switch tier themselves; whisper starts at 8, shout at 60, and normal carries the server-wide range. Set a tier to 0 to make it carry the server-wide range, which takes it away. Connected clients are told.
4454
+ * @param tier Voice tier: 0 whisper, 1 normal, 2 shout.
4455
+ * @param range Audibility radius in world units; values <= 0 make the tier carry the server-wide range.
4456
+ */
4457
+ setTierRange(tier: number, range: number): void;
4458
+
4459
+ /**
4460
+ * Reads how far a voice tier carries, with the server-wide range already resolved.
4461
+ * @param tier Voice tier: 0 whisper, 1 normal, 2 shout.
4462
+ * @returns Radius in world units.
4463
+ */
4464
+ getTierRange(tier: number): number;
4465
+
4466
+ /**
4467
+ * Puts a player on a voice tier, as if they had switched to it. Their own indicator follows, and the playerVoiceTierChange event is not raised.
4468
+ * @param player Player to move.
4469
+ * @param tier Voice tier: 0 whisper, 1 normal, 2 shout.
4470
+ */
4471
+ setPlayerTier(player: Entity, tier: number): void;
4472
+
4473
+ /**
4474
+ * Reads the voice tier a player is on. A player switching tier raises the playerVoiceTierChange event with the player and the new tier.
4475
+ * @param player Player to query.
4476
+ * @returns 0 whisper, 1 normal, 2 shout.
4477
+ */
4478
+ getPlayerTier(player: Entity): number;
4479
+
4261
4480
  /**
4262
4481
  * Server-wide mute: a muted player's voice reaches nobody.
4263
4482
  * @param player Player to mute or unmute.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kingdomsconnected/types",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "TypeScript declarations for the Kingdoms Connected scripting API, one entry per side: @kingdomsconnected/types/server and @kingdomsconnected/types/client",
5
5
  "license": "UNLICENSED",
6
6
  "keywords": [
@@ -12,17 +12,27 @@
12
12
  ],
13
13
  "exports": {
14
14
  "./server": {
15
- "types": "./server/index.d.ts"
15
+ "types": "./generated/server-api.d.ts"
16
16
  },
17
17
  "./client": {
18
- "types": "./client/index.d.ts"
18
+ "types": "./generated/client-api.d.ts"
19
19
  },
20
20
  "./package.json": "./package.json"
21
21
  },
22
+ "typesVersions": {
23
+ "*": {
24
+ "server": [
25
+ "generated/server-api.d.ts"
26
+ ],
27
+ "client": [
28
+ "generated/client-api.d.ts"
29
+ ]
30
+ }
31
+ },
22
32
  "files": [
23
33
  "shared.d.ts",
24
- "server/index.d.ts",
25
- "client/index.d.ts"
34
+ "generated/server-api.d.ts",
35
+ "generated/client-api.d.ts"
26
36
  ],
27
37
  "publishConfig": {
28
38
  "access": "public"