xray16 1.6.0 → 1.6.2

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.
Files changed (53) hide show
  1. package/package.json +12 -6
  2. package/xray16.d.ts +30852 -0
  3. package/types/index.d.ts +0 -55
  4. package/types/internal.d.ts +0 -6
  5. package/types/xr_ai/xr_action.d.ts +0 -1803
  6. package/types/xr_ai/xr_alife.d.ts +0 -1872
  7. package/types/xr_ai/xr_enemy_evaluation.d.ts +0 -134
  8. package/types/xr_ai/xr_goap.d.ts +0 -1118
  9. package/types/xr_ai/xr_graph.d.ts +0 -135
  10. package/types/xr_ai/xr_memory.d.ts +0 -384
  11. package/types/xr_lib/xr_animation.d.ts +0 -252
  12. package/types/xr_lib/xr_bitwise.d.ts +0 -44
  13. package/types/xr_lib/xr_color.d.ts +0 -142
  14. package/types/xr_lib/xr_debug.d.ts +0 -183
  15. package/types/xr_lib/xr_dialog.d.ts +0 -132
  16. package/types/xr_lib/xr_flags.d.ts +0 -592
  17. package/types/xr_lib/xr_fs.d.ts +0 -617
  18. package/types/xr_lib/xr_game.d.ts +0 -362
  19. package/types/xr_lib/xr_hit.d.ts +0 -127
  20. package/types/xr_lib/xr_ini.d.ts +0 -475
  21. package/types/xr_lib/xr_level.d.ts +0 -797
  22. package/types/xr_lib/xr_luabind.d.ts +0 -90
  23. package/types/xr_lib/xr_map.d.ts +0 -194
  24. package/types/xr_lib/xr_math.d.ts +0 -871
  25. package/types/xr_lib/xr_multiplayer.d.ts +0 -1081
  26. package/types/xr_lib/xr_profile.d.ts +0 -272
  27. package/types/xr_lib/xr_properties.d.ts +0 -612
  28. package/types/xr_lib/xr_relation.d.ts +0 -231
  29. package/types/xr_lib/xr_render.d.ts +0 -167
  30. package/types/xr_lib/xr_save.d.ts +0 -835
  31. package/types/xr_lib/xr_sound.d.ts +0 -517
  32. package/types/xr_lib/xr_stats.ts +0 -51
  33. package/types/xr_lib/xr_task.d.ts +0 -390
  34. package/types/xr_lib/xr_time.d.ts +0 -177
  35. package/types/xr_lib/xr_type.d.ts +0 -70
  36. package/types/xr_object/client/xr_anomaly.d.ts +0 -70
  37. package/types/xr_object/client/xr_artefact.d.ts +0 -153
  38. package/types/xr_object/client/xr_client_object.d.ts +0 -207
  39. package/types/xr_object/client/xr_creature.d.ts +0 -243
  40. package/types/xr_object/client/xr_item.d.ts +0 -370
  41. package/types/xr_object/client/xr_level.d.ts +0 -755
  42. package/types/xr_object/client/xr_physic.d.ts +0 -644
  43. package/types/xr_object/client/xr_zone.d.ts +0 -85
  44. package/types/xr_object/script/xr_script_interface.d.ts +0 -1142
  45. package/types/xr_object/script/xr_script_object.d.ts +0 -5702
  46. package/types/xr_object/script/xr_script_trade.d.ts +0 -51
  47. package/types/xr_object/server/xr_server_object.d.ts +0 -1488
  48. package/types/xr_ui/xr_ui_asset.d.ts +0 -364
  49. package/types/xr_ui/xr_ui_core.d.ts +0 -426
  50. package/types/xr_ui/xr_ui_event.d.ts +0 -1449
  51. package/types/xr_ui/xr_ui_interface.d.ts +0 -2449
  52. package/types/xr_ui/xr_ui_menu.d.ts +0 -401
  53. package/types/xrf_plugin.d.ts +0 -111
