forked from Tobias00723/DCS-Scripting-Library-Updated
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworld.lua
More file actions
50 lines (41 loc) · 3.43 KB
/
world.lua
File metadata and controls
50 lines (41 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---@meta
--- The world singleton contains functions centered around two different but extremely useful functions. 1. Events and event handlers are all governed within world.2. A number of functions to get information about the game world.
---https://wiki.hoggitworld.com/view/DCS_singleton_world
world = {}
--- Adds a function as an event handler that executes whenever a simulator event occurs. The most common uses of event handlers are to track statistics of units within a given scenario and to execute code based on certain events occurring. Handlers are passed event tables which contains numerous data regarding the event. For examples of the event tables returned, reference the event page on the wiki to get more information regarding the event.
---https://wiki.hoggitworld.com/view/DCS_func_addEventHandler
---@return function
---@param handler any EventHandler
function world.addEventHandler(handler) end
---Removes the specified event handler from handling events. Use this when an event handler has outlived its usefulness.
---https://wiki.hoggitworld.com/view/DCS_func_removeEventHandler
---@return function
---@param handler any EventHandler
function world.removeEventHandler(handler) end
---Returns a table of the single unit object in the game who's skill level is set as "Player". There is only a single player unit in a mission and in single player the user will always spawn into this unit automatically unless other client or Combined Arms slots are available.
---https://wiki.hoggitworld.com/view/DCS_func_getPlayer
---@return Unit class
function world.getPlayer() end
---Searches a defined volume of 3d space for the specified objects within it and then can run function on each returned object. Object category is either a single enum or a table of enums that defines the types of objects that will be searched for Search volume is the defined 3d space that will be searched. Handler is the function that will be run on each object that is found. Any data is a variable that is passed to the handler function, it can be anything.
---https://wiki.hoggitworld.com/view/DCS_func_searchObjects
---@return table
---@param ObjectCategory table/enum
---@param searchVolume any volume
---@param Handler any ObjectSeatchHandler
---@param data any
function world.searchObjects(ObjectCategory, searchVolume, Handler, data) end
---Returns a table of mark panels and drawn shapes indexed numerically that are present within the mission. Panel is designed with the mark points in mind, but still returns data for shapes created via markups.
---https://wiki.hoggitworld.com/view/DCS_func_getMarkPanels
---@return table
function world.getMarkPanels() end
---Returns a table of airbase objects belonging to the specified coalition. Objects can be ships, static objects(FARP), or airbases on the map. When the function is run as world.getAirbases() no input values required, and the function returns all airbases, ships, and farps on the map.
---https://wiki.hoggitworld.com/view/DCS_func_getAirbases
---@return table<number, Airbase>
---@param coalitionid number
function world.getAirbases(coalitionid) end
---Searches the defined area passed to the function to remove craters, object wreckage, and any other debris within the search volume. Will not remove wreckage of scenery objects. See pages for the correct format of each volume type:
---https://wiki.hoggitworld.com/view/DCS_func_removeJunk
---@return number
---@param searchVolume table
function world.removeJunk(searchVolume) end
return world