@kingdomsconnected/types 1.5.7 → 1.6.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.
- package/generated/client-api.d.ts +464 -15
- package/generated/server-api.d.ts +664 -82
- package/package.json +1 -1
|
@@ -80,7 +80,7 @@ declare global {
|
|
|
80
80
|
/**
|
|
81
81
|
* Dispatched when the flight starts and when it ends, on this machine only. Handler promises are not awaited.
|
|
82
82
|
*
|
|
83
|
-
* `reason` is `script` on the way in. On the way out it is `script` for a resource ending it, `mapEditor` for
|
|
83
|
+
* `reason` is `script` on the way in. On the way out it is `script` for a resource ending it, `mapEditor` for the map editor taking the one camera, `viewLost` for the level going away underneath the camera's anchor, and `sessionOver` for the session ending.
|
|
84
84
|
*/
|
|
85
85
|
noclipChanged: [active: boolean, reason: "script" | "mapEditor" | "viewLost" | "sessionOver"];
|
|
86
86
|
|
|
@@ -835,7 +835,7 @@ declare global {
|
|
|
835
835
|
readonly local: boolean;
|
|
836
836
|
|
|
837
837
|
/**
|
|
838
|
-
* The engine entity this
|
|
838
|
+
* The engine entity behind this player: the game's own player entity for the local player, otherwise the entity the puppet was spawned as, or 0 across a level load and before it exists. Not stable across a session: the engine reuses entity ids.
|
|
839
839
|
*/
|
|
840
840
|
readonly entityId: number;
|
|
841
841
|
|
|
@@ -1093,6 +1093,13 @@ declare global {
|
|
|
1093
1093
|
* @returns False once it has been removed and faded, has run its duration out, or was dropped by its resource stopping, the session ending or the level changing.
|
|
1094
1094
|
*/
|
|
1095
1095
|
isScreenEffectActive(handle: number): boolean;
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* Projects a world point through the camera this frame is drawn with, so a resource can pin its own overlay to the world.
|
|
1099
|
+
* @param point World position to project.
|
|
1100
|
+
* @returns Its screen position, or null when the point is behind the camera or there is no view to place it in.
|
|
1101
|
+
*/
|
|
1102
|
+
worldToScreen(point: Vector3): ScreenPoint | null;
|
|
1096
1103
|
};
|
|
1097
1104
|
|
|
1098
1105
|
/**
|
|
@@ -1150,6 +1157,26 @@ declare global {
|
|
|
1150
1157
|
params: ScreenEffectParam[];
|
|
1151
1158
|
}
|
|
1152
1159
|
|
|
1160
|
+
/**
|
|
1161
|
+
* Where a world point lands on screen, in the pixels Web views are placed in.
|
|
1162
|
+
*/
|
|
1163
|
+
interface ScreenPoint {
|
|
1164
|
+
/**
|
|
1165
|
+
* Pixels from the left edge of the window's client area.
|
|
1166
|
+
*/
|
|
1167
|
+
x: number;
|
|
1168
|
+
|
|
1169
|
+
/**
|
|
1170
|
+
* Pixels from the top edge of the window's client area.
|
|
1171
|
+
*/
|
|
1172
|
+
y: number;
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* Whether the point is inside the view. One past an edge keeps its coordinates with this false.
|
|
1176
|
+
*/
|
|
1177
|
+
onScreen: boolean;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1153
1180
|
/**
|
|
1154
1181
|
* The game's own sound triggers, played at this machine. A trigger is a name the game's audio data declares -- `a_o_bell_kkut_kostelni`, `c_torch_whoosh1`, `f_ge_cough_woman` -- standing for an FMOD event. The full vocabulary is `Libs/GameAudio/*.xml` in `IPL_GameData.pak`, with the gameplay-facing subset listed in `Libs/Tables/GameAudio/SkaldAtlTrigger.xml`. Nothing here is replicated: a sound everyone should hear is one the server tells every client to play. Every call returns false while the audio system is not up, which is the case before a world is loaded, and for a trigger name the audio data does not declare.
|
|
1155
1182
|
*/
|
|
@@ -1177,6 +1204,15 @@ declare global {
|
|
|
1177
1204
|
*/
|
|
1178
1205
|
playOnEntity(trigger: string, entityId: number): boolean;
|
|
1179
1206
|
|
|
1207
|
+
/**
|
|
1208
|
+
* Plays a sound file on an entity, positioned and attenuated like the game's own spoken lines and under the same volume settings. A file streamed by the server plays exactly like one the game ships. An entity takes one file per 0.1 seconds.
|
|
1209
|
+
* @param file Game-root path of an `.ogg`, with or without the extension -- `sounds/kcdc/<resource>/line` for one a server streams.
|
|
1210
|
+
* @param entityId Engine entity to play it on -- what `Player.entityId` reports.
|
|
1211
|
+
* @param purpose Which of the game's voice host events carries it: `inner`, `10`, `20`, `35`, `50`, `100`, `200` (a bark heard up to that many metres), `sfp_dialog`, `sfp_cutscene` or `sfp_music`. Defaults to `50`.
|
|
1212
|
+
* @returns True when the entity was there and took it.
|
|
1213
|
+
*/
|
|
1214
|
+
playFile(file: string, entityId: number, purpose?: string): boolean;
|
|
1215
|
+
|
|
1180
1216
|
/**
|
|
1181
1217
|
* Stops every instance of one trigger on the entity. Triggers that have already finished are not an error.
|
|
1182
1218
|
* @param trigger Name of the trigger to stop.
|
|
@@ -1218,6 +1254,18 @@ declare global {
|
|
|
1218
1254
|
hasTrigger(trigger: string): boolean;
|
|
1219
1255
|
};
|
|
1220
1256
|
|
|
1257
|
+
/**
|
|
1258
|
+
* What the server streams, seen from this machine. Models, materials, textures, sounds and particle libraries a server streams load by path like the game's own -- `objects/kcdc/<resource>/chair.cgf` works wherever a model path does -- so nothing here is needed to use them. Clips play through the server's `playAnimation("", { clip })`.
|
|
1259
|
+
*/
|
|
1260
|
+
const Assets: {
|
|
1261
|
+
/**
|
|
1262
|
+
* Whether the session's streamed assets carry a file at this path. Only new assets count; a replaced stock file is the game's own path.
|
|
1263
|
+
* @param path Path inside the game's data, as a server streams it -- `objects/kcdc/<resource>/chair.cgf`.
|
|
1264
|
+
* @returns True when a mounted stream-lane pak carries it.
|
|
1265
|
+
*/
|
|
1266
|
+
has(path: string): boolean;
|
|
1267
|
+
};
|
|
1268
|
+
|
|
1221
1269
|
/**
|
|
1222
1270
|
* The game's own particle effects, played on this machine. An effect is a name out of the game's particle libraries -- `WH_Particels.fires.candle`, `collisions.combat.sword_sword`, `cinematics.dust.dust_army_a` -- and `list` is the whole vocabulary. Nothing here is replicated: an effect everyone should see is one the server tells every client to play with `Vfx.burst`, or one the server places with `Vfx.spawn`, which the interest grid then streams to whoever is near it. Almost every effect the game ships is continuous, which means it never ends on its own -- so everything started here is given a duration, and one that is not stopped first is stopped when the session ends.
|
|
1223
1271
|
*/
|
|
@@ -1419,15 +1467,35 @@ declare global {
|
|
|
1419
1467
|
distance: number;
|
|
1420
1468
|
|
|
1421
1469
|
/**
|
|
1422
|
-
* The surface type's own name, spelled the way the game's tables spell it -- `mat_wood`, `
|
|
1470
|
+
* The surface type's own name, spelled the way the game's tables spell it in `Libs/MaterialEffects/SurfaceTypes.xml` -- `mat_wood`, `mat_rock`, `mat_soil`, `mat_water`. It says what the thing is made of, which is how footsteps and blows sound, not what it is: a plank wall is `mat_wood` as much as a trunk is, so tell a tree by `category`. Among the 74 the game defines: `mat_wood`, `mat_wood_soft`, `mat_vegetation`, `mat_bushes`, `mat_rock`, `mat_rock_unwalk`, `mat_rock_horse_ignore`, `mat_stairs_stone`, `mat_gravel`, `mat_soil`, `mat_mud`, `mat_grass`, `mat_road`, `mat_metal`, `mat_glass`, `mat_plaster`, `mat_thatch`, `mat_fabric`, `mat_flesh`. Empty only before the material tables are up.
|
|
1423
1471
|
*/
|
|
1424
1472
|
surface: string;
|
|
1425
1473
|
|
|
1426
1474
|
/**
|
|
1427
|
-
* Whether the ground itself was hit rather than anything placed on it. Nothing lies behind the terrain, so a trace stops there.
|
|
1475
|
+
* Whether the ground itself was hit rather than anything placed on it. Nothing lies behind the terrain, so a trace stops there. The same as `kind` being `terrain`.
|
|
1428
1476
|
*/
|
|
1429
1477
|
terrain: boolean;
|
|
1430
1478
|
|
|
1479
|
+
/**
|
|
1480
|
+
* What sort of thing the ray stopped on. `entity` is anything with an `entityClass` -- doors, props, NPCs, players. `vegetation` is an instance the level paints on: trees, bushes, plants, and boulders painted the same way. `brush` is a static mesh placed one by one: walls, houses, rocks and cliffs. `static` is static geometry that is neither, or whose source the engine does not record. Trees and rocks are not entities, so for them this, `model` and `category` are what say what was hit.
|
|
1481
|
+
*/
|
|
1482
|
+
kind: "terrain" | "entity" | "vegetation" | "brush" | "static";
|
|
1483
|
+
|
|
1484
|
+
/**
|
|
1485
|
+
* The mesh of a vegetation instance or a brush, as the path the game loads it from -- `objects/natural/vegetation/trees/normal_trees/quercus_robur/quercus_robur_big_a.cgf`. Null for terrain, entities and `static`. A tree or a rock has no GUID, but its `model` and `position` together are the same on every client on the same level, which is what a server keeps a felled tree or a mined rock by.
|
|
1486
|
+
*/
|
|
1487
|
+
model: string | null;
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* Which of the game's own folders of natural objects `model` comes from: `tree` for `objects/natural/vegetation/trees` -- living, dead, fallen and stumps alike, which `model` tells apart -- `bush` for its bushes, `plant` for the rest of its vegetation (grass, ferns, mushrooms, branches), and `rock` for `objects/natural/rocks` and `objects/natural/stones`. Null for anything else, man-made included.
|
|
1491
|
+
*/
|
|
1492
|
+
category: "tree" | "bush" | "plant" | "rock" | null;
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* The material drawn where the ray met it, as the path the material manager keys it by, the sub-material when the mesh has several -- a trunk's bark rather than the tree's whole material. Null for terrain and when nothing names one.
|
|
1496
|
+
*/
|
|
1497
|
+
material: string | null;
|
|
1498
|
+
|
|
1431
1499
|
/**
|
|
1432
1500
|
* The level's own identity for what was hit, as sixteen lowercase hex digits -- the same on every machine, and what `Door.find` and the other GUID lookups take. Null for terrain, for static geometry and for anything the session spawned, none of which the level names.
|
|
1433
1501
|
*/
|
|
@@ -1719,7 +1787,7 @@ declare global {
|
|
|
1719
1787
|
*
|
|
1720
1788
|
* Client-only, and nothing here is an order another machine takes. It is not invisible to the session either: in `body` mode the thing being flown is the entity this client replicates, so the other players watch the flier go. In `camera` mode the body never moves.
|
|
1721
1789
|
*
|
|
1722
|
-
* The game's controls are held for as long as the flight lasts, whichever side is driving.
|
|
1790
|
+
* The game's controls are held for as long as the flight lasts, whichever side is driving. The map editor (`MapEditor`) flies the same one camera: a flight in progress ends when the editor opens, and `enable` refuses while it is open.
|
|
1723
1791
|
*/
|
|
1724
1792
|
const NoClip: {
|
|
1725
1793
|
/**
|
|
@@ -1729,7 +1797,7 @@ declare global {
|
|
|
1729
1797
|
* `input` is whether this machine's keyboard and mouse fly the camera -- on the keys the game's own photo mode is bound to in the controls menu (forward, back, left, right, jump to rise, crouch to sink, fast movement to boost), read through the active keyboard layout so AZERTY and the like work as the game does; Alt to crawl, mouse to turn. On by default; off, drive it with `move`.
|
|
1730
1798
|
*
|
|
1731
1799
|
* `speed` is metres a second at rest, 0.05 to 400 and 12 by default. `fov` is the vertical field of view in degrees, up to 140; omitted, the view keeps the game's.
|
|
1732
|
-
* @returns `enabled` when the flight started. `alreadyActive` when one was already running -- the options are not re-applied. `noCamera` when there is no level to spawn the camera's anchor into. `cameraBusy` when
|
|
1800
|
+
* @returns `enabled` when the flight started. `alreadyActive` when one was already running -- the options are not re-applied. `noCamera` when there is no level to spawn the camera's anchor into. `cameraBusy` when the map editor holds the camera.
|
|
1733
1801
|
*/
|
|
1734
1802
|
enable(options?: { mode?: "body" | "camera"; input?: boolean; speed?: number; fov?: number }): "enabled" | "alreadyActive" | "noCamera" | "cameraBusy";
|
|
1735
1803
|
|
|
@@ -1965,6 +2033,333 @@ declare global {
|
|
|
1965
2033
|
isThirdPerson(): boolean;
|
|
1966
2034
|
};
|
|
1967
2035
|
|
|
2036
|
+
/**
|
|
2037
|
+
* A position or offset in metres. Accepts plain objects and Vector3 instances.
|
|
2038
|
+
*/
|
|
2039
|
+
interface GizmoPoint {
|
|
2040
|
+
/**
|
|
2041
|
+
* X coordinate.
|
|
2042
|
+
*/
|
|
2043
|
+
x: number;
|
|
2044
|
+
|
|
2045
|
+
/**
|
|
2046
|
+
* Y coordinate.
|
|
2047
|
+
*/
|
|
2048
|
+
y: number;
|
|
2049
|
+
|
|
2050
|
+
/**
|
|
2051
|
+
* Z coordinate.
|
|
2052
|
+
*/
|
|
2053
|
+
z: number;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
/**
|
|
2057
|
+
* Appearance and lifetime of a client debug drawing.
|
|
2058
|
+
*/
|
|
2059
|
+
interface GizmoStyle {
|
|
2060
|
+
/**
|
|
2061
|
+
* Unsigned 0xAARRGGBB color. Defaults to 0xFF6EE678 (opaque green).
|
|
2062
|
+
*/
|
|
2063
|
+
color?: number | undefined;
|
|
2064
|
+
|
|
2065
|
+
/**
|
|
2066
|
+
* Line width in pixels, 0.5 to 8. Defaults to 1.5; polygon vertical edges use 60% of this width.
|
|
2067
|
+
*/
|
|
2068
|
+
width?: number | undefined;
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* Defaults to true: scene geometry occludes the drawing. Set false to show through walls. Drawings never write scene depth.
|
|
2072
|
+
*/
|
|
2073
|
+
depthTest?: boolean | undefined;
|
|
2074
|
+
|
|
2075
|
+
/**
|
|
2076
|
+
* Unsigned 0xAARRGGBB fill color. Defaults to transparent (outline only). Supports boxes, spheres, circles, cones, cylinders, capsules, arrow heads and meshes. Throws for lines, polylines, grids, axes and polygon areas, which have no faces; fill a polygon with explicit mesh triangles.
|
|
2077
|
+
*/
|
|
2078
|
+
fillColor?: number | undefined;
|
|
2079
|
+
|
|
2080
|
+
/**
|
|
2081
|
+
* Integer lifetime from 0 to 3600000 milliseconds. Zero (default) persists until removed. Replacing the drawing restarts its lifetime.
|
|
2082
|
+
*/
|
|
2083
|
+
durationMs?: number | undefined;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
/**
|
|
2087
|
+
* Geometry from an Area.toJSON() or World Builder area export. Extra fields are ignored; this draws debug geometry and creates no trigger.
|
|
2088
|
+
*/
|
|
2089
|
+
interface GizmoArea {
|
|
2090
|
+
/**
|
|
2091
|
+
* Which area geometry to draw.
|
|
2092
|
+
*/
|
|
2093
|
+
type: 'box' | 'sphere' | 'shape';
|
|
2094
|
+
|
|
2095
|
+
/**
|
|
2096
|
+
* World origin in metres; defaults to zero.
|
|
2097
|
+
*/
|
|
2098
|
+
position?: GizmoPoint | undefined;
|
|
2099
|
+
|
|
2100
|
+
/**
|
|
2101
|
+
* Local-to-world quaternion, normalized on input; defaults to identity. Plain {x,y,z,w} objects work.
|
|
2102
|
+
*/
|
|
2103
|
+
rotation?: { x: number; y: number; z: number; w: number } | undefined;
|
|
2104
|
+
|
|
2105
|
+
/**
|
|
2106
|
+
* Box minimum in local space; defaults to {-1,-1,-1}. Each component must be less than max.
|
|
2107
|
+
*/
|
|
2108
|
+
min?: GizmoPoint | undefined;
|
|
2109
|
+
|
|
2110
|
+
/**
|
|
2111
|
+
* Box maximum in local space; defaults to {1,1,1}.
|
|
2112
|
+
*/
|
|
2113
|
+
max?: GizmoPoint | undefined;
|
|
2114
|
+
|
|
2115
|
+
/**
|
|
2116
|
+
* Required for spheres: radius in metres, greater than zero and less than 16384.
|
|
2117
|
+
*/
|
|
2118
|
+
radius?: number | undefined;
|
|
2119
|
+
|
|
2120
|
+
/**
|
|
2121
|
+
* Required for shapes: 3 to 256 local points, forming a closed polygon.
|
|
2122
|
+
*/
|
|
2123
|
+
points?: GizmoPoint[] | undefined;
|
|
2124
|
+
|
|
2125
|
+
/**
|
|
2126
|
+
* Shape height above its lowest transformed point, 0 to less than 16384 metres. Zero (default) draws one ring at the points' own heights.
|
|
2127
|
+
*/
|
|
2128
|
+
height?: number | undefined;
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
/**
|
|
2132
|
+
* Client debug line geometry.
|
|
2133
|
+
*/
|
|
2134
|
+
interface GizmoLine {
|
|
2135
|
+
/**
|
|
2136
|
+
* Primitive kind.
|
|
2137
|
+
*/
|
|
2138
|
+
type: 'line';
|
|
2139
|
+
|
|
2140
|
+
/**
|
|
2141
|
+
* World start.
|
|
2142
|
+
*/
|
|
2143
|
+
from: GizmoPoint;
|
|
2144
|
+
|
|
2145
|
+
/**
|
|
2146
|
+
* World end.
|
|
2147
|
+
*/
|
|
2148
|
+
to: GizmoPoint;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
/**
|
|
2152
|
+
* Client debug arrow geometry.
|
|
2153
|
+
*/
|
|
2154
|
+
interface GizmoArrow {
|
|
2155
|
+
/**
|
|
2156
|
+
* Primitive kind.
|
|
2157
|
+
*/
|
|
2158
|
+
type: 'arrow';
|
|
2159
|
+
|
|
2160
|
+
/**
|
|
2161
|
+
* World start.
|
|
2162
|
+
*/
|
|
2163
|
+
from: GizmoPoint;
|
|
2164
|
+
|
|
2165
|
+
/**
|
|
2166
|
+
* World tip.
|
|
2167
|
+
*/
|
|
2168
|
+
to: GizmoPoint;
|
|
2169
|
+
|
|
2170
|
+
/**
|
|
2171
|
+
* Head length in metres, greater than zero and no longer than the arrow. Defaults to the smaller of 0.5 and a quarter of the arrow length.
|
|
2172
|
+
*/
|
|
2173
|
+
headLength?: number | undefined;
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
/**
|
|
2177
|
+
* Client debug capsule/cone/cylinder geometry.
|
|
2178
|
+
*/
|
|
2179
|
+
interface GizmoRoundVolume {
|
|
2180
|
+
/**
|
|
2181
|
+
* Primitive kind.
|
|
2182
|
+
*/
|
|
2183
|
+
type: 'capsule' | 'cone' | 'cylinder';
|
|
2184
|
+
|
|
2185
|
+
/**
|
|
2186
|
+
* Capsule lower hemisphere center, or cone/cylinder base center.
|
|
2187
|
+
*/
|
|
2188
|
+
from: GizmoPoint;
|
|
2189
|
+
|
|
2190
|
+
/**
|
|
2191
|
+
* Capsule upper hemisphere center, cone tip or cylinder top center. Capsule endpoints may coincide for a sphere.
|
|
2192
|
+
*/
|
|
2193
|
+
to: GizmoPoint;
|
|
2194
|
+
|
|
2195
|
+
/**
|
|
2196
|
+
* Radius in metres, 0.001 to 16384.
|
|
2197
|
+
*/
|
|
2198
|
+
radius: number;
|
|
2199
|
+
|
|
2200
|
+
/**
|
|
2201
|
+
* Integer radial segments, 8 to 64; default 24.
|
|
2202
|
+
*/
|
|
2203
|
+
segments?: number | undefined;
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
/**
|
|
2207
|
+
* Client debug circle geometry.
|
|
2208
|
+
*/
|
|
2209
|
+
interface GizmoCircle {
|
|
2210
|
+
/**
|
|
2211
|
+
* Primitive kind.
|
|
2212
|
+
*/
|
|
2213
|
+
type: 'circle';
|
|
2214
|
+
|
|
2215
|
+
/**
|
|
2216
|
+
* World center.
|
|
2217
|
+
*/
|
|
2218
|
+
position: GizmoPoint;
|
|
2219
|
+
|
|
2220
|
+
/**
|
|
2221
|
+
* Non-zero plane normal; default {x:0,y:0,z:1}.
|
|
2222
|
+
*/
|
|
2223
|
+
normal?: GizmoPoint | undefined;
|
|
2224
|
+
|
|
2225
|
+
/**
|
|
2226
|
+
* Radius in metres, 0.001 to 16384.
|
|
2227
|
+
*/
|
|
2228
|
+
radius: number;
|
|
2229
|
+
|
|
2230
|
+
/**
|
|
2231
|
+
* Integer radial segments, 8 to 64; default 24.
|
|
2232
|
+
*/
|
|
2233
|
+
segments?: number | undefined;
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
* Client debug grid geometry.
|
|
2238
|
+
*/
|
|
2239
|
+
interface GizmoGrid {
|
|
2240
|
+
/**
|
|
2241
|
+
* Primitive kind.
|
|
2242
|
+
*/
|
|
2243
|
+
type: 'grid';
|
|
2244
|
+
|
|
2245
|
+
/**
|
|
2246
|
+
* World center.
|
|
2247
|
+
*/
|
|
2248
|
+
position: GizmoPoint;
|
|
2249
|
+
|
|
2250
|
+
/**
|
|
2251
|
+
* Non-zero plane normal; default {x:0,y:0,z:1}.
|
|
2252
|
+
*/
|
|
2253
|
+
normal?: GizmoPoint | undefined;
|
|
2254
|
+
|
|
2255
|
+
/**
|
|
2256
|
+
* Square side length in metres, 0.001 to 16384; default 10.
|
|
2257
|
+
*/
|
|
2258
|
+
size?: number | undefined;
|
|
2259
|
+
|
|
2260
|
+
/**
|
|
2261
|
+
* Integer subdivisions on each side, 1 to 64; default 10.
|
|
2262
|
+
*/
|
|
2263
|
+
divisions?: number | undefined;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
/**
|
|
2267
|
+
* Client debug axes geometry.
|
|
2268
|
+
*/
|
|
2269
|
+
interface GizmoAxes {
|
|
2270
|
+
/**
|
|
2271
|
+
* Primitive kind.
|
|
2272
|
+
*/
|
|
2273
|
+
type: 'axes';
|
|
2274
|
+
|
|
2275
|
+
/**
|
|
2276
|
+
* World origin.
|
|
2277
|
+
*/
|
|
2278
|
+
position: GizmoPoint;
|
|
2279
|
+
|
|
2280
|
+
/**
|
|
2281
|
+
* Local-to-world quaternion, normalized on input; default identity.
|
|
2282
|
+
*/
|
|
2283
|
+
rotation?: { x: number; y: number; z: number; w: number } | undefined;
|
|
2284
|
+
|
|
2285
|
+
/**
|
|
2286
|
+
* Axis length in metres, 0.001 to 16384; default 1. X is red, Y green and Z blue; these fixed colors override style.color.
|
|
2287
|
+
*/
|
|
2288
|
+
size?: number | undefined;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
/**
|
|
2292
|
+
* Client debug polyline geometry.
|
|
2293
|
+
*/
|
|
2294
|
+
interface GizmoPolyline {
|
|
2295
|
+
/**
|
|
2296
|
+
* Primitive kind.
|
|
2297
|
+
*/
|
|
2298
|
+
type: 'polyline';
|
|
2299
|
+
|
|
2300
|
+
/**
|
|
2301
|
+
* 2 to 256 world positions.
|
|
2302
|
+
*/
|
|
2303
|
+
points: GizmoPoint[];
|
|
2304
|
+
|
|
2305
|
+
/**
|
|
2306
|
+
* Join last to first; default false.
|
|
2307
|
+
*/
|
|
2308
|
+
closed?: boolean | undefined;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
/**
|
|
2312
|
+
* Client debug mesh geometry.
|
|
2313
|
+
*/
|
|
2314
|
+
interface GizmoMesh {
|
|
2315
|
+
/**
|
|
2316
|
+
* Primitive kind.
|
|
2317
|
+
*/
|
|
2318
|
+
type: 'mesh';
|
|
2319
|
+
|
|
2320
|
+
/**
|
|
2321
|
+
* 3 to 1024 world positions.
|
|
2322
|
+
*/
|
|
2323
|
+
points: GizmoPoint[];
|
|
2324
|
+
|
|
2325
|
+
/**
|
|
2326
|
+
* 3 to 3072 integer vertex indices in triangle triples, each from 0 to points.length - 1. Both triangle sides render.
|
|
2327
|
+
*/
|
|
2328
|
+
indices: number[];
|
|
2329
|
+
|
|
2330
|
+
/**
|
|
2331
|
+
* Draw triangle edges with style.color and width; default true. Set fillColor to draw faces.
|
|
2332
|
+
*/
|
|
2333
|
+
wireframe?: boolean | undefined;
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
/**
|
|
2337
|
+
* Resource-owned native debug geometry visible only on this client, without opening World Builder. Scene depth testing is on by default; depthTest: false opts out. Stop/error, disconnect and moving to another level clear drawings; reloading a save of the same level keeps them. No replication or input capture.
|
|
2338
|
+
*/
|
|
2339
|
+
const Gizmos: {
|
|
2340
|
+
/**
|
|
2341
|
+
* Creates or replaces a named primitive owned by this resource. Finite input coordinates within +/-16384 metres. IDs are 1 to 128 UTF-8 bytes. Limit: 128 IDs per resource, 16384 geometry units across resources (one per line, three per triangle). Throws on invalid input or budget overflow and preserves the previous drawing. Copies geometry and reapplies style defaults; use setTransform to move it.
|
|
2342
|
+
*/
|
|
2343
|
+
set(id: string, primitive: GizmoArea | GizmoLine | GizmoArrow | GizmoRoundVolume | GizmoCircle | GizmoGrid | GizmoAxes | GizmoPolyline | GizmoMesh, style?: GizmoStyle): void;
|
|
2344
|
+
|
|
2345
|
+
/**
|
|
2346
|
+
* Moves this resource's named drawing without rebuilding it: every authored point p is drawn at position + rotation * p. Author the geometry around the origin to move it as a whole. The rotation is normalized and defaults to identity. set() resets the transform to identity.
|
|
2347
|
+
* @returns True if the drawing exists; false if this resource has no drawing with that ID.
|
|
2348
|
+
*/
|
|
2349
|
+
setTransform(id: string, position: GizmoPoint, rotation?: { x: number; y: number; z: number; w: number }): boolean;
|
|
2350
|
+
|
|
2351
|
+
/**
|
|
2352
|
+
* Removes this resource's named drawing. Throws for an invalid ID or unknown resource.
|
|
2353
|
+
* @returns True if removed; false if this resource has no drawing with that ID.
|
|
2354
|
+
*/
|
|
2355
|
+
remove(id: string): boolean;
|
|
2356
|
+
|
|
2357
|
+
/**
|
|
2358
|
+
* Removes all drawings owned by this resource. Other resources are unaffected. Throws if the caller's resource cannot be identified.
|
|
2359
|
+
*/
|
|
2360
|
+
clear(): void;
|
|
2361
|
+
};
|
|
2362
|
+
|
|
1968
2363
|
/**
|
|
1969
2364
|
* The box a ghost occupies, in world space.
|
|
1970
2365
|
*/
|
|
@@ -2168,6 +2563,37 @@ declare global {
|
|
|
2168
2563
|
on(event: "move" | "confirm" | "rejected" | "cancel" | "end", handler: PlacementHandler<PlacementPose>): Unsubscribe;
|
|
2169
2564
|
};
|
|
2170
2565
|
|
|
2566
|
+
/**
|
|
2567
|
+
* The world builder: a free camera, the game's mesh catalog as an asset library, a placement brush, a gizmo that moves anything, and maps saved to and loaded from files.
|
|
2568
|
+
*
|
|
2569
|
+
* F7 or a client resource opens it. Multiplayer requires the server to grant this player access with `player.setWorldBuilderEnabled(true)`; single-player and offline editing are always allowed. While it is open it holds the one free camera, so a `NoClip` flight in progress ends and `NoClip.enable` refuses. The player can still close it from its own window.
|
|
2570
|
+
*/
|
|
2571
|
+
const MapEditor: {
|
|
2572
|
+
/**
|
|
2573
|
+
* Opens the editor.
|
|
2574
|
+
* @returns `opened` when it opened. `alreadyOpen` when it was open already. `disabled` when this multiplayer connection has not been granted access.
|
|
2575
|
+
*/
|
|
2576
|
+
open(): "opened" | "alreadyOpen" | "disabled";
|
|
2577
|
+
|
|
2578
|
+
/**
|
|
2579
|
+
* Closes the editor and hands the camera back. Doing nothing when it is closed is not an error.
|
|
2580
|
+
* @returns Nothing.
|
|
2581
|
+
*/
|
|
2582
|
+
close(): void;
|
|
2583
|
+
|
|
2584
|
+
/**
|
|
2585
|
+
* Whether the editor is open at this client.
|
|
2586
|
+
* @returns True while it is open.
|
|
2587
|
+
*/
|
|
2588
|
+
isOpen(): boolean;
|
|
2589
|
+
|
|
2590
|
+
/**
|
|
2591
|
+
* Whether this client may open World Builder.
|
|
2592
|
+
* @returns True offline or when the server has granted this player access.
|
|
2593
|
+
*/
|
|
2594
|
+
isEnabled(): boolean;
|
|
2595
|
+
};
|
|
2596
|
+
|
|
2171
2597
|
/**
|
|
2172
2598
|
* A screen composed inside one of the game's own Scaleform movies.
|
|
2173
2599
|
*/
|
|
@@ -2560,6 +2986,20 @@ declare global {
|
|
|
2560
2986
|
* The game's own Scaleform UI, opened from script. This is the second way to draw a UI at this client, beside `Web`: a web view is a browser and lays out anything, a native screen is composed out of the game's own movies, sits inside the game's own layer stack and is navigable with a controller.
|
|
2561
2987
|
*/
|
|
2562
2988
|
const NativeUI: {
|
|
2989
|
+
/**
|
|
2990
|
+
* Prevents a vanilla menu from opening or being selected through native navigation. An already-open disabled menu closes on the next client tick. Requests are idempotent and resource-owned: a menu stays disabled while any resource disables it. Restrictions clear when the resource stops or the session ends. Key bindings are unchanged. Tab labels remain in the native screen. The custom character creator can still use the player stage.
|
|
2991
|
+
* @param menu The vanilla menu, including its detail pages.
|
|
2992
|
+
* @param enabled False prevents opening the menu; true releases this resource's restriction. All menus are enabled by default.
|
|
2993
|
+
*/
|
|
2994
|
+
setMenuEnabled(menu: "inventory" | "player" | "map" | "codex" | "journal" | "crafting", enabled: boolean): void;
|
|
2995
|
+
|
|
2996
|
+
/**
|
|
2997
|
+
* Whether every resource permits this vanilla menu. Native gameplay rules may still prevent it from opening. Throws for unknown menu names.
|
|
2998
|
+
* @param menu The vanilla menu to query.
|
|
2999
|
+
* @returns True when no resource disables the menu.
|
|
3000
|
+
*/
|
|
3001
|
+
isMenuEnabled(menu: "inventory" | "player" | "map" | "codex" | "journal" | "crafting"): boolean;
|
|
3002
|
+
|
|
2563
3003
|
/**
|
|
2564
3004
|
* Opens a screen. It is composed a few frames later, when its movie reports ready -- listen for `ready` rather than drawing into it straight away.
|
|
2565
3005
|
* @param options `library` names which of the game's movies the screen may attach exported sprites from, empty for the default. `movie` is a path inside this resource to a movie it ships, which opens a screen in that instead. `assets` are further files that movie loads, and `layer` is where it sits in the game's own stack.
|
|
@@ -2722,32 +3162,32 @@ declare global {
|
|
|
2722
3162
|
/**
|
|
2723
3163
|
* The object in the player's hands: a red-covered book (the default), a plain-covered one, or a folded letter.
|
|
2724
3164
|
*/
|
|
2725
|
-
style
|
|
3165
|
+
style?: "book" | "plainBook" | "letter" | undefined;
|
|
2726
3166
|
|
|
2727
3167
|
/**
|
|
2728
3168
|
* The layout the movie uses, by `document_class` id: 1 book (the default), 2 recipe, 3 skill book, 4 map, 5 letter (the default for `letter`), 6 plan.
|
|
2729
3169
|
*/
|
|
2730
|
-
type
|
|
3170
|
+
type?: number | undefined;
|
|
2731
3171
|
|
|
2732
3172
|
/**
|
|
2733
3173
|
* How ornate the pages are, 1 plain to 7 embellished. Defaults to 1.
|
|
2734
3174
|
*/
|
|
2735
|
-
visual
|
|
3175
|
+
visual?: number | undefined;
|
|
2736
3176
|
|
|
2737
3177
|
/**
|
|
2738
3178
|
* How much of the text can be read, 0 to 1; values outside are clamped. Defaults to 1, fully legible. Below 1 the movie swaps letters for look-alike glyphs, the same effect a vanilla book shows a player with low reading skill. It works in tenths: each step brings roughly another tenth of the character classes back, so 0.31 and 0.39 look the same. The substitution is deterministic -- the same text at the same level always reads the same way -- and markup is never touched.
|
|
2739
3179
|
*/
|
|
2740
|
-
legibility
|
|
3180
|
+
legibility?: number | undefined;
|
|
2741
3181
|
|
|
2742
3182
|
/**
|
|
2743
3183
|
* A picture `Book.image` returned, replacing the carrier's own diffuse texture: the paper and the cover together, which the model maps from one atlas. Paint it over the vanilla atlas to keep the UV layout -- `Objects/manmade/task_specific_props/read_and_write/books/book_alchemy_diff.dds` for the two book styles, `.../scrolls/scroll_diff.dds` for `letter`. The material's diffuse colour multiplies it: `book` darkens it to about 78% and `letter` to about 72%, while `plainBook` shows it as painted. It applies to this book's own copy of the material only, and goes with the book.
|
|
2744
3184
|
*/
|
|
2745
|
-
texture
|
|
3185
|
+
texture?: string | undefined;
|
|
2746
3186
|
|
|
2747
3187
|
/**
|
|
2748
3188
|
* Pictures for the skill-book and map layouts. Inline pictures go in the page text as `<img>` instead.
|
|
2749
3189
|
*/
|
|
2750
|
-
images
|
|
3190
|
+
images?: BookPageImage[] | undefined;
|
|
2751
3191
|
}
|
|
2752
3192
|
|
|
2753
3193
|
/**
|
|
@@ -2807,17 +3247,17 @@ declare global {
|
|
|
2807
3247
|
/**
|
|
2808
3248
|
* The look the stage starts on. Left out, it starts on the first gender offered with every part left to the figure -- the player's own look on the man, the game's default on the woman.
|
|
2809
3249
|
*/
|
|
2810
|
-
appearance
|
|
3250
|
+
appearance?: Appearance | undefined;
|
|
2811
3251
|
|
|
2812
3252
|
/**
|
|
2813
3253
|
* Which bodies the player may choose between; `both` (the default) lets them switch.
|
|
2814
3254
|
*/
|
|
2815
|
-
genders
|
|
3255
|
+
genders?: "male" | "female" | "both" | undefined;
|
|
2816
3256
|
|
|
2817
3257
|
/**
|
|
2818
3258
|
* The panel's heading, at most 64 bytes. Defaults to `Character`.
|
|
2819
3259
|
*/
|
|
2820
|
-
title
|
|
3260
|
+
title?: string | undefined;
|
|
2821
3261
|
}
|
|
2822
3262
|
|
|
2823
3263
|
/**
|
|
@@ -4204,6 +4644,13 @@ declare global {
|
|
|
4204
4644
|
* Client-only, resource-owned physical key bindings exposed as the global Key.
|
|
4205
4645
|
*/
|
|
4206
4646
|
const Key: {
|
|
4647
|
+
/**
|
|
4648
|
+
* Returns the current layout's label for a physical key, even while UI owns input. Query again when refreshing prompts. Throws for unknown keys or non-string arguments.
|
|
4649
|
+
* @param key Case-insensitive physical key name, using the same names as bind.
|
|
4650
|
+
* @returns Uppercase printable text, or an English name such as Enter or Mouse 1. Falls back to the uppercase canonical key name when translation is unavailable.
|
|
4651
|
+
*/
|
|
4652
|
+
getLabel(key: string): string;
|
|
4653
|
+
|
|
4207
4654
|
/**
|
|
4208
4655
|
* Binds a resource-owned handler that fires while the game has foreground input and no UI is capturing it.
|
|
4209
4656
|
* @param key Case-insensitive supported keyboard or mouse key name.
|
|
@@ -4687,6 +5134,8 @@ declare global {
|
|
|
4687
5134
|
* Arbitrary key/value state attached to one replicated entity, reached as `entity.state`. Keys set on the server replicate to every client that can currently see the entity.
|
|
4688
5135
|
*/
|
|
4689
5136
|
class StateBag {
|
|
5137
|
+
private constructor();
|
|
5138
|
+
|
|
4690
5139
|
/**
|
|
4691
5140
|
* Reads one key from this entity's state.
|
|
4692
5141
|
* @param key Key to read.
|