mirror of
https://github.com/omltcat/dcs-lua-definitions.git
synced 2025-11-10 15:48:52 +00:00
commit
24d5f1820d
107
library/mission/callbacks.lua
Normal file
107
library/mission/callbacks.lua
Normal file
@ -0,0 +1,107 @@
|
||||
---@meta
|
||||
|
||||
|
||||
---Mission load begin event.
|
||||
function onMissionLoadBegin() end
|
||||
|
||||
function onMissionLoadProgress(progress, message)
|
||||
end
|
||||
|
||||
function onMissionLoadEnd()
|
||||
end
|
||||
|
||||
function onSimulationStart()
|
||||
end
|
||||
|
||||
function onSimulationStop()
|
||||
end
|
||||
|
||||
function onSimulationFrame()
|
||||
end
|
||||
|
||||
function onSimulationPause()
|
||||
end
|
||||
|
||||
function onSimulationResume()
|
||||
end
|
||||
|
||||
function onGameEvent(eventName,arg1,arg2,arg3,arg4)
|
||||
--"friendly_fire", playerID, weaponName, victimPlayerID
|
||||
--"mission_end", winner, msg
|
||||
--"kill", killerPlayerID, killerUnitType, killerSide, victimPlayerID, victimUnitType, victimSide, weaponName
|
||||
--"self_kill", playerID
|
||||
--"change_slot", playerID, slotID, prevSide
|
||||
--"connect", playerID, name
|
||||
--"disconnect", playerID, name, playerSide, reason_code
|
||||
--"crash", playerID, unit_missionID
|
||||
--"eject", playerID, unit_missionID
|
||||
--"takeoff", playerID, unit_missionID, airdromeName
|
||||
--"landing", playerID, unit_missionID, airdromeName
|
||||
--"pilot_death", playerID, unit_missionID
|
||||
end
|
||||
|
||||
function onNetConnect(localPlayerID)
|
||||
end
|
||||
|
||||
function onNetMissionChanged(newMissionName)
|
||||
end
|
||||
|
||||
function onNetMissionEnd()
|
||||
end
|
||||
|
||||
function onNetDisconnect(reason_msg, err_code)
|
||||
end
|
||||
|
||||
-- disconnect reason codes:
|
||||
-- net.ERR_INVALID_ADDRESS
|
||||
-- net.ERR_CONNECT_FAILED
|
||||
-- net.ERR_WRONG_VERSION
|
||||
-- net.ERR_PROTOCOL_ERROR
|
||||
-- net.ERR_TAINTED_CLIENT
|
||||
-- net.ERR_INVALID_PASSWORD
|
||||
-- net.ERR_BANNED
|
||||
-- net.ERR_BAD_CALLSIGN
|
||||
-- net.ERR_TIMEOUT
|
||||
-- net.ERR_KICKED
|
||||
|
||||
|
||||
function onPlayerConnect(id)
|
||||
end
|
||||
|
||||
function onPlayerDisconnect(id, err_code)
|
||||
-- this is never called for local playerID
|
||||
end
|
||||
|
||||
function onPlayerStart(id)
|
||||
-- a player entered the simulation
|
||||
-- this is never called for local playerID
|
||||
end
|
||||
|
||||
function onPlayerStop(id)
|
||||
-- a player left the simulation (happens right before a disconnect, if player exited by desire)
|
||||
-- this is never called for local playerID
|
||||
end
|
||||
|
||||
function onPlayerChangeSlot(id)
|
||||
-- a player successfully changed the slot
|
||||
-- this will also come as onGameEvent('change_slot', playerID, slotID),
|
||||
-- if allowed by server.advanced.event_Connect setting
|
||||
end
|
||||
|
||||
|
||||
--- These 3 functions are different from the rest:
|
||||
--- 1. they are called directly from the network code, so try to make them as fast as possible
|
||||
--- 2. they return a result
|
||||
-- The code shows the default implementations.
|
||||
|
||||
function onPlayerTryConnect(addr, name, ucid, playerID) --> true | false, "disconnect reason"
|
||||
return true
|
||||
end
|
||||
|
||||
function onPlayerTrySendChat(playerID, msg, to) -- -> filteredMessage | "" - empty string drops the message
|
||||
return msg
|
||||
end
|
||||
|
||||
function onPlayerTryChangeSlot(playerID, side, slotID) -- -> true | false
|
||||
return true
|
||||
end
|
||||
107
library/mission/log.lua
Normal file
107
library/mission/log.lua
Normal file
@ -0,0 +1,107 @@
|
||||
---@meta
|
||||
|
||||
|
||||
---Logging works as follows:
|
||||
--- - Each log message is accompanied with 2 attributes: a subsystem, and level.
|
||||
--- - After each message gets into the logger it passes (asynchronously) through a series of output filters which decide where the message will be written to.
|
||||
---___
|
||||
---log.* API is also available from the Saved Games\DCS\Config\autoexec.cfg file so you can control log output in you local machine.
|
||||
---@class (exact) log
|
||||
---@field ALERT 2 Alert level logging.
|
||||
---@field ERROR 8 Error level logging.
|
||||
---@field WARNING 16 Warning level logging.
|
||||
---@field INFO 64 Info level logging.
|
||||
---@field DEBUG 128 Debug level logging.
|
||||
---@field ALL 255 Alert, error, warning, info and debug level logging.
|
||||
---@field TRACE 256 Trace level logging. A special level which is excluded from the dcs.log file.
|
||||
---@field MESSAGE 0 Log message.
|
||||
---@field TIME_UTC 1 Log UTC time.
|
||||
---@field TIME_LOCAL 129 Log local time.
|
||||
---@field TIME_RELATIVE 128 Log relative time.
|
||||
---@field MODULE 4 Log module name. This is a subsystem module, not a DLC module.
|
||||
---@field LEVEL 2 Log log level.
|
||||
---@field FULL 271 Log message, UTC time, module name and log level.
|
||||
log = {}
|
||||
|
||||
|
||||
---@alias logLevel
|
||||
---| `log.ALERT`
|
||||
---| `log.ERROR`
|
||||
---| `log.WARNING`
|
||||
---| `log.INFO`
|
||||
---| `log.DEBUG`
|
||||
---| `log.ALL` Includes ALERT, ERROR, WARNING, INFO and DEBUG.
|
||||
---| `log.TRACE` A special level which is excluded from the dsc.log file.
|
||||
|
||||
|
||||
|
||||
---@alias logOutput
|
||||
---| `log.MESSAGE`
|
||||
---| `log.TIME_UTC`
|
||||
---| `log.TIME_LOCAL`
|
||||
---| `log.TIME_RELATIVE`
|
||||
---| `log.MODULE` This is a subsystem module, not a DLC module.
|
||||
---| `log.LEVEL`
|
||||
---| `log.FULL` Means log.MESSAGE + log.TIME_UTC + log.MODULE + log.LEVEL.
|
||||
|
||||
|
||||
---Sends the message to the logger. If there are any arguments after message, the actual string is formed as string.format(message, ...).
|
||||
---___
|
||||
---@param subsystem_name string Name of the subsystem to log. May use any name.
|
||||
---@param log_level logLevel [logLevel](lua://logLevel) to log message to.
|
||||
---@param message string If there are any arguments after message, the actual string is formed as string.format(message, ...)
|
||||
---@param ... unknown string.format arguments.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function log.write(subsystem_name, log_level, message, ...) end
|
||||
|
||||
---Output log.DEBUG message from the current environment.<br>
|
||||
---Note: With the default log level settings, debug messages are not written to the dcs.log file.
|
||||
---@param message string
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function log.debug(message) end
|
||||
|
||||
---Output log.INFO message from the current environment to the dcs.log file.
|
||||
---@param message string
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function log.info(message) end
|
||||
|
||||
---Output log.WARNING message from the current environment to the dcs.log file.
|
||||
---@param message string
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function log.warning(message) end
|
||||
|
||||
---Output log.ERROR message from the current environment to the dcs.log file.
|
||||
---@param message string
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function log.error(message) end
|
||||
|
||||
---Output log.ALERT message from the current environment to the dcs.log file.
|
||||
---@param message string
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function log.alert(message) end
|
||||
|
||||
|
||||
---Sends the message to the logger. If there are any arguments after message, the actual string is formed as string.format(message, ...)
|
||||
---___
|
||||
---So, in order to save net.trace(msg) messages to a file, you should issue a call:
|
||||
---```
|
||||
---log.set_output('lua-net', 'LuaNET', log.TRACE, log.MESSAGE + log.TIME_UTC)
|
||||
---```
|
||||
---This will write to a Logs/lua-net.log file
|
||||
---
|
||||
---Or, to save everything lua-network-related:
|
||||
---```
|
||||
---log.set_output('lua-net', 'LuaNET', log.TRACE + log.ALL, log.MESSAGE + log.TIME_UTC + log.LEVEL)
|
||||
---```
|
||||
---To close the log file, you must use
|
||||
---```
|
||||
---log.set_output('lua-net', '', 0, 0)
|
||||
---```
|
||||
---___
|
||||
---@param log_file_name_wo_ext string Name of log file without extension. Resulting log will be written to $WRITE_DIR/Logs/.log.
|
||||
---@param rule_subsystem_name string Name of the subsystem whose messages to write or empty string to match all subsystems.
|
||||
---@param rule_level_mask logLevel|integer [logLevel](lua://logLevel) of logging.
|
||||
---@param ... logOutput|integer Sum of [logOutput](lua://logOutput) flags.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function log.set_output(log_file_name_wo_ext, rule_subsystem_name, rule_level_mask, ...) end
|
||||
|
||||
@ -1,30 +1,64 @@
|
||||
---@meta
|
||||
|
||||
---@class trigger
|
||||
---@class (exact) trigger
|
||||
trigger = {}
|
||||
|
||||
---@enum trigger.smokePlumeColor
|
||||
trigger.smokePlumeColor = { ---@diagnostic disable-line: inject-field
|
||||
DISABLE = 0,
|
||||
GREEN = 1,
|
||||
RED = 2,
|
||||
WHITE = 3,
|
||||
ORANGE = 4,
|
||||
BLUE = 5
|
||||
}
|
||||
|
||||
---@enum trigger.smokeColor
|
||||
trigger.smokeColor = {
|
||||
Green = 0,
|
||||
Red = 1,
|
||||
White = 2,
|
||||
Orange = 3,
|
||||
Blue = 4
|
||||
trigger.smokeColor = { ---@diagnostic disable-line: inject-field
|
||||
GREEN = 0,
|
||||
RED = 1,
|
||||
WHITE = 2,
|
||||
ORANGE = 3,
|
||||
BLUE = 4
|
||||
}
|
||||
|
||||
---@enum trigger.flareColor
|
||||
trigger.flareColor = {
|
||||
Green = 0,
|
||||
Red = 1,
|
||||
White = 2,
|
||||
Yellow = 3
|
||||
trigger.flareColor = { ---@diagnostic disable-line: inject-field
|
||||
GREEN = 0,
|
||||
RED = 1,
|
||||
WHITE = 2,
|
||||
YELLOW = 3
|
||||
}
|
||||
|
||||
---@class trigger.action
|
||||
trigger.action = {}
|
||||
---@enum trigger.shapeId
|
||||
trigger.shapeId = { ---@diagnostic disable-line: inject-field
|
||||
LINE = 0,
|
||||
CIRCLE = 2,
|
||||
RECT = 3,
|
||||
ARROW = 4,
|
||||
TEXT = 5,
|
||||
QUAD = 6,
|
||||
FREEFORM = 7
|
||||
}
|
||||
|
||||
---@enum trigger.lineType
|
||||
trigger.lineType = { ---@diagnostic disable-line: inject-field
|
||||
NO_LINE = 0,
|
||||
SOLID = 1,
|
||||
DASHED = 2,
|
||||
DOTTED = 3,
|
||||
DOT_DASH = 4,
|
||||
LONG_DASH = 5,
|
||||
TWO_DASH = 6
|
||||
}
|
||||
|
||||
---@class (exact) trigger.action
|
||||
trigger.action = {} ---@diagnostic disable-line: inject-field
|
||||
|
||||
---Creates an explosion at a given point at the specified power.
|
||||
---@param vec3 vec3 Position of explosion.
|
||||
---@param power number Power of explosion.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.explosion(vec3, power) end
|
||||
|
||||
---Creates a signal flare at the given point in the specified color. <br>
|
||||
@ -37,6 +71,7 @@ function trigger.action.explosion(vec3, power) end
|
||||
---@param vec3 vec3 -- The point where the flare will be launched.
|
||||
---@param flareColor trigger.flareColor -- The color of the flare.
|
||||
---@param azimuth number -- The direction in which the flare will be launched.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.signalFlare(vec3, flareColor, azimuth) end
|
||||
|
||||
---Creates an arrow from the startPoint to the endPoint on the F10 map. The arrow will be "pointing at" the startPoint. There is no control over other dimensions of the arrow. <br>
|
||||
@ -65,11 +100,12 @@ function trigger.action.signalFlare(vec3, flareColor, azimuth) end
|
||||
---@param id integer -- The unique id.
|
||||
---@param startPoint vec3 -- The start point of the arrow.
|
||||
---@param endPoint vec3 -- The end point of the arrow.
|
||||
---@param color table -- The color of the outline.
|
||||
---@param fillColor table -- The color used for shading the shape.
|
||||
---@param lineType integer -- The type of the line.
|
||||
---@param color table<number, number, number, number> -- The color of the outline in { r, g, b, a } format values 0-1.
|
||||
---@param fillColor table<number, number, number, number> -- The color used for shading the shape in { r, g, b, a } format values 0-1.
|
||||
---@param lineType trigger.lineType -- The type of the line.
|
||||
---@param readOnly? boolean -- Whether the arrow is read only.
|
||||
---@param message? string -- The message to display when the arrow is added.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.arrowToAll(coalition, id, startPoint, endPoint, color, fillColor, lineType, readOnly, message) end
|
||||
|
||||
---Creates the defined shape on the F10 map. Uses the same definitions as the specific functions to create different shapes with the only difference being the first parameter is used to define the shape. This function does have an additional type of shape of "freeform" which allows you to create an 3+ vertices shape in any format you wish. <br>
|
||||
@ -107,11 +143,12 @@ function trigger.action.arrowToAll(coalition, id, startPoint, endPoint, color, f
|
||||
---@param id integer -- The unique id.
|
||||
---@param point1 vec3 -- The start of the polygon.
|
||||
---@param pointN vec3 -- Any rest of the points of the polygon.
|
||||
---@param color table -- The color of the outline.
|
||||
---@param fillColor table -- The color used for shading the shape.
|
||||
---@param lineType integer -- The type of the line.
|
||||
---@param color table<number, number, number, number> -- The color of the outline in { r, g, b, a } format values 0-1.
|
||||
---@param fillColor table<number, number, number, number> -- The color used for shading the shape in { r, g, b, a } format values 0-1.
|
||||
---@param lineType trigger.lineType -- The type of the line.
|
||||
---@param readOnly? boolean -- Whether the circle is read only.
|
||||
---@param message? string -- The message to display when the circle is added.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.markupToAll(shapeId, coalition, id, point1, pointN, color, fillColor, lineType, readOnly, message) end
|
||||
|
||||
---Creates a circle on the map with a given radius, color, fill color, and outline. <br>
|
||||
@ -141,11 +178,12 @@ function trigger.action.markupToAll(shapeId, coalition, id, point1, pointN, colo
|
||||
---@param id integer -- The unique id.
|
||||
---@param center vec3 -- The center of the circle.
|
||||
---@param radius number -- The radius of the circle.
|
||||
---@param color table -- The color of the outline.
|
||||
---@param fillColor table -- The color used for shading the shape.
|
||||
---@param lineType integer -- The type of the line.
|
||||
---@param color table<number, number, number, number> -- The color of the outline in { r, g, b, a } format values 0-1.
|
||||
---@param fillColor table<number, number, number, number> -- The color used for shading the shape in { r, g, b, a } format values 0-1.
|
||||
---@param lineType trigger.lineType -- The type of the line.
|
||||
---@param readOnly? boolean -- Whether the circle is read only.
|
||||
---@param message? string -- The message to display when the circle is added.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.circleToAll(coalition, id, center, radius, color, fillColor, lineType, readOnly, message) end
|
||||
|
||||
---Creates a line on the F10 map from one point to another. <br>
|
||||
@ -172,10 +210,11 @@ function trigger.action.circleToAll(coalition, id, center, radius, color, fillCo
|
||||
---@param id integer -- The unique id.
|
||||
---@param startPoint vec3 -- The start point of the line.
|
||||
---@param endPoint vec3 -- The end point of the line.
|
||||
---@param color table -- The color of the line.
|
||||
---@param lineType integer -- The type of the line.
|
||||
---@param color table<number, number, number, number> -- The color of the outline in { r, g, b, a } format values 0-1.
|
||||
---@param lineType trigger.lineType -- The type of the line.
|
||||
---@param readOnly? boolean -- Whether the line is read only.
|
||||
---@param message? string -- The message to display when the line is added.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.lineToAll(coalition, id, startPoint, endPoint, color, lineType, readOnly, message) end
|
||||
|
||||
---Creates a shape defined by the 4 points on the F10 map. <br>
|
||||
@ -206,11 +245,12 @@ function trigger.action.lineToAll(coalition, id, startPoint, endPoint, color, li
|
||||
---@param point2 vec3 -- The second point of the shape.
|
||||
---@param point3 vec3 -- The third point of the shape.
|
||||
---@param point4 vec3 -- The fourth point of the shape.
|
||||
---@param color table -- The color of the outline.
|
||||
---@param fillColor table -- The color used for shading the shape.
|
||||
---@param lineType integer -- The type of the line.
|
||||
---@param color table<number, number, number, number> -- The color of the outline in { r, g, b, a } format values 0-1.
|
||||
---@param fillColor table<number, number, number, number> -- The color used for shading the shape in { r, g, b, a } format values 0-1.
|
||||
---@param lineType trigger.lineType -- The type of the line.
|
||||
---@param readOnly? boolean -- Whether the shape is read only.
|
||||
---@param message? string -- The message to display when the shape is added.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.quadToAll(coalition, id, point1, point2, point3, point4, color, fillColor, lineType, readOnly, message) end
|
||||
|
||||
---Creates a rectangle on the map from the startpoint in one corner to the endPoint in the opposite corner. <br>
|
||||
@ -239,11 +279,12 @@ function trigger.action.quadToAll(coalition, id, point1, point2, point3, point4,
|
||||
---@param id integer -- The unique id.
|
||||
---@param startPoint vec3 -- The start point of the rectangle.
|
||||
---@param endPoint vec3 -- The end point of the rectangle.
|
||||
---@param color table -- The color of the outline.
|
||||
---@param fillColor table -- The color used for shading the shape.
|
||||
---@param lineType integer -- The type of the line.
|
||||
---@param color table<number, number, number, number> -- The color of the outline in { r, g, b, a } format values 0-1.
|
||||
---@param fillColor table<number, number, number, number> -- The color used for shading the shape in { r, g, b, a } format values 0-1.
|
||||
---@param lineType trigger.lineType -- The type of the line.
|
||||
---@param readOnly? boolean -- Whether the rectangle is read only.
|
||||
---@param message? string -- The message to display when the rectangle is added.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.rectToAll(coalition, id, startPoint, endPoint, color, fillColor, lineType, readOnly, message) end
|
||||
|
||||
---Adds a mark point to all on the F10 map with attached text. <br>
|
||||
@ -253,6 +294,7 @@ function trigger.action.rectToAll(coalition, id, startPoint, endPoint, color, fi
|
||||
---@param vec3 table -- The 3D vector representing the position of the mark point.
|
||||
---@param readOnly? boolean -- Whether the mark point is read only.
|
||||
---@param message? string -- The message to display when a mark is added.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.markToAll(id, text, vec3, readOnly, message) end
|
||||
|
||||
---Adds a mark point to a coalition on the F10 map with attached text. <br>
|
||||
@ -263,6 +305,7 @@ function trigger.action.markToAll(id, text, vec3, readOnly, message) end
|
||||
---@param coalition coalition.side -- The id of the coalition.
|
||||
---@param readOnly boolean? -- Whether the mark point is read only.
|
||||
---@param message string? -- The message to display when a mark is added.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.markToCoalition(id, text, vec3, coalition, readOnly, message) end
|
||||
|
||||
---Adds a mark point to a group on the F10 map with attached text. <br>
|
||||
@ -273,22 +316,26 @@ function trigger.action.markToCoalition(id, text, vec3, coalition, readOnly, mes
|
||||
---@param groupId number -- The id of the group.
|
||||
---@param readOnly? boolean -- Whether the mark point is read only.
|
||||
---@param message? string -- The message to display when a mark is added.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.markToGroup(id, text, vec3, groupId, readOnly, message) end
|
||||
|
||||
---Plays a sound file to all players on the specified coalition. The sound file must be placed inside of the miz file in order to be played.
|
||||
---@param coalition coalition.side -- The coalition of players.
|
||||
---@param soundfile string -- The sound file to play.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.outSoundForCoalition(coalition, soundfile) end
|
||||
|
||||
---Plays a sound file to all players in the specified group. Group is specified by their groupId. The sound file must be placed inside of the miz file in order to be played.
|
||||
---@param groupId integer -- The id of the group.
|
||||
---@param soundfile string -- The sound file to play.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.outSoundForGroup(groupId, soundfile) end
|
||||
|
||||
---Displays the passed string of text for the specified time to all players.
|
||||
---@param text string -- The text to be displayed to all players.
|
||||
---@param displayTime number -- The duration for which the text will be displayed.
|
||||
---@param clearview? boolean -- Defines whether or not to use the old message display format which overwrites existing messages.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.outText(text, displayTime, clearview) end
|
||||
|
||||
---Displays the passed string of text for the specified time to all players belonging to the specified coalition.
|
||||
@ -296,6 +343,7 @@ function trigger.action.outText(text, displayTime, clearview) end
|
||||
---@param text string -- The text to display.
|
||||
---@param displayTime number -- The time to display the text.
|
||||
---@param clearview? boolean -- Whether to use the old message display format.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.outTextForCoalition(coalition, text, displayTime, clearview) end
|
||||
|
||||
---Displays the passed string of text for the specified time to all players in the specified group.
|
||||
@ -303,6 +351,7 @@ function trigger.action.outTextForCoalition(coalition, text, displayTime, clearv
|
||||
---@param text string -- The text to be displayed to the group.
|
||||
---@param displayTime number -- The duration for which the text will be displayed.
|
||||
---@param clearview? boolean -- Defines whether or not to use the old message display format which overwrites existing messages.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.outTextForGroup(groupId, text, displayTime, clearview) end
|
||||
|
||||
---Displays the passed string of text for the specified time to all players in the specified unit. The unit is defined by its unitId.
|
||||
@ -311,30 +360,36 @@ function trigger.action.outTextForGroup(groupId, text, displayTime, clearview) e
|
||||
---@param text string -- The text to be displayed to the unit.
|
||||
---@param displayTime number -- The duration for which the text will be displayed.
|
||||
---@param clearview? boolean -- Defines whether or not to use the old message display format which overwrites existing messages.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.outTextForUnit(unitId, text, displayTime, clearview) end
|
||||
|
||||
--- Removes a mark panel from the F10 map.
|
||||
--- @param id integer
|
||||
---Removes a mark panel from the F10 map.
|
||||
---@param id integer
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.removeMark(id) end
|
||||
|
||||
---Updates the position of a mark that was defined at the first point given to create it. Can be used to "move" an existing mark from one place to the next without deleting it and creating a new one.
|
||||
---@param id integer -- The unique id of the mark to be updated.
|
||||
---@param vec3 vec3 -- The new position for the mark in the form of a vec3 table {x, y, z}.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setMarkupPositionStart(id, vec3) end
|
||||
|
||||
---Updates the color of the specified mark to be the new value.
|
||||
---@param id integer -- The unique id of the mark to be updated.
|
||||
---@param color table -- The new color for the mark. Color format is {r, g, b, alpha} with values ranging from 0 to 1.
|
||||
---@param color table<number, number, number, number> -- The color of the outline in { r, g, b, a } format values 0-1.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setMarkupColor(id, color) end
|
||||
|
||||
---Updates the colorfill of the specified mark to be the new value. Color format is {r, g, b, alpha} with values ranging from 0 to 1.
|
||||
---@param id number -- The id of the mark.
|
||||
---@param colorFill table -- The new colorfill for the mark.
|
||||
---@param colorFill table<number, number, number, number> -- The color used for shading the shape in { r, g, b, a } format values 0-1.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setMarkupColorFill(id, colorFill) end
|
||||
|
||||
---Updates the text value of the passed mark to the passed text value. If the id of the passed mark does not have any text then nothing will happen.
|
||||
---@param id integer -- The unique id of the mark to be updated.
|
||||
---@param text string -- The new text value for the mark.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setMarkupText(id, text) end
|
||||
|
||||
---Sets the internal cargo for the specified unit at the specified mass. Overrides any previously set value.
|
||||
@ -347,35 +402,41 @@ function trigger.action.setMarkupText(id, text) end
|
||||
---```
|
||||
---@param unitName string -- The name of the unit.
|
||||
---@param mass number -- The mass of the cargo in kilograms.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setUnitInternalCargo(unitName, mass) end
|
||||
|
||||
---Creates a text imposed on the map at a given point. Text scales with the map.
|
||||
---@param coalition coalition.side|integer -- Coalition Ids to be used. -1 for All, 0 for Neutral, 1 for Red, 2 for Blue.
|
||||
---@param id integer -- Id MUST be unique and is shared with the ids used with mark panels. Likewise trigger.action.removeMark is used to remove shapes created.
|
||||
---@param point vec3 -- Point MUST be a vec3 table. {x, y z}
|
||||
---@param color table -- Color format is {r, g, b, a} with values 0 to 1. A red line with 50% alpha would be {1, 0, 0, 0.5}. It defines the color of the text to be displayed.
|
||||
---@param fillColor table -- colorFill will be the color of a rectangle over the area that the text covers.
|
||||
---@param color table<number, number, number, number> -- The color of the outline in { r, g, b, a } format values 0-1.
|
||||
---@param fillColor table<number, number, number, number> -- The color used for shading the shape in { r, g, b, a } format values 0-1.
|
||||
---@param fontSize number -- Size of the font to be used.
|
||||
---@param readOnly boolean -- readOnly denotes whether in the future if clients will be allowed to edit or remove the shape.
|
||||
---@param text string -- text corresponds to the message that is displayed on the map.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.textToAll(coalition, id, point, color, fillColor, fontSize, readOnly, text) end
|
||||
|
||||
---@class trigger.misc
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
trigger.misc = {}
|
||||
|
||||
---Returns the value of a user flag.
|
||||
---@param flagNumOrName string -- The number or name of the user flag.
|
||||
---@return integer -- The value of the user flag.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.misc.getUserFlag(flagNumOrName) end
|
||||
|
||||
---Returns a trigger zone table of a given name.
|
||||
---@param zoneName string -- The name of the trigger zone.
|
||||
---@return zone? -- The trigger zone table. Format: { point = vec3, radius = distance }
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.misc.getZone(zoneName) end
|
||||
|
||||
---Sets a user flag to the specified value.
|
||||
---@param flagNumOrName string -- The number or name of the user flag.
|
||||
---@param userFlagValue boolean|integer -- The value to set the user flag to.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setUserFlag(flagNumOrName, userFlagValue) end
|
||||
|
||||
---Creates a smoke plume behind a specified aircraft. When passed 0 for smoke type the plume will be disabled. When triggering the on the same unit with a different color the plume will simply change color.
|
||||
@ -396,8 +457,9 @@ function trigger.action.setUserFlag(flagNumOrName, userFlagValue) end
|
||||
---```
|
||||
---___
|
||||
---@param unitName string Unit
|
||||
---@param smokeColor integer Color of Smoke
|
||||
function trigger.action.ctfColorTag(unitName , smokeColor ) end
|
||||
---@param smokePlumeColor trigger.smokePlumeColor Color of smoke plume behind aircraft.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.ctfColorTag(unitName , smokePlumeColor ) end
|
||||
|
||||
---Creates colored smoke marker at a given point. Smoke uses trigger.smokeColor enum
|
||||
---
|
||||
@ -411,6 +473,7 @@ function trigger.action.ctfColorTag(unitName , smokeColor ) end
|
||||
---@param vec3 vec3 Location of smoke.
|
||||
---@param smokeColor trigger.smokeColor Color of smoke.
|
||||
---@param name? string Optional Unique name given to the smoke mark to be used with removing it.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.smoke(vec3, smokeColor, name) end
|
||||
|
||||
---Creates a large smoke effect on a vec3 point of a specified type and density.
|
||||
@ -437,6 +500,7 @@ function trigger.action.smoke(vec3, smokeColor, name) end
|
||||
---@param preset integer Smoke preset.
|
||||
---@param density number Density of smoke from 0 to 1.
|
||||
---@param name? string Optional Unique name given to the smoke mark to be used with removing it.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.effectSmokeBig(vec3, preset, density, name) end
|
||||
|
||||
---Stops a big smoke effect of the passed name. Used in conjunction with trigger.action.effectSmokeBig
|
||||
@ -448,6 +512,7 @@ function trigger.action.effectSmokeBig(vec3, preset, density, name) end
|
||||
---```
|
||||
---___
|
||||
---@param name string Name give in trigger.effectSmokeBig
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.effectSmokeStop(name) end
|
||||
|
||||
---Transmits an audio file to be broadcast over a specific frequency eneminating from the specified point.
|
||||
@ -473,6 +538,7 @@ function trigger.action.effectSmokeStop(name) end
|
||||
---@param frequency number Frequency in Hz, 9 digits.
|
||||
---@param power number Power in Watts.
|
||||
---@param name string Name of transmission.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.radioTransmission(filename, point, modulation, loop, frequency, power, name) end
|
||||
|
||||
---Stops a radio transmission of the passed name. Transmission must be named in the trigger.action.radioTransmission it was sent from.
|
||||
@ -484,6 +550,7 @@ function trigger.action.radioTransmission(filename, point, modulation, loop, fre
|
||||
---```
|
||||
---___
|
||||
---@param name string Name of radio transmission given in trigger.action.radioTransmission.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.stopRadioTransmission(name ) end
|
||||
|
||||
---Plays a sound file to all players. The sound file must be placed inside of the miz file in order to be played.
|
||||
@ -498,18 +565,21 @@ function trigger.action.stopRadioTransmission(name ) end
|
||||
---```
|
||||
---___
|
||||
---@param soundfile string Name of sound file.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.outSound(soundfile ) end
|
||||
|
||||
---Plays a sound file to all players on the specified country. The sound file must be placed inside of the miz file in order to be played.
|
||||
---___
|
||||
---@param country country.id Id of country to play sound for.
|
||||
---@param soundfile string Name of sound file.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.outSoundForCountry(country, soundfile ) end
|
||||
|
||||
---Plays a sound file to all players in the specified unit. Unit is specified by the corresponding UnitId The sound file must be placed inside of the miz file in order to be played.
|
||||
---___
|
||||
---@param unitId number Unit Id.
|
||||
---@param soundfile string Name of sound file.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.outSoundForUnit(unitId, soundfile ) end
|
||||
|
||||
---Displays the passed string of text for the specified time to all players belonging to the specified country. Boolean clearview defines whether or not to use the old message display format. The old message display overwrites existing messages and is good for displaying anything that must be updated at a high rate like lap times.
|
||||
@ -518,6 +588,7 @@ function trigger.action.outSoundForUnit(unitId, soundfile ) end
|
||||
---@param text string Text to display.
|
||||
---@param displayTime number How long to display text in seconds.
|
||||
---@param clearview boolean Whether to clear all previous text before displaying.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.outTextForCountry(country, text, displayTime, clearview) end
|
||||
|
||||
---Adds a command to the "F10 Other" radio menu allowing players to call commands and set flags within the mission. Command is added for both teams. The string name is the text that will be displayed in the F10 Other menu and is also used in the function to remove the command from the menu.
|
||||
@ -525,11 +596,13 @@ function trigger.action.outTextForCountry(country, text, displayTime, clearview)
|
||||
---@param name string Name of command.
|
||||
---@param userFlagName string User flag name to set.
|
||||
---@param userFlagValue number Value to set for user flag.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.addOtherCommand(name, userFlagName, userFlagValue ) end
|
||||
|
||||
---Removes the command that matches the specified name input variable from the "F10 Other" radio menu.
|
||||
---___
|
||||
---@param name string Name of command given in trigger.action.addOtherCommand.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.removeOtherCommand(name ) end
|
||||
|
||||
---Adds a command to the "F10 Other" radio menu allowing players to call commands and set flags within the mission. Command is added for all players belonging to the specified coalition. The string name is the text that will be displayed in the F10 Other menu and is also used in the function to remove the command from the menu.
|
||||
@ -538,12 +611,14 @@ function trigger.action.removeOtherCommand(name ) end
|
||||
---@param name string Name of command to add.
|
||||
---@param userFlagName string Name of user flag to set.
|
||||
---@param userFlagValue number Value to set for user flag.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.addOtherCommandForCoalition(coalition, name, userFlagName , userFlagValue ) end
|
||||
|
||||
---Removes the command that matches the specified name input variable from the "F10 Other" radio menu if the command was added for coalition.
|
||||
---___
|
||||
---@param coalitionId coalition.side Coalition to remove command from.
|
||||
---@param name string Name of command given in trigger.action.addOtherCommandForCoalition.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.removeOtherCommandForCoalition(coalitionId, name ) end
|
||||
|
||||
---Adds a command to the "F10 Other" radio menu allowing players to call commands and set flags within the mission. Command is added for a specific group designated by its groupId. The string name is the text that will be displayed in the F10 Other menu and is also used in the function to remove the command from the menu.
|
||||
@ -552,24 +627,28 @@ function trigger.action.removeOtherCommandForCoalition(coalitionId, name ) end
|
||||
---@param name string Name of command to add.
|
||||
---@param userFlagName string Name of user flag to set.
|
||||
---@param userFlagValue number Value to set user flag to.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.addOtherCommandForGroup(groupId, name, userFlagName, userFlagValue ) end
|
||||
|
||||
---Removes the command that matches the specified name input variable from the "F10 Other" radio menu if the command exists for the specified group.
|
||||
---___
|
||||
---@param groupId number GroupId to remove command from.
|
||||
---@param name string Name of command given in trigger.action.addOtherCommandForGroup
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.removeOtherCommandForGroup(groupId, name ) end
|
||||
|
||||
---Updates the radius of the specified mark to be the new value. If the id of the passed mark is not a circle then nothing will happen.
|
||||
---___
|
||||
---@param id number Id of mark to set radius (must be a circle id).
|
||||
---@param radius number New radius of circle.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setMarkupRadius(id , radius ) end
|
||||
|
||||
---Updates the font size of the specified mark to be the new value. If the id of the passed mark does not have text then nothing will happen.
|
||||
---___
|
||||
---@param id number Id of Markup to set.
|
||||
---@param fontSize number New font size.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setMarkupFontSize(id, fontSize ) end
|
||||
|
||||
---Updates the type line of the specified mark to be the new value.
|
||||
@ -584,53 +663,63 @@ function trigger.action.setMarkupFontSize(id, fontSize ) end
|
||||
--- - 6 Two Dash
|
||||
---___
|
||||
---@param id number Id of markup to set.
|
||||
---@param TypeLine number Type of line to use.
|
||||
---@param TypeLine trigger.lineType Type of line to use.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setMarkupTypeLine(id , TypeLine ) end
|
||||
|
||||
---Updates the position of a mark that was defined at the last point given to create it. Can be used to "move" an existing mark from one place to the next without deleting it and creating a new one.
|
||||
---___
|
||||
---@param id number Id of markup to set.
|
||||
---@param vec3 vec3 The new position for the mark.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setMarkupPositionEnd(id, vec3 ) end
|
||||
|
||||
---Sets the task of the specified index to be the one and only active task.
|
||||
---___
|
||||
---@param Group Group Group to set task for.
|
||||
---@param taskIndex number Index of task to become active.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setAITask(Group, taskIndex ) end
|
||||
|
||||
---Pushes the task of the specified index to the front of the tasking queue.
|
||||
---___
|
||||
---@param Group Group Group to set task for.
|
||||
---@param taskIndex number Index of task to bring to front of task queue.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.pushAITask(Group , taskIndex ) end
|
||||
|
||||
---Activates the specified group if it is setup for "late activation." Calls the Group.activate function.
|
||||
---___
|
||||
---@param Group Group Late activated group to activate.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.activateGroup(Group ) end
|
||||
|
||||
---Deactivates the specified group. Calls the Group.destroy function.
|
||||
---___
|
||||
---@param Group Group Group to deactivate.
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.deactivateGroup(Group ) end
|
||||
|
||||
---Turns the specified groups AI on. Calls the Group.getController(setOnOff(true)) function. Only works with ground and ship groups.
|
||||
---___
|
||||
---@param Group Group Group to turn on AI (Ground and Ship only).
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setGroupAIOn(Group ) end
|
||||
|
||||
---Turns the specified groups AI off. Calls the Group.getController(setOnOff(false)) function. Only works with ground and ship groups.
|
||||
---___
|
||||
---@param Group Group Group to turn off AI (Ground and Ship only).
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.setGroupAIOff(Group ) end
|
||||
|
||||
---Orders the specified group to stop moving. Calls Group.getController(setCommand()) function and sets the stopRoute command to true. Only works with ground groups.
|
||||
---___
|
||||
---@param Group Group Group to stop moving (Ground only).
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.groupStopMoving(Group ) end
|
||||
|
||||
---Orders the specified group to resume moving. Calls Group.getController(setCommand()) function and sets the stopRoute command to false. Only works with ground groups.
|
||||
---___
|
||||
---@param Group Group Group to continue moving (Ground only).
|
||||
---@diagnostic disable-next-line:inject-field
|
||||
function trigger.action.groupContinueMoving(Group ) end
|
||||
Loading…
x
Reference in New Issue
Block a user