@@ -1,797 +0,0 @@
1
- import type { Nillable, Nullable } from "../internal";
2
-
3
- declare module "xray16" {
4
- /**
5
- * Global helpers for the currently loaded level.
6
- *
7
- * This namespace covers object lookup, time/weather control, navigation queries, map spots, and effectors.
8
- *
9
- * @source namespace level
10
- * @group xr_level
11
- */
12
- export interface IXR_level {
13
- /**
14
- * Register a conditional level callback.
15
- *
16
- * @remarks
17
- * The physics commander polls this callback pair. Remove it with the same condition and action callbacks when the
18
- * owner no longer needs it.
19
- *
20
- * @param condition - Callback polled by the engine.
21
- * @param action - Callback called when the condition is satisfied.
22
- */
23
- add_call(this: void, condition: (this: void) => boolean, action: (this: void) => boolean): void;
24
-
25
- /**
26
- * Register a conditional level callback owned by an object.
27
- *
28
- * @remarks
29
- * The owner is used only for callback lookup and bulk removal. Keep the object alive while the callback can run.
30
- *
31
- * @param object - Owner object used for later removal.
32
- * @param condition - Callback polled by the engine.
33
- * @param action - Callback called when the condition is satisfied.
34
- */
35
- add_call(this: void, object: object, condition: (this: void) => boolean, action: (this: void) => boolean): void;
36
-
37
- /**
38
- * Register named object methods as a conditional level callback.
39
- *
40
- * @remarks
41
- * This overload registers a unique callback pair for the object and method names.
42
- *
43
- * @param object - Owner object used for callback lookup and removal.
44
- * @param condition - Method name used as condition callback.
45
- * @param action - Method name called when the condition is satisfied.
46
- */
47
- add_call(this: void, object: object, condition: string, action: string): void;
48
-
49
- /**
50
- * Start a camera effector.
51
- *
52
- * @remarks
53
- * Requires an actor. The binding adds the effector to `Actor().Cameras()`.
54
- *
55
- * @param effect - Camera effector animation file.
56
- * @param id - Effector id used for replacement and removal.
57
- * @param is_cyclic - Whether the effector loops.
58
- * @param callback - Lua callback name called when the effector finishes.
59
- * @returns Effector animation length.
60
- */
61
- add_cam_effector(this: void, effect: string, id: i32, is_cyclic: boolean, callback: string): f32;
62
-
63
- /**
64
- * Start a camera effector with custom field of view.
65
- *
66
- * @since OpenXRay 2019-05-07, 2d1b946a, PR #382
67
- *
68
- * @remarks
69
- * Requires an actor. The binding adds the effector to `Actor().Cameras()`.
70
- *
71
- * @param effect - Camera effector animation file.
72
- * @param id - Effector id used for replacement and removal.
73
- * @param is_cyclic - Whether the effector loops.
74
- * @param callback - Lua callback name called when the effector finishes.
75
- * @param camera_fov - Optional field of view for the effector.
76
- * @returns Effector animation length.
77
- */
78
- add_cam_effector2(this: void, effect: string, id: i32, is_cyclic: boolean, callback: string, camera_fov?: f32): f32;
79
-
80
- /**
81
- * Start a named complex effector.
82
- *
83
- * @remarks
84
- * Requires an actor. The effector is attached to the current actor object.
85
- *
86
- * @param section - Effector section name.
87
- * @param id - Effector id used for replacement and removal.
88
- */
89
- add_complex_effector(this: void, section: string, id: i32): void;
90
-
91
- /**
92
- * Add a dialog window to the render list.
93
- *
94
- * @param window - Dialog window to render.
95
- */
96
- add_dialog_to_render(this: void, window: CUIDialogWnd): void;
97
-
98
- /**
99
- * Start a post-process effector.
100
- *
101
- * @remarks
102
- * Requires an actor. The effector is attached to the actor camera manager.
103
- *
104
- * @param file_name - Post-process effector file.
105
- * @param id - Effector id used for replacement and removal.
106
- * @param is_cyclic - Whether the effector loops.
107
- */
108
- add_pp_effector(this: void, file_name: string, id: i32, is_cyclic: boolean): void;
109
-
110
- /**
111
- * Move game time forward.
112
- *
113
- * @remarks
114
- * Works only on a single-player server with ALife available. Otherwise the binding returns without changing time.
115
- *
116
- * @param days - Days to add.
117
- * @param hours - Hours to add.
118
- * @param minutes - Minutes to add.
119
- */
120
- change_game_time(this: void, days: u32, hours: u32, minutes: u32): void;
121
-
122
- /**
123
- * Validate a game object pointer in the engine.
124
- *
125
- * @remarks
126
- * Exported only in debug builds.
127
- *
128
- * @param object - Object to check.
129
- */
130
- check_object(this: void, object: game_object): void;
131
-
132
- /**
133
- * Get the level client spawn manager.
134
- *
135
- * @returns Client spawn manager.
136
- */
137
- client_spawn_manager(this: void): client_spawn_manager;
138
-
139
- /**
140
- * Get actor object used by debug helpers.
141
- *
142
- * @remarks
143
- * Exported only in debug builds.
144
- *
145
- * @returns Actor game object.
146
- */
147
- debug_actor(this: void): game_object;
148
-
149
- /**
150
- * Find an object by debug name.
151
- *
152
- * @remarks
153
- * Exported only in debug builds.
154
- *
155
- * @param name - Object name.
156
- * @returns Matching game object.
157
- */
158
- debug_object(this: void, name: string): game_object;
159
-
160
- /**
161
- * Disable player input.
162
- *
163
- * @remarks
164
- * Does nothing while the actor exists and permanent god mode is enabled.
165
- */
166
- disable_input(this: void): void;
167
-
168
- /**
169
- * Enable player input.
170
- */
171
- enable_input(this: void): void;
172
-
173
- /**
174
- * Get the active environment object.
175
- *
176
- * @returns Engine environment object.
177
- */
178
- environment(this: void): unknown /* XR_CEnvironment */;
179
-
180
- /**
181
- * Get current game state id.
182
- *
183
- * @returns Game id bitmask.
184
- */
185
- game_id(this: void): TXR_EGameID;
186
-
187
- /**
188
- * Get active camera id.
189
- *
190
- * @since OpenXRay 2015-07-07, 6e703b4c
191
- *
192
- * @remarks
193
- * Returns `255` when the current view entity is not an actor.
194
- *
195
- * @returns Camera id.
196
- */
197
- get_active_cam(this: void): u8;
198
-
199
- /**
200
- * Get the level bounding box.
201
- *
202
- * @returns Level bounds.
203
- */
204
- get_bounding_volume(this: void): Fbox;
205
-
206
- /**
207
- * Get active single-player difficulty.
208
- *
209
- * @returns Difficulty id.
210
- */
211
- get_game_difficulty(this: void): TXR_game_difficulty;
212
-
213
- /**
214
- * Get sound volume.
215
- *
216
- * @returns Sound volume.
217
- */
218
- get_snd_volume(this: void): f32;
219
-
220
- /**
221
- * Get distance to the object or surface under the crosshair.
222
- *
223
- * @since OpenXRay 2014-12-27, c82669625
224
- *
225
- * @returns Target distance.
226
- */
227
- get_target_dist(this: void): f32;
228
-
229
- /**
230
- * Get targeted model element under the crosshair.
231
- *
232
- * @since OpenXRay 2015-06-03, 7213550c
233
- *
234
- * @remarks
235
- * Returns `0` when the current ray query has no model element.
236
- *
237
- * @returns Target element id.
238
- */
239
- get_target_element(this: void): u32;
240
-
241
- /**
242
- * Get the object under the crosshair.
243
- *
244
- * @since OpenXRay 2014-12-27, c82669625
245
- *
246
- * @returns Target object, or `null` when nothing is targeted.
247
- */
248
- get_target_obj(this: void): Nullable<game_object>;
249
-
250
- /**
251
- * Get current game day count.
252
- *
253
- * @returns Current day count.
254
- */
255
- get_time_days(this: void): u32;
256
-
257
- /**
258
- * Get game time speed multiplier.
259
- *
260
- * @returns Time factor.
261
- */
262
- get_time_factor(this: void): f32;
263
-
264
- /**
265
- * Get current game hour.
266
- *
267
- * @returns Hour of day.
268
- */
269
- get_time_hours(this: void): u32;
270
-
271
- /**
272
- * Get current game minute.
273
- *
274
- * @returns Minute of hour.
275
- */
276
- get_time_minutes(this: void): u32;
277
-
278
- /**
279
- * Get current weather cycle name.
280
- *
281
- * @returns Weather name.
282
- */
283
- get_weather(this: void): string;
284
-
285
- /**
286
- * Get active weather effect time.
287
- *
288
- * @returns Weather effect time.
289
- */
290
- get_wfx_time(this: void): f32;
291
-
292
- /**
293
- * Hide HUD indicators.
294
- *
295
- * @remarks
296
- * Also enables the runtime god-mode flag used while HUD indicators are hidden.
297
- */
298
- hide_indicators(this: void): void;
299
-
300
- /**
301
- * Hide HUD indicators if the HUD is available.
302
- *
303
- * @remarks
304
- * Also enables the runtime god-mode flag used while HUD indicators are hidden.
305
- */
306
- hide_indicators_safe(this: void): void;
307
-
308
- /**
309
- * Sample high cover from a level vertex in a direction.
310
- *
311
- * @param vertex_id - Level vertex id.
312
- * @param direction - Direction to sample.
313
- * @returns Cover value.
314
- */
315
- high_cover_in_direction(this: void, vertex_id: u32, direction: vector): f32;
316
-
317
- /**
318
- * Check whether a weather effect is playing.
319
- *
320
- * @returns Whether a weather effect is active.
321
- */
322
- is_wfx_playing(this: void): boolean;
323
-
324
- /**
325
- * Iterate objects currently online on the level.
326
- *
327
- * @since OpenXRay 2019-04-28, 13c5c022
328
- *
329
- * @param cb - Callback called for each online object.
330
- */
331
- iterate_online_objects(this: void, cb: (this: void, object: game_object) => void | boolean): void;
332
-
333
- /**
334
- * Iterate sounds from a sound collection.
335
- *
336
- * @remarks
337
- * `section` may contain a comma-separated list of base names. The callback receives each existing sound name found
338
- * in `$game_sounds$`, including numbered variants from `0` up to `max_count - 1`.
339
- *
340
- * @param section - Sound collection section.
341
- * @param max_count - Numbered suffixes to probe for each base name.
342
- * @param cb - Callback called with each sound name.
343
- */
344
- iterate_sounds(this: void, section: string, max_count: u32, cb: (this: void, name: string) => void): void;
345
-
346
- /**
347
- * Iterate sounds from a sound collection with an owner object.
348
- *
349
- * @remarks
350
- * `section` may contain a comma-separated list of base names. The callback receives each existing sound name found
351
- * in `$game_sounds$`, including numbered variants from `0` up to `max_count - 1`.
352
- *
353
- * @param section - Sound collection section.
354
- * @param max_count - Numbered suffixes to probe for each base name.
355
- * @param object - Owner object.
356
- * @param cb - Callback called with each sound name.
357
- */
358
- iterate_sounds(
359
- this: void,
360
- section: string,
361
- max_count: u32,
362
- object: object,
363
- cb: (this: void, name: string) => void
364
- ): void;
365
-
366
- /**
367
- * Sample low cover from a level vertex in a direction.
368
- *
369
- * @param vertex_id - Level vertex id.
370
- * @param direction - Direction to sample.
371
- * @returns Cover value.
372
- */
373
- low_cover_in_direction(this: void, vertex_id: u32, direction: vector): f32;
374
-
375
- /**
376
- * Get the main UI input receiver.
377
- *
378
- * @returns Active dialog window.
379
- */
380
- main_input_receiver(this: void): CUIDialogWnd;
381
-
382
- /**
383
- * Add a PDA map spot for an object.
384
- *
385
- * @param object_id - Target object id.
386
- * @param spot_type - Spot type from map spot config.
387
- * @param hint - Spot hint text.
388
- */
389
- map_add_object_spot(this: void, object_id: u16, spot_type: string, hint: string): void;
390
-
391
- /**
392
- * Add a serialized PDA map spot for an object.
393
- *
394
- * @param object_id - Target object id.
395
- * @param spot_type - Spot type from map spot config.
396
- * @param hint - Spot hint text.
397
- */
398
- map_add_object_spot_ser(this: void, object_id: u16, spot_type: string, hint: string): void;
399
-
400
- /**
401
- * Change hint text for an object map spot.
402
- *
403
- * @remarks
404
- * Does nothing when the object does not have a matching map spot.
405
- *
406
- * @param object_id - Target object id.
407
- * @param spot_type - Spot type from map spot config.
408
- * @param hint - New hint text.
409
- */
410
- map_change_spot_hint(this: void, object_id: u16, spot_type: string, hint: string): void;
411
-
412
- /**
413
- * Check if an object has a map spot registered with provided selector.
414
- *
415
- * @param object_id - Game object id to check.
416
- * @param spot_type - Map spot type.
417
- * @returns Non-zero count when the spot exists.
418
- */
419
- map_has_object_spot(this: void, object_id: u16, spot_type: string): u16;
420
-
421
- /**
422
- * Remove an object map spot if it exists.
423
- *
424
- * @param object_id - Game object id to update.
425
- * @param spot_type - Map spot type.
426
- */
427
- map_remove_object_spot(this: void, object_id: u16, spot_type: string): void;
428
-
429
- /**
430
- * Get current level name.
431
- *
432
- * @returns Level name.
433
- */
434
- name<T extends string = string>(this: void): T;
435
-
436
- /**
437
- * Find an online object by id.
438
- *
439
- * @param object_id - Game object id.
440
- * @returns Matching object, or `null` when it is not online.
441
- */
442
- object_by_id(this: void, object_id: u16): Nullable<game_object>;
443
-
444
- /**
445
- * Check whether a patrol path exists on this level.
446
- *
447
- * @param path_name - Patrol path name.
448
- * @returns Whether the patrol path exists.
449
- */
450
- patrol_path_exists(this: void, path_name: string): boolean;
451
-
452
- /**
453
- * Get the level physics world.
454
- *
455
- * @returns Physics world object.
456
- */
457
- physics_world(this: void): physics_world;
458
-
459
- /**
460
- * Preload a sound resource.
461
- *
462
- * @param sound - Sound resource name.
463
- */
464
- prefetch_sound(this: void, sound: string): void;
465
-
466
- /**
467
- * Check whether a game level is loaded.
468
- *
469
- * @returns Whether a level is present.
470
- */
471
- present(this: void): boolean;
472
-
473
- /**
474
- * Get current rain intensity.
475
- *
476
- * @returns Rain intensity, or `0` when no rain is active.
477
- */
478
- rain_factor(this: void): f32;
479
-
480
- /**
481
- * Remove a conditional level callback.
482
- *
483
- * @remarks
484
- * The callbacks must match the original registered pair.
485
- *
486
- * @param condition - Condition callback originally registered.
487
- * @param action - Action callback originally registered.
488
- */
489
- remove_call(this: void, condition: (this: void) => boolean, action: (this: void) => void): void;
490
-
491
- /**
492
- * Remove an object-owned conditional level callback.
493
- *
494
- * @remarks
495
- * The owner and callbacks must match the original registered pair.
496
- *
497
- * @param object - Owner object.
498
- * @param condition - Condition callback originally registered.
499
- * @param action - Action callback originally registered.
500
- */
501
- remove_call(this: void, object: object, condition: (this: void) => boolean, action: (this: void) => void): void;
502
-
503
- /**
504
- * Remove named object methods registered as a level callback.
505
- *
506
- * @remarks
507
- * The owner and method names must match the original registered pair.
508
- *
509
- * @param object - Owner object.
510
- * @param condition - Condition method name.
511
- * @param action - Action method name.
512
- */
513
- remove_call(this: void, object: object, condition: string, action: string): void;
514
-
515
- /**
516
- * Remove all registered level callbacks for an object.
517
- *
518
- * @param object - Owner object.
519
- */
520
- remove_calls_for_object(this: void, object: object): void;
521
-
522
- /**
523
- * Stop a camera effector.
524
- *
525
- * @remarks
526
- * Requires an actor. The binding removes the effector from `Actor().Cameras()`.
527
- *
528
- * @param id - Effector id.
529
- */
530
- remove_cam_effector(this: void, id: i32): void;
531
-
532
- /**
533
- * Stop a complex effector.
534
- *
535
- * @remarks
536
- * Requires an actor. The binding removes the effector from the current actor object.
537
- *
538
- * @param id - Effector id.
539
- */
540
- remove_complex_effector(this: void, id: i32): void;
541
-
542
- /**
543
- * Remove a dialog window from the render list.
544
- *
545
- * @param window - Dialog window to stop rendering.
546
- */
547
- remove_dialog_to_render(this: void, window: CUIDialogWnd): void;
548
-
549
- /**
550
- * Stop a post-process effector.
551
- *
552
- * @remarks
553
- * Requires an actor. Does nothing when no post-process effector exists for the id.
554
- *
555
- * @param id - Effector id.
556
- */
557
- remove_pp_effector(this: void, id: i32): void;
558
-
559
- /**
560
- * Send a network packet through the level.
561
- *
562
- * @since OpenXRay 2014-12-27, c82669625
563
- *
564
- * @param packet - Packet to send.
565
- * @param reliable - Whether the packet is reliable.
566
- * @param sequential - Whether the packet is sequential.
567
- * @param high_priority - Whether to send with high priority.
568
- * @param send_immediately - Whether to flush immediately.
569
- */
570
- send(
571
- this: void,
572
- packet: net_packet,
573
- reliable: boolean,
574
- sequential: boolean,
575
- high_priority: boolean,
576
- send_immediately: boolean
577
- ): void;
578
-
579
- /**
580
- * Set active camera id.
581
- *
582
- * @since OpenXRay 2015-07-07, 6e703b4c
583
- *
584
- * @remarks
585
- * Does nothing when the current view entity is not an actor or when the id is outside the actor camera range.
586
- *
587
- * @param id - Camera id.
588
- */
589
- set_active_cam(this: void, id: u8): void;
590
-
591
- /**
592
- * Set active single-player difficulty.
593
- *
594
- * @remarks
595
- * Updates the global difficulty and notifies the active single-player game state.
596
- *
597
- * @throws If the active game state is not single-player.
598
- *
599
- * @param difficulty - Difficulty id.
600
- */
601
- set_game_difficulty(this: void, difficulty: unknown /* Enum ESingleGameDifficulty */): void;
602
-
603
- /**
604
- * Set a post-process effector factor.
605
- *
606
- * @remarks
607
- * Requires an actor. Does nothing when no post-process effector exists for the id.
608
- *
609
- * @param id - Effector id.
610
- * @param factor - Target factor.
611
- * @param speed - Optional transition speed.
612
- */
613
- set_pp_effector_factor(this: void, id: i32, factor: f32, speed?: f32): void;
614
-
615
- /**
616
- * Set sound volume.
617
- *
618
- * @remarks
619
- * The engine clamps the value to the `0..1` range.
620
- *
621
- * @param volume - Sound volume.
622
- */
623
- set_snd_volume(this: void, volume: f32): void;
624
-
625
- /**
626
- * Set game time speed multiplier.
627
- *
628
- * @remarks
629
- * Works only on the server and outside editor mode. Otherwise the binding returns without changing the time factor.
630
- *
631
- * @param factor - Time factor.
632
- */
633
- set_time_factor(this: void, factor: f32): void;
634
-
635
- /**
636
- * Change active game weather.
637
- *
638
- * @remarks
639
- * Does nothing in editor mode.
640
- *
641
- * @param weather_name - Name of weather config to apply.
642
- * @param is_forced - Whether weather change should be forced.
643
- */
644
- set_weather(this: void, weather_name: string, is_forced: boolean): void;
645
-
646
- /**
647
- * Start a weather effect by name.
648
- *
649
- * @remarks
650
- * Returns `false` in editor mode.
651
- *
652
- * @param weather_fx_name - Weather effect config name.
653
- * @returns Whether the effect started.
654
- */
655
- set_weather_fx(this: void, weather_fx_name: string): boolean;
656
-
657
- /**
658
- * Show HUD indicators.
659
- *
660
- * @remarks
661
- * Clears the runtime god-mode flag set by `hide_indicators()` and `hide_indicators_safe()`.
662
- */
663
- show_indicators(this: void): void;
664
-
665
- /**
666
- * Show or hide actor weapon.
667
- *
668
- * @remarks
669
- * Does nothing while the actor exists and permanent god mode is enabled.
670
- *
671
- * @param is_visible - Whether weapon should be visible.
672
- */
673
- show_weapon(this: void, is_visible: boolean): void;
674
-
675
- /**
676
- * Spawn an item on the level.
677
- *
678
- * @since OpenXRay 2015-01-18, 3ee7401d
679
- *
680
- * @remarks
681
- * Uses the level spawn path, which is suitable for sections that are unsafe to create through `alife():create()`,
682
- * such as bolts, phantoms, and ammo.
683
- *
684
- * @param section - Item section name.
685
- * @param position - Spawn position.
686
- * @param level_vertex_id - Target level vertex.
687
- * @param parent_id - Parent object id, or `0xffff` for none.
688
- * @param return_item - Engine spawn flag passed through to `Level().spawn_item`.
689
- */
690
- spawn_item(
691
- this: void,
692
- section: string,
693
- position: vector,
694
- level_vertex_id: u32,
695
- parent_id: u16,
696
- return_item: boolean
697
- ): void;
698
-
699
- /**
700
- * Spawn a phantom at a position.
701
- *
702
- * @param position - Spawn position.
703
- */
704
- spawn_phantom(this: void, position: vector): void;
705
-
706
- /**
707
- * Start or stop a menu dialog.
708
- *
709
- * @remarks
710
- * Hides the dialog when it is already shown. Otherwise shows it and applies `should_hide_indicators`.
711
- *
712
- * @param dialog - Dialog window.
713
- * @param should_hide_indicators - Whether showing the dialog should hide HUD indicators.
714
- */
715
- start_stop_menu(this: void, dialog: CUIDialogWnd, should_hide_indicators: boolean): void;
716
-
717
- /**
718
- * Start a weather effect from a specific time.
719
- *
720
- * @remarks
721
- * Returns `false` in editor mode.
722
- *
723
- * @param weather_fx_name - Weather effect config name.
724
- * @param time - Start time.
725
- * @returns Whether the effect started.
726
- */
727
- start_weather_fx_from_time(this: void, weather_fx_name: string, time: f32): boolean;
728
-
729
- /**
730
- * Stop the active weather effect.
731
- */
732
- stop_weather_fx(this: void): void;
733
-
734
- /**
735
- * Get nearest level vertex for a position.
736
- *
737
- * @remarks
738
- * The binding preserves original Lua behavior for invalid vertices and returns `4294967296` instead of `u32(-1)`.
739
- *
740
- * @param position - World position.
741
- * @returns Level vertex id.
742
- */
743
- vertex_id(this: void, position: vector): u64;
744
-
745
- /**
746
- * Move from a level vertex in a direction.
747
- *
748
- * @remarks
749
- * Returns the original vertex when the engine cannot find a valid vertex in the requested direction.
750
- *
751
- * @param vertex_id - Start level vertex id.
752
- * @param direction - Direction to move.
753
- * @param distance - Distance to move.
754
- * @returns Result level vertex id.
755
- */
756
- vertex_in_direction(this: void, vertex_id: u32, direction: vector, distance: f32): u32;
757
-
758
- /**
759
- * Get world position of a level vertex.
760
- *
761
- * @param id - Level vertex id.
762
- * @returns Vertex position.
763
- */
764
- vertex_position(this: void, id: u32): vector;
765
-
766
- /**
767
- * Cast a ray through the level collision world.
768
- *
769
- * @remarks
770
- * `result` is updated only when this returns `true`.
771
- *
772
- * @param position - Ray origin.
773
- * @param direction - Ray direction.
774
- * @param range - Ray range.
775
- * @param target - Ray query target flags.
776
- * @param result - Ray query result placeholder.
777
- * @param ignore_object - Object ignored by the query, or `null`.
778
- * @returns Whether the ray hit anything.
779
- */
780
- ray_pick(
781
- this: void,
782
- position: vector,
783
- direction: vector,
784
- range: f32,
785
- target: unknown,
786
- result: unknown,
787
- ignore_object: Nillable<game_object>
788
- ): boolean;
789
- }
790
-
791
- /**
792
- * Global engine `level` namespace.
793
- *
794
- * @group xr_level
795
- */
796
- export const level: IXR_level;
797
- }