content
stringlengths
5
1.05M
mara_jade_outfit = { { {objectTemplate = "object/tangible/wearables/bodysuit/bodysuit_s15.iff", customizationVariables = {} } } } addOutfitGroup("mara_jade_outfit", mara_jade_outfit)
local AdminPlugin = require('vanilla.plugin'):new() function AdminPlugin:routerStartup(request, response) print_r('<pre>') if request.method == 'GET' then print_r('-----------' .. sprint_r(request.headers) .. '----------') else print_r(request.headers) end end function AdminPlugin:routerShutdown(request, response) end function AdminPlugin:dispatchLoopStartup(request, response) end function AdminPlugin:preDispatch(request, response) end function AdminPlugin:postDispatch(request, response) end function AdminPlugin:dispatchLoopShutdown(request, response) end return AdminPlugin
local ADDON_NAME = "GamePadHelper" local ADDON_VERSION = 1.01
-------------------------------------------------------------------------------- -- single-set_fail_on_first_error-true-suite.lua: suite used for full suite -- tests -- This file is a part of lua-nucleo library -- Copyright (c) lua-nucleo authors (see file `COPYRIGHT` for the license) -------------------------------------------------------------------------------- local make_suite = select(1, ...) local test = make_suite("single-set_fail_on_first_error-true-suite", { }) test:set_fail_on_first_error(true) test "fail_one" (function() suite_tests_results = suite_tests_results + 1 error("any error", 0) end) test "fail_two" (function() suite_tests_results = suite_tests_results + 10 error("any error", 0) end)
include('sky/lib/prelude') sky.use('sky/lib/device/arp') sky.use('sky/lib/device/switcher') sky.use('sky/lib/engine/polysub') sky.use('sky/lib/io/norns') sky.use('sky/lib/io/grid') sky.use('sky/lib/io/crow') sky.use('sky/lib/device/ui') --sky.use('sky/lib/device/es') sky.use('sky/lib/device/linn') local halfsecond = include('awake/lib/halfsecond') local util = require('util') local math = require('math') g = grid.connect() logger = sky.Logger{ filter = sky.is_clock, bypass = true } out1 = sky.CrowVoice{ } arp1 = sky.Group{ bypass = false, sky.Held{}, -- track held notes, emit on change sky.Pattern{}, -- generate pattern when held notes change sky.Arp{ -- generate notes from pattern mode = sky.ARP_QUEUE_MODE, }, } main = sky.Chain{ sky.GridGestureRegion{ --sky.esShapeGesture{}, sky.linnGesture{}, }, -- arp1, logger, sky.GridDisplay{ grid = g, sky.linnRender{}, }, out1, } in2 = sky.GridInput{ grid = g, chain = main, } clk = sky.Clock{ interval = sky.bpm_to_sec(120, 4), chain = main, } function init() halfsecond.init() -- halfsecond params:set('delay', 0.13) params:set('delay_rate', 0.95) params:set('delay_feedback', 0.27) -- polysub --params:set('amprel', 0.1) main:init() clk:start() end function redraw() screen.clear() screen.update() main:redraw() end function cleanup() main:cleanup() clk:cleanup() end
local misc = require 'forth.extra.misc' local reason = require 'forth.extra.reason' local function functor (interpreter) require 'forth.library.stack' (interpreter) require 'forth.library.word' (interpreter) require 'forth.library.world' (interpreter) require 'forth.library.system' (interpreter) require 'forth.library.module' (interpreter) require 'forth.library.math' (interpreter) require 'forth.library.exception' (interpreter) require 'forth.library.lua' (interpreter) require 'forth.library.collector' (interpreter) require 'forth.library.socket' (interpreter) require 'forth.library.runtime' (interpreter) require 'forth.library.memory' (interpreter) require 'forth.library.token' (interpreter) end return functor
function post() -- Block access for anyone who is not admin if not session:isLogged() or not session:isAdmin() then http:redirect("/") return end -- Install extension if http.postValues.install_extension then local extension = json:unmarshalFile(string.format("extensions/%s/extension.json", http.postValues.install_extension)) local successMessage = extension.id .. " has been installed." if extension.author == nil then extension.author = "Anonymous" end if extension.description == nil then extension.description = "-" end -- Run install script if file:exists(string.format("extensions/%s/install.lua", extension.id)) then local success = false try( function () -- Load file dofile(string.format("extensions/%s/install.lua", extension.id)) success, message = install() if success == false then error(message or "install function explicitly returned false but did not provide any message.") return end successMessage = string.format("Installed %s: %s", extension.id, message) end, -- Error function function (err) session:setFlash("validationError", string.format("Failed to install %s: %s", extension.id, err)) end ) -- Abort if install.lua failed if not success then http:redirect("/subtopic/admin/extensions/install") return end end -- Install extension base db:execute("INSERT INTO castro_extensions (name, id, version, description, author, type, installed, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, b'1', ?, ?)", extension.name, extension.id, extension.version, extension.description, extension.author, extension.type, os.time(), os.time()) -- Install Lua hooks if extension.hooks then for hook, script in pairs(extension.hooks) do db:execute("INSERT INTO castro_extension_hooks (extension_id, type, script, enabled) VALUES (?, ?, ?, b'1')", extension.id, hook, script) end end -- Install template hooks if extension.templateHooks then for hook, template in pairs(extension.templateHooks) do db:execute("INSERT INtO castro_extension_templatehooks (extension_id, type, template, enabled) VALUES (?, ?, ?, b'1')", extension.id, hook, template) end end -- Install pages if file:exists(string.format("extensions/%s/pages", extension.id)) then db:execute("INSERT INTO castro_extension_pages (extension_id, enabled) VALUES (?, b'1')", extension.id) end -- Install widgets if file:exists(string.format("extensions/%s/widgets", extension.id)) then db:execute("INSERT INTO castro_extension_widgets (extension_id, enabled) VALUES (?, b'1')", extension.id) end session:setFlash("success", successMessage) http:redirect("/subtopic/admin/extensions/install") return end -- Uninstall extension if http.postValues.uninstall_extension then local id = http.postValues.uninstall_extension -- Run uninstall.lua if file:exists(string.format("extensions/%s/uninstall.lua", id)) then try( function () -- Load file dofile(string.format("extensions/%s/uninstall.lua", id)) local success, message = uninstall() if success == false then error(message or "uninstall function explicitly returned false but did not provide any message.") return end session:setFlash("success", string.format("Uninstalled %s: %s", id, message or "")) end, -- Error function function (err) session:setFlash("validationError", string.format("Failed to execute uninstall script for %s: %s. The extension have been removed anyway.", id, err)) end ) end -- Remove extension db:execute("DELETE FROM castro_extensions WHERE id = ?", id) http:redirect("/subtopic/admin/extensions/install") return end end
-- tl_ops_set_state -- en : set node state -- zn : 更新服务/节点状态 -- @author iamtsm -- @email [email protected] local cjson = require("cjson"); cjson.encode_empty_table_as_object(false) local snowflake = require("lib.snowflake"); local tl_ops_rt = require("constant.tl_ops_constant_comm").tl_ops_rt; local tl_ops_utils_func = require("utils.tl_ops_utils_func"); local tl_ops_constant_health = require("constant.tl_ops_constant_health") local tl_ops_health_check_version = require("health.tl_ops_health_check_version") local cache_service = require("cache.tl_ops_cache"):new("tl-ops-service"); local tlog = require("utils.tl_ops_utils_log"):new("tl_ops_state"); local shared = ngx.shared.tlopsbalance local tl_ops_state_cmd, _ = tl_ops_utils_func:get_req_post_args_by_name("cmd", 1); if not tl_ops_state_cmd or tl_ops_state_cmd == nil then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"args err1", _); return; end local cmd_status = false; -- 暂停自检 if tl_ops_state_cmd == 'pause-health-check' then local tl_ops_state_service, _ = tl_ops_utils_func:get_req_post_args_by_name("service", 1); if not tl_ops_state_service or tl_ops_state_service == nil then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"args err2", _); return; end local uncheck_key = tl_ops_utils_func:gen_node_key(tl_ops_constant_health.cache_key.uncheck, tl_ops_state_service) local res, _ = shared:set(uncheck_key, true) if not res then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health set uncheck true failed ",_); return; end cmd_status = true; end -- 重启自检 if tl_ops_state_cmd == 'un-pause-health-check' then local tl_ops_state_service, _ = tl_ops_utils_func:get_req_post_args_by_name("service", 1); if not tl_ops_state_service or tl_ops_state_service == nil then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"args err3", _); return; end local uncheck_key = tl_ops_utils_func:gen_node_key(tl_ops_constant_health.cache_key.uncheck, tl_ops_state_service) local res, _ = shared:set(uncheck_key, false) if not res then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health set uncheck false failed ",_); return; end cmd_status = true; end -- 下线服务节点 if tl_ops_state_cmd == 'offline-service-node' then local tl_ops_state_service, _ = tl_ops_utils_func:get_req_post_args_by_name("service", 1); if not tl_ops_state_service or tl_ops_state_service == nil then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"args err4", _); return; end local tl_ops_state_node_id, _ = tl_ops_utils_func:get_req_post_args_by_name("node_index", 1); if not tl_ops_state_node_id or tl_ops_state_node_id == nil then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"args err5", _); return; end -- local success_key = tl_ops_utils_func:gen_node_key(tl_ops_constant_health.cache_key.success, tl_ops_state_service, tl_ops_state_node_id) -- res, _ = shared:get(success_key) -- if not res then -- tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health get success count failed ",_); -- return; -- end -- local failed_key = tl_ops_utils_func:gen_node_key(tl_ops_constant_health.cache_key.failed, tl_ops_state_service, tl_ops_state_node_id) -- res, _ = shared:get(failed_key) -- if not res then -- tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health get failed count failed ",_); -- return; -- end local state_key = tl_ops_utils_func:gen_node_key(tl_ops_constant_health.cache_key.state, tl_ops_state_service, tl_ops_state_node_id) local res, _ = shared:get(state_key) if not res then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health get state failed ",_); return; end local uncheck_key = tl_ops_utils_func:gen_node_key(tl_ops_constant_health.cache_key.uncheck, tl_ops_state_service) res, _ = shared:set(uncheck_key, true) if not res then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health set uncheck false failed ",_); return; end res, _ = shared:set(state_key, false) if not res then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health set state false failed ",_); return; end -- 通知conf更新 tl_ops_health_check_version.incr_service_version(tl_ops_state_service) -- res, _ = shared:set(success_key, 0) -- if not res then -- tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health set success 0 failed ",_); -- return; -- end -- res, _ = shared:set(failed_key, 0) -- if not res then -- tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health set failed 0 failed ",_); -- return; -- end cmd_status = true; end -- 上线服务所有节点 if tl_ops_state_cmd == 'online-service-node' then local tl_ops_state_service, _ = tl_ops_utils_func:get_req_post_args_by_name("service", 1); if not tl_ops_state_service or tl_ops_state_service == nil then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"args err4", _); return; end local tl_ops_state_node_id, _ = tl_ops_utils_func:get_req_post_args_by_name("node_index", 1); if not tl_ops_state_node_id or tl_ops_state_node_id == nil then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"args err5", _); return; end -- local success_key = tl_ops_utils_func:gen_node_key(tl_ops_constant_health.cache_key.success, tl_ops_state_service, tl_ops_state_node_id) -- res, _ = shared:get(success_key) -- if not res then -- tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health get success count failed ",_); -- return; -- end -- local failed_key = tl_ops_utils_func:gen_node_key(tl_ops_constant_health.cache_key.failed, tl_ops_state_service, tl_ops_state_node_id) -- res, _ = shared:get(failed_key) -- if not res then -- tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health get failed count failed ",_); -- return; -- end local uncheck_key = tl_ops_utils_func:gen_node_key(tl_ops_constant_health.cache_key.uncheck, tl_ops_state_service) local res, _ = shared:set(uncheck_key, false) if not res then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health set uncheck false failed ",_); return; end local state_key = tl_ops_utils_func:gen_node_key(tl_ops_constant_health.cache_key.state, tl_ops_state_service, tl_ops_state_node_id) res, _ = shared:set(state_key, true) if not res then tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health set state false failed ",_); return; end -- res, _ = shared:set(success_key, 0) -- if not res then -- tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health set success 0 failed ",_); -- return; -- end -- res, _ = shared:set(failed_key, 0) -- if not res then -- tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.args_error ,"health set failed 0 failed ",_); -- return; -- end cmd_status = true; end local res_data = {} res_data[tl_ops_state_cmd] = cmd_status tl_ops_utils_func:set_ngx_req_return_ok(tl_ops_rt.ok, "success", res_data)
exports.chat:RegisterCommand("a:revive", function(source, args, command, cb) local target = tonumber(args[1]) or source if not target or target == 0 or target < -1 then return end exports.log:Add({ source = source, target = target > 0 and target or nil, verb = "revived", noun = target == -1 and "all" or nil, channel = "admin", }) TriggerClientEvent("health:revive", target, true) end, { description = "Revive somebody.", parameters = { { name = "Target", description = "Who to revive?" }, } }, "Mod") exports.chat:RegisterCommand("a:slay", function(source, args, command, cb) local target = tonumber(args[1]) or source if not target or target == 0 or target < -1 then return end exports.log:Add({ source = source, target = target > 0 and target or nil, verb = "slayed", noun = target == -1 and "all" or nil, channel = "admin", }) TriggerClientEvent("health:slay", target) end, { description = "Slay somebody.", parameters = { { name = "Target", description = "Who to slay?" }, } }, "Mod") exports.chat:RegisterCommand("a:damagelog", function(source, args, command, cb) local target = tonumber(args[1]) or source local history = Main.history[target] if history then TriggerClientEvent("health:checkHistory", source, target, history) else cb("error", "Target does not exist or they haven't taken damage.") end end, { description = "View the damage log for a player.", parameters = { { name = "Target", description = "Player to view damage for." }, }, }, "Mod") exports.chat:RegisterCommand("a:damage", function(source, args, command, cb) local target = tonumber(args[1]) or source if not target or target == 0 or target < -1 then return end local weapon = args[2] and (tonumber(args[2]) or GetHashKey(args[2]:upper())) or GetHashKey("WEAPON_PISTOL") if not weapon then return end local bone = tonumber(args[3]) or args[3] if type(bone) == "string" then bone = bone:lower() for boneId, _bone in pairs(Config.Bones) do if _bone.Name:lower():find(bone) then bone = boneId end end end if not tonumber(bone) then bone = 11816 end exports.log:Add({ source = source, target = target > 0 and target or nil, verb = "damaged", noun = target == -1 and "all" or nil, extra = ("weapon: %s - bone: %s"):format(weapon, bone), channel = "admin", }) TriggerClientEvent("health:damage", target, weapon, bone) end, { description = "Do damage to somebody.", parameters = { { name = "Target", description = "Who are you damaging?" }, { name = "Weapon", description = "Which weapon is the source of damage (default = WEAPON_PISTOL)." }, { name = "Bone", description = "Which bone to apply to (default = pelvis)." }, } }, "Dev") exports.chat:RegisterCommand("a:armorup", function(source, args, command, cb) local target = tonumber(args[1]) or source if not target or target == 0 or target < -1 then return end local flag = 1 << (tonumber(args[2]) or 1) local amount = math.min(math.max(tonumber(args[3]) or 1.0, 0.0), 1.0) exports.log:Add({ source = source, target = target > 0 and target or nil, verb = "armored", noun = target == -1 and "all" or nil, extra = ("flag: %s - amount: %s"):format(flag, amount), channel = "admin", }) TriggerClientEvent("health:addArmor", target, flag) end, { description = "Force armor onto somebody.", parameters = { { name = "Target", description = "Person to give the armor to." }, { name = "Flag", description = "Where to add the armor (1 = normal, 2 = heavy, 3 = head, default = 1)." }, { name = "Amount", description = "How much armor to add (default = 1.0)." }, } }, "Dev") exports.chat:RegisterCommand("a:inflict", function(source, args, command, cb) local target = tonumber(args[1]) or source if not target or target == 0 or target < -1 then return end local name = args[2] if name then name = name:lower() for _, effect in pairs(Config.Effects) do if effect.Name:lower():find(name) then name = effect.Name break end end end local amount = math.min(math.max(tonumber(args[3]) or 1.0, -1.0), 1.0) exports.log:Add({ source = source, target = target > 0 and target or nil, verb = "inflicted", noun = target == -1 and "all" or nil, extra = ("effect: %s - amount: %s"):format(name or "all", amount), channel = "admin", }) TriggerClientEvent("health:addEffect", target, name, amount) end, { description = "Apply health effects.", parameters = { { name = "Target", description = "Person to add effect to." }, { name = "Name", description = "The name of the effect (default = all)." }, { name = "Amount", description = "Intensity of the effect (default = 1.0)." }, } }, "Dev") exports.chat:RegisterCommand("a:cure", function(source, args, command, cb) local target = tonumber(args[1]) or source if not target or target == 0 or target < -1 then return end exports.log:Add({ source = source, target = target > 0 and target or nil, verb = "cured", noun = target == -1 and "all" or nil, channel = "admin", }) TriggerClientEvent("health:resetEffects", target) end, { description = "Clear health effects.", parameters = { { name = "Target", description = "Person to clear effects for." }, } }, "Dev")
-------------------------------------------------------------------------------- -- Setup -------------------------------------------------------------------------------- -- Variables for config if not DriftOptions then DriftOptions = {} end local DriftOptionsPanel = {} DriftOptionsPanel.config = {} -- Variables for WoW version local isRetail = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) local isClassic = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) local isBCC = (WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC) -- Variables for slash commands local DRIFT = "DRIFT" SLASH_DRIFT1 = "/drift" local DRIFTRESET = "DRIFTRESET" SLASH_DRIFTRESET1 = "/driftreset" -------------------------------------------------------------------------------- -- Interface Options -------------------------------------------------------------------------------- -- Local functions local function createCheckbox(name, point, relativeFrame, relativePoint, xOffset, yOffset, text, tooltipText, onClickFunction) local checkbox = CreateFrame("CheckButton", name, relativeFrame, "ChatConfigCheckButtonTemplate") checkbox:SetPoint(point, relativeFrame, relativePoint, xOffset, yOffset) getglobal(checkbox:GetName() .. "Text"):SetText(text) checkbox.tooltip = tooltipText checkbox:SetScript("OnClick", onClickFunction) return checkbox end local function createButton(name, point, relativeFrame, relativePoint, xOffset, yOffset, width, height, text, tooltipText, onClickFunction) local button = CreateFrame("Button", name, relativeFrame, "GameMenuButtonTemplate") button:SetPoint(point, relativeFrame, relativePoint, xOffset, yOffset) button:SetSize(width, height) button:SetText(text) button:SetNormalFontObject("GameFontNormal") button:SetHighlightFontObject("GameFontHighlight") -- Configure tooltip button.tooltipText = tooltipText button:SetScript( "OnEnter", function() GameTooltip:SetOwner(button, "ANCHOR_TOPRIGHT") GameTooltip:SetText(button.tooltipText, nil, nil, nil, nil, true) end ) -- Configure click function button:SetScript("OnClick", onClickFunction) return button end -- Global functions function DriftHelpers:SetupConfig() -- Initialize config options if DriftOptions.frameDragIsLocked == nil then DriftOptions.frameDragIsLocked = DriftOptions.framesAreLocked end if DriftOptions.frameScaleIsLocked == nil then DriftOptions.frameScaleIsLocked = DriftOptions.framesAreLocked end if DriftOptions.windowsDisabled == nil then DriftOptions.windowsDisabled = false end if DriftOptions.bagsDisabled == nil then DriftOptions.bagsDisabled = true end if DriftOptions.buttonsDisabled == nil then DriftOptions.buttonsDisabled = true end if DriftOptions.minimapDisabled == nil then DriftOptions.minimapDisabled = true end if DriftOptions.objectivesDisabled == nil then DriftOptions.objectivesDisabled = true end if DriftOptions.playerChoiceDisabled == nil then DriftOptions.playerChoiceDisabled = true end if DriftOptions.arenaDisabled == nil then DriftOptions.arenaDisabled = true end if DriftOptions.miscellaneousDisabled == nil then DriftOptions.miscellaneousDisabled = true end -- Options panel DriftOptionsPanel.optionspanel = CreateFrame("Frame", "DriftOptionsPanel", UIParent) DriftOptionsPanel.optionspanel.name = "Drift" local driftOptionsTitle = DriftOptionsPanel.optionspanel:CreateFontString(nil, "BACKGROUND") driftOptionsTitle:SetFontObject("GameFontNormalLarge") driftOptionsTitle:SetText("Drift") driftOptionsTitle:SetPoint("TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, -15) InterfaceOptions_AddCategory(DriftOptionsPanel.optionspanel) -- Frame Dragging local lockMoveTitle = DriftOptionsPanel.optionspanel:CreateFontString(nil, "BACKGROUND") lockMoveTitle:SetFontObject("GameFontNormal") lockMoveTitle:SetText("Frame Dragging") lockMoveTitle:SetPoint("TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 190, -90) local yOffset = -110 DriftOptionsPanel.config.frameMoveLockedCheckbox = createCheckbox( "FrameMoveLockedCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 190, yOffset, " Lock Frame Dragging", "While frame dragging is locked, a modifier key must be pressed to drag a frame.", nil ) DriftOptionsPanel.config.frameMoveLockedCheckbox:SetChecked(DriftOptions.frameDragIsLocked) yOffset = yOffset - 30 DriftOptionsPanel.config.dragAltKeyEnabledCheckbox = createCheckbox( "DragAltKeyEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 205, yOffset, " ALT To Drag", "Whether ALT can be pressed while frame dragging is locked to drag a frame.", nil ) DriftOptionsPanel.config.dragAltKeyEnabledCheckbox:SetChecked(DriftOptions.dragAltKeyEnabled) yOffset = yOffset - 30 DriftOptionsPanel.config.dragCtrlKeyEnabledCheckbox = createCheckbox( "DragCtrlKeyEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 205, yOffset, " CTRL To Drag", "Whether CTRL can be pressed while frame dragging is locked to drag a frame.", nil ) DriftOptionsPanel.config.dragCtrlKeyEnabledCheckbox:SetChecked(DriftOptions.dragCtrlKeyEnabled) yOffset = yOffset - 30 DriftOptionsPanel.config.dragShiftKeyEnabledCheckbox = createCheckbox( "DragShiftKeyEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 205, yOffset, " SHIFT To Drag", "Whether SHIFT can be pressed while frame dragging is locked to drag a frame.", nil ) DriftOptionsPanel.config.dragShiftKeyEnabledCheckbox:SetChecked(DriftOptions.dragShiftKeyEnabled) yOffset = yOffset - 40 -- Frame Scaling local lockScaleTitle = DriftOptionsPanel.optionspanel:CreateFontString(nil, "BACKGROUND") lockScaleTitle:SetFontObject("GameFontNormal") lockScaleTitle:SetText("Frame Scaling") lockScaleTitle:SetPoint("TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 190, yOffset) yOffset = yOffset - 20 DriftOptionsPanel.config.frameScaleLockedCheckbox = createCheckbox( "FrameScaleLockedCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 190, yOffset, " Lock Frame Scaling", "While frame scaling is locked, a modifier key must be pressed to scale a frame.", nil ) DriftOptionsPanel.config.frameScaleLockedCheckbox:SetChecked(DriftOptions.frameScaleIsLocked) yOffset = yOffset - 30 DriftOptionsPanel.config.scaleAltKeyEnabledCheckbox = createCheckbox( "ScaleAltKeyEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 205, yOffset, " ALT To Scale", "Whether ALT can be pressed while frame scaling is locked to scale a frame.", nil ) DriftOptionsPanel.config.scaleAltKeyEnabledCheckbox:SetChecked(DriftOptions.scaleAltKeyEnabled) yOffset = yOffset - 30 DriftOptionsPanel.config.scaleCtrlKeyEnabledCheckbox = createCheckbox( "ScaleCtrlKeyEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 205, yOffset, " CTRL To Scale", "Whether CTRL can be pressed while frame scaling is locked to scale a frame.", nil ) DriftOptionsPanel.config.scaleCtrlKeyEnabledCheckbox:SetChecked(DriftOptions.scaleCtrlKeyEnabled) yOffset = yOffset - 30 DriftOptionsPanel.config.scaleShiftKeyEnabledCheckbox = createCheckbox( "ScaleShiftKeyEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 205, yOffset, " SHIFT To Scale", "Whether SHIFT can be pressed while frame scaling is locked to scale a frame.", nil ) DriftOptionsPanel.config.scaleShiftKeyEnabledCheckbox:SetChecked(DriftOptions.scaleShiftKeyEnabled) -- Enabled Frames local frameToggleTitle = DriftOptionsPanel.optionspanel:CreateFontString(nil, "BACKGROUND") frameToggleTitle:SetFontObject("GameFontNormal") frameToggleTitle:SetText("Enabled Frames") frameToggleTitle:SetPoint("TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, -90) yOffset = -110 DriftOptionsPanel.config.windowsEnabledCheckbox = createCheckbox( "WindowsEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, yOffset, " Windows", "Whether Drift will modify Windows (example: Talents).", nil ) DriftOptionsPanel.config.windowsEnabledCheckbox:SetChecked(not DriftOptions.windowsDisabled) yOffset = yOffset - 30 DriftOptionsPanel.config.bagsEnabledCheckbox = createCheckbox( "BagsEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, yOffset, " Bags", "Whether Drift will modify Bags.", nil ) DriftOptionsPanel.config.bagsEnabledCheckbox:SetChecked(not DriftOptions.bagsDisabled) yOffset = yOffset - 30 DriftOptionsPanel.config.buttonsEnabledCheckbox = createCheckbox( "ButtonsEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, yOffset, " Buttons", "Whether Drift will modify Buttons (example: Open Ticket).", nil ) DriftOptionsPanel.config.buttonsEnabledCheckbox:SetChecked(not DriftOptions.buttonsDisabled) yOffset = yOffset - 30 DriftOptionsPanel.config.minimapEnabledCheckbox = createCheckbox( "MinimapEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, yOffset, " Minimap", "Whether Drift will modify the Minimap.", nil ) DriftOptionsPanel.config.minimapEnabledCheckbox:SetChecked(not DriftOptions.minimapDisabled) yOffset = yOffset - 30 local objectivesTitle = " Objective Tracker" local objectivesDesc = "Whether Drift will modify the Objective Tracker." if (isClassic or isBCC) then objectivesTitle = " Quest Watch List" objectivesDesc = "Whether Drift will modify the Quest Watch List." end DriftOptionsPanel.config.objectivesEnabledCheckbox = createCheckbox( "ObjectivesEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, yOffset, objectivesTitle, objectivesDesc, nil ) DriftOptionsPanel.config.objectivesEnabledCheckbox:SetChecked(not DriftOptions.objectivesDisabled) yOffset = yOffset - 30 if (isRetail) then DriftOptionsPanel.config.playerChoiceEnabledCheckbox = createCheckbox( "PlayerChoiceEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, yOffset, " Player Choice", "Whether Drift will modify the Player Choice Frame.", nil ) DriftOptionsPanel.config.playerChoiceEnabledCheckbox:SetChecked(not DriftOptions.playerChoiceDisabled) yOffset = yOffset - 30 DriftOptionsPanel.config.arenaEnabledCheckbox = createCheckbox( "ArenaEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, yOffset, " Arena", "Whether Drift will modify Arena Frames.", nil ) DriftOptionsPanel.config.arenaEnabledCheckbox:SetChecked(not DriftOptions.arenaDisabled) yOffset = yOffset - 30 end DriftOptionsPanel.config.miscellaneousEnabledCheckbox = createCheckbox( "MiscellaneousEnabledCheckbox", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, yOffset, " Miscellaneous", "Whether Drift will modify Miscellaneous Frames (example: Battle.net Toast).", nil ) DriftOptionsPanel.config.miscellaneousEnabledCheckbox:SetChecked(not DriftOptions.miscellaneousDisabled) -- Reset button StaticPopupDialogs["DRIFT_RESET_POSITIONS"] = { text = "Are you sure you want to reset position and scale for all modified frames?", button1 = "Yes", button2 = "No", OnAccept = DriftHelpers.DeleteDriftState, timeout = 0, whileDead = true, hideOnEscape = true, preferredIndex = 3, -- avoid UI taint } DriftOptionsPanel.config.resetButton = createButton( "ResetButton", "TOPLEFT", DriftOptionsPanel.optionspanel, "TOPLEFT", 15, -47, 132, 25, "Reset Frames", "Reset position and scale for all modified frames.", function (self, button, down) StaticPopup_Show("DRIFT_RESET_POSITIONS") end ) -- Version and author local driftOptionsVersionLabel = DriftOptionsPanel.optionspanel:CreateFontString(nil, "BACKGROUND") driftOptionsVersionLabel:SetFontObject("GameFontNormal") driftOptionsVersionLabel:SetText("Version:") driftOptionsVersionLabel:SetJustifyH("LEFT") driftOptionsVersionLabel:SetPoint("BOTTOMLEFT", DriftOptionsPanel.optionspanel, "BOTTOMLEFT", 15, 30) local driftOptionsVersionContent = DriftOptionsPanel.optionspanel:CreateFontString(nil, "BACKGROUND") driftOptionsVersionContent:SetFontObject("GameFontHighlight") driftOptionsVersionContent:SetText(GetAddOnMetadata("Drift", "Version")) driftOptionsVersionContent:SetJustifyH("LEFT") driftOptionsVersionContent:SetPoint("BOTTOMLEFT", DriftOptionsPanel.optionspanel, "BOTTOMLEFT", 70, 30) local driftOptionsAuthorLabel = DriftOptionsPanel.optionspanel:CreateFontString(nil, "BACKGROUND") driftOptionsAuthorLabel:SetFontObject("GameFontNormal") driftOptionsAuthorLabel:SetText("Author:") driftOptionsAuthorLabel:SetJustifyH("LEFT") driftOptionsAuthorLabel:SetPoint("BOTTOMLEFT", DriftOptionsPanel.optionspanel, "BOTTOMLEFT", 15, 15) local driftOptionsAuthorContent = DriftOptionsPanel.optionspanel:CreateFontString(nil, "BACKGROUND") driftOptionsAuthorContent:SetFontObject("GameFontHighlight") driftOptionsAuthorContent:SetText("Jared Wasserman") driftOptionsAuthorContent:SetJustifyH("LEFT") driftOptionsAuthorContent:SetPoint("BOTTOMLEFT", DriftOptionsPanel.optionspanel, "BOTTOMLEFT", 70, 15) -- Update logic DriftOptionsPanel.optionspanel.okay = function (self) local shouldReloadUI = false -- Dragging DriftOptions.frameDragIsLocked = DriftOptionsPanel.config.frameMoveLockedCheckbox:GetChecked() DriftOptions.dragAltKeyEnabled = DriftOptionsPanel.config.dragAltKeyEnabledCheckbox:GetChecked() DriftOptions.dragCtrlKeyEnabled = DriftOptionsPanel.config.dragCtrlKeyEnabledCheckbox:GetChecked() DriftOptions.dragShiftKeyEnabled = DriftOptionsPanel.config.dragShiftKeyEnabledCheckbox:GetChecked() -- Scaling DriftOptions.frameScaleIsLocked = DriftOptionsPanel.config.frameScaleLockedCheckbox:GetChecked() DriftOptions.scaleAltKeyEnabled = DriftOptionsPanel.config.scaleAltKeyEnabledCheckbox:GetChecked() DriftOptions.scaleCtrlKeyEnabled = DriftOptionsPanel.config.scaleCtrlKeyEnabledCheckbox:GetChecked() DriftOptions.scaleShiftKeyEnabled = DriftOptionsPanel.config.scaleShiftKeyEnabledCheckbox:GetChecked() -- Optional Frames local oldWindowsDisabled = DriftOptions.windowsDisabled DriftOptions.windowsDisabled = not DriftOptionsPanel.config.windowsEnabledCheckbox:GetChecked() if oldWindowsDisabled ~= DriftOptions.windowsDisabled then shouldReloadUI = true end local oldBagsDisabled = DriftOptions.bagsDisabled DriftOptions.bagsDisabled = not DriftOptionsPanel.config.bagsEnabledCheckbox:GetChecked() if oldBagsDisabled ~= DriftOptions.bagsDisabled then if DriftOptions.bagsDisabled then -- Fix bag lua errors for i=1,13 do _G['ContainerFrame'..i]:ClearAllPoints() _G['ContainerFrame'..i]:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) end end shouldReloadUI = true end local oldButtonsDisabled = DriftOptions.buttonsDisabled DriftOptions.buttonsDisabled = not DriftOptionsPanel.config.buttonsEnabledCheckbox:GetChecked() if oldButtonsDisabled ~= DriftOptions.buttonsDisabled then shouldReloadUI = true end local oldMinimapDisabled = DriftOptions.minimapDisabled DriftOptions.minimapDisabled = not DriftOptionsPanel.config.minimapEnabledCheckbox:GetChecked() if oldMinimapDisabled ~= DriftOptions.minimapDisabled then shouldReloadUI = true end local oldObjectivesDisabled = DriftOptions.objectivesDisabled DriftOptions.objectivesDisabled = not DriftOptionsPanel.config.objectivesEnabledCheckbox:GetChecked() if oldObjectivesDisabled ~= DriftOptions.objectivesDisabled then shouldReloadUI = true end if (isRetail) then local oldPlayerChoiceDisabled = DriftOptions.playerChoiceDisabled DriftOptions.playerChoiceDisabled = not DriftOptionsPanel.config.playerChoiceEnabledCheckbox:GetChecked() if oldPlayerChoiceDisabled ~= DriftOptions.playerChoiceDisabled then shouldReloadUI = true end local oldArenaDisabled = DriftOptions.arenaDisabled DriftOptions.arenaDisabled = not DriftOptionsPanel.config.arenaEnabledCheckbox:GetChecked() if oldArenaDisabled ~= DriftOptions.arenaDisabled then shouldReloadUI = true end end local oldMiscellaneousDisabled = DriftOptions.miscellaneousDisabled DriftOptions.miscellaneousDisabled = not DriftOptionsPanel.config.miscellaneousEnabledCheckbox:GetChecked() if oldMiscellaneousDisabled ~= DriftOptions.miscellaneousDisabled then shouldReloadUI = true end -- Reload if needed if shouldReloadUI then ReloadUI() end end -- Cancel logic DriftOptionsPanel.optionspanel.cancel = function (self) -- Dragging DriftOptionsPanel.config.frameMoveLockedCheckbox:SetChecked(DriftOptions.frameDragIsLocked) DriftOptionsPanel.config.dragAltKeyEnabledCheckbox:SetChecked(DriftOptions.dragAltKeyEnabled) DriftOptionsPanel.config.dragCtrlKeyEnabledCheckbox:SetChecked(DriftOptions.dragCtrlKeyEnabled) DriftOptionsPanel.config.dragShiftKeyEnabledCheckbox:SetChecked(DriftOptions.dragShiftKeyEnabled) -- Scaling DriftOptionsPanel.config.frameScaleLockedCheckbox:SetChecked(DriftOptions.frameScaleIsLocked) DriftOptionsPanel.config.scaleAltKeyEnabledCheckbox:SetChecked(DriftOptions.scaleAltKeyEnabled) DriftOptionsPanel.config.scaleCtrlKeyEnabledCheckbox:SetChecked(DriftOptions.scaleCtrlKeyEnabled) DriftOptionsPanel.config.scaleShiftKeyEnabledCheckbox:SetChecked(DriftOptions.scaleShiftKeyEnabled) -- Optional Frames DriftOptionsPanel.config.windowsEnabledCheckbox:SetChecked(not DriftOptions.windowsDisabled) DriftOptionsPanel.config.bagsEnabledCheckbox:SetChecked(not DriftOptions.bagsDisabled) DriftOptionsPanel.config.buttonsEnabledCheckbox:SetChecked(not DriftOptions.buttonsDisabled) DriftOptionsPanel.config.minimapEnabledCheckbox:SetChecked(not DriftOptions.minimapDisabled) DriftOptionsPanel.config.objectivesEnabledCheckbox:SetChecked(not DriftOptions.objectivesDisabled) if (isRetail) then DriftOptionsPanel.config.playerChoiceEnabledCheckbox:SetChecked(not DriftOptions.playerChoiceDisabled) DriftOptionsPanel.config.arenaEnabledCheckbox:SetChecked(not DriftOptions.arenaDisabled) end DriftOptionsPanel.config.miscellaneousEnabledCheckbox:SetChecked(not DriftOptions.miscellaneousDisabled) end end -------------------------------------------------------------------------------- -- Slash Commands -------------------------------------------------------------------------------- SlashCmdList[DRIFT] = function(msg, editBox) DriftHelpers:HandleSlashCommands(msg, editBox) end SlashCmdList[DRIFTRESET] = DriftHelpers.DeleteDriftState
--[[---------------------------------------------------------------------------- Application Name: ColorBlobLength Description: Finding blue plastic tubes and measuring their lengths. How to Run: Starting this sample is possible either by running the app (F5) or debugging (F7+F10). Setting breakpoint on the first row inside the 'main' function allows debugging step-by-step after 'Engine.OnStarted' event. Results can be seen in the image viewer on the DevicePage. To run this sample a device with SICK Algorithm API is necessary. For example InspectorP or SIM4000 with latest firmware. Alternatively the Emulator on AppStudio 2.2 or higher can be used. More Information: Tutorial "Algorithms - Color". ------------------------------------------------------------------------------]] --Start of Global Scope--------------------------------------------------------- -- Delay in ms between visualization steps for demonstration purpose local DELAY = 500 -- Create viewer local viewer = View.create() -- Setup graphical overlay attributes local decoration = View.ShapeDecoration.create() decoration:setLineColor(0, 230, 0) -- Green decoration:setLineWidth(3) decoration:setFillColor(0, 0, 230, 128) -- Transparent blue local textDec = View.TextDecoration.create() textDec:setSize(40) textDec:setPosition(20, 50) --End of Global Scope----------------------------------------------------------- --Start of Function and Event Scope--------------------------------------------- -- Viewing image with text label --@show(img:Image, name:string) local function show(img, name) viewer:clear() local imid = viewer:addImage(img) viewer:addText(name, textDec, nil, imid) viewer:present() Script.sleep(DELAY * 2) -- for demonstration purpose only end local function main() local img = Image.load('resources/ColorBlobLength.bmp') show(img, 'Input image') -- Converting to HSV color space (Hue, Saturation, Value) local H, S, V = img:toHSV() show(H, 'Hue') -- View image with text label and delay show(S, 'Saturation') show(V, 'Value') -- Threshold on brightness and hue to find blue regions local allRegion = V:threshold(100, 255) show(allRegion:toImage(V), 'Bright regions') local blueRegion = H:threshold(100, 120, allRegion) show(blueRegion:toImage(H), 'Blue regions') -- Labelling blue objects (blobs) local blueObjects = blueRegion:findConnected(100) -- Measuring length and drawing bounding box viewer:clear() local imid = viewer:addImage(img) textDec:setSize(20) for i = 1, #blueObjects do local minRectangle = blueObjects[i]:getBoundingBoxOriented(H) local center, width, height, _ = minRectangle:getRectangleParameters() local longSide = math.max(width, height) local label = math.floor(longSide * 10) / 10 textDec:setPosition(center:getX(), center:getY()) -- Draw feedback overlay viewer:addShape(minRectangle, decoration, nil, imid) viewer:addText(tostring(label), textDec, nil, imid) viewer:present() -- presenting single steps print('Length ' .. i .. ': ' .. label) Script.sleep(DELAY) -- for demonstration purpose only end print('App finished.') end --The following registration is part of the global scope which runs once after startup --Registration of the 'main' function to the 'Engine.OnStarted' event Script.register('Engine.OnStarted', main) --End of Function and Event Scope--------------------------------------------------
--[[ Copyright 2019 Manticore Games, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --]] -- Internal custom properties local WEAPON = script:FindAncestorByType('Weapon') if not WEAPON:IsA('Weapon') then error(script.name .. " should be part of Weapon object hierarchy.") end local ENABLE_AIM_SOUND = script:GetCustomProperty("EnableAimSound"):WaitForObject() local DISABLE_AIM_SOUND = script:GetCustomProperty("DisableAimSound"):WaitForObject() -- Constant variables local LOCAL_PLAYER = Game.GetLocalPlayer() function OnWeaponAim(player, isAiming) if not Object.IsValid(ENABLE_AIM_SOUND) then return end if not Object.IsValid(DISABLE_AIM_SOUND) then return end if WEAPON.owner ~= player or player ~= LOCAL_PLAYER then return end if isAiming then ENABLE_AIM_SOUND:Play() else DISABLE_AIM_SOUND:Play() end end Events.Connect("WeaponAiming", OnWeaponAim)
local oneline_if = function(self, node) return self:process_block_oneline('if ', node, ' then') end local multiline_if = function(self, node) return self:process_block_multiline('if', node, 'then') end local oneline_elseif = function(self, node) return self:process_block_oneline('elseif ', node, ' then') end local multiline_elseif = function(self, node) return self:process_block_multiline('elseif', node, 'then') end return function(self, node) local printer = self.printer printer:request_clean_line() if not self:variate(node.if_part.condition, oneline_if, multiline_if) then return end printer:request_clean_line() if not self:process_block(node.if_part.body) then return end if node.elseif_parts then for i = 1, #node.elseif_parts do printer:request_clean_line() if not self:variate( node.elseif_parts[i].condition, oneline_elseif, multiline_elseif ) then return end printer:request_clean_line() if not self:process_block(node.elseif_parts[i].body) then return end end end if node.else_part then printer:request_clean_line() if not self:process_block_multiline('else', node.else_part.body) then return end end printer:request_clean_line() self.printer:add_curline('end') return true end
-- Damage over time that all cysts take when not connected kCystUnconnectedDamage = 6 -- was 12
-- Defer looking up an entity in a persisted entity ID table to preserve uniqueness. return function(entity_id, world_table) return function() return world_table[entity_id] end end
local hotkey = require 'hs.hotkey' local function module_init() local mash = config:get("lock.mash", { "ctrl","cmd" }) local key = config:get("lock.key", "L") hotkey.bind(mash, key, function() os.execute("/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend") end) end return { init = module_init }
set = set or {} function set.table(s) local t = { } for v, _ in pairs(s) do table.insert(t,v) end return t end
-- Liro - shared.lua -- Declare gamemode information -- Change these to your gamemodes information, feel free to remove credit for Liro if you wish. -- GM.Name will display as the gamemode name in the new server browser. -- Do not edit GM.LiroVersion, this is used for Liro version checking and verification of the base. -- It is recommended to make use of Semantic Versioning with GM.Version, this will help you distribute your Liro gamemode better. (semver.org/) -- The foldername of your gamemode will determine which server gamemode category it is in, common ones are ttt, darkrp or starwarsrp. GM.Name = "Liro" GM.Author = "Alydus" GM.Email = "" GM.Website = "https://github.com/Alydus/liro" GM.Version = "0.0.1" GM.LiroVersion = "2.1" team.SetUp(1, "Cadet", Color(125, 125, 125, 255), isJoinable=true)
local GAME_ROOT_POSITION = vec3 (400, -300, 0) local GAME_ROOT_SCALE = vec3 (710, 710, 1) local FIELD_OFFSET = vec3 (0.233, 0, 0) local INPUT_ATTACHMENT_NAME = "Balls" local LEFT_PLAYER_MANA_BOTTLE_POSITION = vec3 (-0.46, -0.295, 1) local RIGHT_PLAYER_MANA_BOTTLE_POSITION = vec3 (0.375, -0.39, 1) local game_paused = nil --пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅ пїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ BallsMinigameState = BallsMinigameState or {} UIControlScript = UIControlScript or {} local frames_count = 0 local time = 0 function balls_minigame_idle_handler (dt) if game_paused then return end time = time + dt frames_count = frames_count + 1 if (time > 2) then local window=WindowManager.GetWindowByName("Minigame_Balls") if window then local bottles=window.GetControlByName("FPS") bottles.SetCaption (string.format ("%3.0f", frames_count / time)) end time = 0 frames_count = 0 end BallsMinigameState.right_game_field:ProcessAnimation (dt) BallsMinigameState.left_game_field:ProcessAnimation (dt) if (BallsMinigameState.ai) then BallsMinigameState.ai:Update (dt) end if (BallsMinigameState.mana_bottle_animation) then BallsMinigameState.mana_bottle_animation:Process (dt) end end UIControlScript["RunBallsMinigame"] = function() Engine.InputEventHandlers.Register (INPUT_ATTACHMENT_NAME, Input.CreateEventHandler ()) BallsMinigameState.action_queue = Common.ActionQueue.Create () BallsMinigameState.idle_connection = BallsMinigameState.action_queue:RegisterEventHandler (Common.ActionQueue.CreateEventHandler ("balls_minigame_idle_handler")) BallsMinigameState.left_game_field = BallsMinigameState.GameField.Create () BallsMinigameState.right_game_field = BallsMinigameState.GameField.Create () BallsMinigameState.Root = Scene.Node.Create () BallsMinigameState.Root.Position = GAME_ROOT_POSITION BallsMinigameState.Root.Scale = GAME_ROOT_SCALE BallsMinigameState.Root:BindToParent (WindowManager.GetWindowByName ("Minigame_Balls").ForeNode) BallsMinigameState.left_player_mana_bottle = Scene.Node.Create () BallsMinigameState.left_player_mana_bottle.Name = "LeftPlayerManaBottle" BallsMinigameState.left_player_mana_bottle.Position = LEFT_PLAYER_MANA_BOTTLE_POSITION BallsMinigameState.left_player_mana_bottle:BindToParent (BallsMinigameState.Root) BallsMinigameState.right_player_mana_bottle = Scene.Node.Create () BallsMinigameState.right_player_mana_bottle.Name = "RightPlayerManaBottle" BallsMinigameState.right_player_mana_bottle.Position = RIGHT_PLAYER_MANA_BOTTLE_POSITION BallsMinigameState.right_player_mana_bottle:BindToParent (BallsMinigameState.Root) BallsMinigameState.left_game_field.root:BindToParent (BallsMinigameState.Root) BallsMinigameState.right_game_field.root:BindToParent (BallsMinigameState.Root) BallsMinigameState.left_game_field.root.Position = -FIELD_OFFSET BallsMinigameState.right_game_field.root.Position = FIELD_OFFSET for i = 0, 4, 1 do for j = 5, 9, 1 do BallsMinigameState.left_game_field:GenerateBallAtCoords (i, j) BallsMinigameState.right_game_field:GenerateBallAtCoords (i, j) end end BallsMinigameState.left_game_field:CheckMatches () BallsMinigameState.right_game_field:CheckMatches () BallsMinigameState.left_game_field.opponent = BallsMinigameState.right_game_field BallsMinigameState.right_game_field.opponent = BallsMinigameState.left_game_field BallsMinigameState.ai = BallsMinigameState.AI.Create (BallsMinigameState.left_game_field, Game.Player.ManaBottles) game_paused = false end UIControlScript["ShutdownBallsMinigame"] = function() if not BallsMinigameState.idle_connection then return end Engine.InputEventHandlers.Unregister (INPUT_ATTACHMENT_NAME) BallsMinigameState.idle_connection:Disconnect () BallsMinigameState.action_queue = nil BallsMinigameState.idle_connection = nil BallsMinigameState.left_game_field = nil BallsMinigameState.right_game_field = nil BallsMinigameState.Root = nil BallsMinigameState.ai = nil collectgarbage ("collect") end UIControlScript["BallsMinigamePause"] = function() game_paused = true Engine.InputEventHandlers.Unregister (INPUT_ATTACHMENT_NAME) end UIControlScript["BallsMinigameUnpause"] = function() print ("Unpause") game_paused = false Engine.InputEventHandlers.Register (INPUT_ATTACHMENT_NAME, Input.CreateEventHandler ()) end
local TierIVETCVendorID = 43489 local TierIVETCLoop = { ["Stoff"] = {28477,28656,28511,28515,28517,28585,28652,28654,28670,28663,30675,30680,30684,28799,}, ["Leder"] = {28453,28545,28514,28655,28669,28750,28752,30676,30681,30685,28828,}, ["Schwere"] = {28503,28454,28567,28656,28610,28746,30677,30682,30686,28810,28778,}, ["Platte"] = {28502,28566,28569,28512,28733,28608,28747,30678,30683,30687,28795,28779,}, } -- Warrior = 1 -- -- Paladin = 2 -- -- Hunter = 3 -- -- Rogue = 4 -- -- Priest = 5 -- -- Death Knight = 6 -- -- Shaman = 7 -- -- Mage = 8 -- -- Warlock = 9 -- -- Druid = 11 -- local function TierIVETCVendor_OnGossip(event, player, object) player:GossipMenuAddItem(10, "R\195\188stung Kaufen", 0, 1) player:GossipSendMenu(99, object) end local function TierIVETCVendor_OnSelect(event, player, object, sender, intid, code, menuid) VendorRemoveAllItems(TierIVETCVendorID) player:GetClass() if (intid == 1) then if (player:GetClass() == 5) or (player:GetClass() == 8) or (player:GetClass() == 9) then for _, TIVCloth in ipairs (TierIVETCLoop.Stoff) do AddVendorItem(TierIVETCVendorID, TIVCloth, 0, 0, 0) end player:SendListInventory(object) end if (player:GetClass() == 4) or (player:GetClass() == 11) then for _, TIVLeather in ipairs (TierIVETCLoop.Leder) do AddVendorItem(TierIVETCVendorID, TIVLeather, 0, 0, 0) end player:SendListInventory(object) end if (player:GetClass() == 3) or (player:GetClass() == 7) then for _, TIVHeavy in ipairs (TierIVETCLoop.Schwere) do AddVendorItem(TierIVETCVendorID, TIVHeavy, 0, 0, 0) end player:SendListInventory(object) end if (player:GetClass() == 1) or (player:GetClass() == 2) or (player:GetClass() == 6) then for _, TIVPlate in ipairs (TierIVETCLoop.Platte) do AddVendorItem(TierIVETCVendorID, TIVPlate, 0, 0, 0) end player:SendListInventory(object) end end end RegisterCreatureGossipEvent(TierIVETCVendorID, 1, TierIVETCVendor_OnGossip) RegisterCreatureGossipEvent(TierIVETCVendorID, 2, TierIVETCVendor_OnSelect) ----------------------------------- --------[[Made by PassCody]]------- --[[Made for KappaLounge Repack]]-- -----------------------------------
local Gui = require("api.Gui") local Event = require("api.Event") local UiBar = require("api.gui.hud.UiBar") local UiBuffs = require("api.gui.hud.UiBuffs") local UiClock = require("api.gui.hud.UiClock") local UiGoldPlatinum = require("api.gui.hud.UiGoldPlatinum") local UiLevel = require("api.gui.hud.UiLevel") local UiMessageWindow = require("api.gui.hud.UiMessageWindow") local UiMinimap = require("api.gui.hud.UiMinimap") local UiStatsBar = require("api.gui.hud.UiStatsBar") local UiStatusEffects = require("api.gui.hud.UiStatusEffects") local UiSkillTracker = require("api.gui.hud.UiSkillTracker") local UiAutoTurn = require("api.gui.hud.UiAutoTurn") local UiDiagonalArrows = require("api.gui.hud.UiDiagonalArrows") local function add_default_widgets() Gui.add_hud_widget(UiMessageWindow:new(), "hud_message_window") Gui.add_hud_widget(UiStatusEffects:new(), "hud_status_effects") Gui.add_hud_widget(UiClock:new(), "hud_clock") Gui.add_hud_widget(UiSkillTracker:new(), "hud_skill_tracker") Gui.add_hud_widget(UiGoldPlatinum:new(), "hud_gold_platinum") Gui.add_hud_widget(UiLevel:new(), "hud_level") Gui.add_hud_widget(UiStatsBar:new(), "hud_stats_bar") Gui.add_hud_widget(UiMinimap:new(), "hud_minimap") Gui.add_hud_widget(UiBuffs:new(), "hud_buffs") Gui.add_hud_widget(UiAutoTurn:new(), "hud_auto_turn") Gui.add_hud_widget(UiDiagonalArrows:new(), "hud_diagonal_arrows") local position, refresh position = function(self, x, y, width, height) return math.floor((width - 84) / 2) - 100, height - (72 + 16) - 12 end refresh = function(self, player) self:set_data(player.hp, player:calc("max_hp")) end Gui.add_hud_widget(UiBar:new("hud_hp_bar", 0, 0, true), "hud_hp_bar", { position = position, refresh = refresh }) position = function(self, x, y, width, height) return math.floor((width - 84) / 2) + 40, height - (72 + 16) - 12 end refresh = function(self, player) self:set_data(player.mp, player:calc("max_mp")) end Gui.add_hud_widget(UiBar:new("hud_mp_bar", 0, 0, true), "hud_mp_bar", { position = position, refresh = refresh }) end Event.register("base.before_engine_init", "Add default widgets", add_default_widgets, {priority = 10000})
---@class Platform ---@field type string ---@field id string ---@field roadStation RoadStation ---@field platformNumber number local Platform = {} --- Creates a new Bus or Tram Station ---@param roadStation RoadStation a roadstation ---@param platformNumber number number of the platform starting with 1 ---@return Platform function Platform:new(roadStation, platformNumber) assert(type(roadStation) == "table", "Need 'roadStation' as RoadStation") assert(roadStation.type == "RoadStation", "Need 'roadStation' as RoadStation") assert(type(platformNumber) == "number", "Need 'platformNumber' as number") local o = {} o.type = "Platform" o.id = roadStation.name .. "#" .. platformNumber o.roadStation = roadStation o.platformNumber = platformNumber self.__index = self setmetatable(o, self) return o end function Platform:addDisplay(structureName, displayModel) self.roadStation:addDisplay(structureName, displayModel, self.platformNumber) end return Platform
local request = require("lib.request") local routes = { HEAD = {}, GET = {}, POST = {} } local function route(method, path, block) routes[method][path] = block end function head(path, block) route("HEAD", path, block) end function get(path, block) route("GET", path, block) route("HEAD", path, block) end function post(path, block) route("POST", path, block) end local function start_server() print("* Listening on http://" .. wifi.sta.getip()) print("== Sinatra has taken the stage") local server = net.createServer(net.TCP, 5) server:listen(80, function(connection) connection:on("receive", function(connection, data) print(data) r = request.parse(data) if routes[r.method] and routes[r.method][r.path] then connection:send("HTTP/1.1 200 OK\r\n") connection:send("Content-Type: text/html\r\n") connection:send("\r\n") connection:send(routes[r.method][r.path](r.params)) elseif routes[r.method] then connection:send("HTTP/1.1 404 Not Found\r\n") connection:send("\r\n") else connection:send("HTTP/1.1 501 Not Implemented\r\n") connection:send("\r\n") end end) connection:on("sent", function(connection) connection:close() end) end) end start_server()
--[[ This module implements some env setting ]] local tlast = require "typedlua/tlast" local tltype = require "typedlua/tltype" local tltAuto = require "typedlua/tltAuto" local tltable = require "typedlua/tltable" local tltPrime = require "typedlua/tltPrime" local tlutils = require "typedlua/tlutils" local tlenv = {} tlenv.G_IDENT_REFER = 1 tlenv.G_SCOPE_REFER = 1 tlenv.G_REGION_REFER = 1 function tlenv.GlobalEnv(vMainFileName) -- function & chunk ? -- auto table ? -- ident ? -- TODO add what node ??? local nNode = tlast.ident(0, "_G") nNode.l=0 nNode.c=0 -- nNode.type = tltPrime nNode.ident_refer = tlenv.G_IDENT_REFER local nGlobalEnv = { main_filename = vMainFileName, file_env_dict = {}, _G_node = nil, _G_ident = nil, define_dict = {}, scope_list = {}, region_list = nil, -- region_list = scope_list ident_list = {}, auto_list = {}, closure_list = {}, union_deduce_tree_list = {}, union_deduce_list = {} } nGlobalEnv.region_list = nGlobalEnv.scope_list -- create and set root scope local nRootScope = tlenv.create_region(nGlobalEnv, nil, nil, nNode) -- create and bind ident local nIdent = tlenv.create_ident(nGlobalEnv, nRootScope, nNode) nRootScope.record_dict["_G"] = tlenv.G_IDENT_REFER nRootScope.record_dict["_ENV"] = tlenv.G_IDENT_REFER -- put _G as auto type local nGlobalAuto = tltAuto.TableAuto(tltPrime) nNode.type = tlenv.region_push_auto(nGlobalEnv, tlenv.G_REGION_REFER, nGlobalAuto) nGlobalEnv.root_scope = nRootScope nGlobalEnv._G_node = nNode nGlobalEnv._G_ident = nIdent return nGlobalEnv end function tlenv.FileEnv(vSubject, vFileName) local nEnv = { info = { subject = vSubject, file_name = vFileName, link_define_list = {}, split_info_list = nil, ast = nil, }, cursor = { cur_node = nil, cur_scope = nil, cur_region = nil, }, -- meta in global root_scope = nil, define_dict = nil, scope_list = nil, region_list = nil, ident_list = nil, auto_list = nil, closure_list = nil, union_deduce_tree_list = nil, union_deduce_list = nil, } return nEnv end function tlenv.create_file_env(vGlobalEnv, vSubject, vFileName) local nFileEnv = tlenv.FileEnv(vSubject, vFileName) -- bind globalenv with fileenv setmetatable(nFileEnv, {__index=vGlobalEnv}) vGlobalEnv.file_env_dict[vFileName] = nFileEnv return nFileEnv end function tlenv.create_scope(vFileEnv, vCurScope, vNode) local nNewIndex = #vFileEnv.scope_list + 1 local nNextScope = { tag = "Scope", node = vNode, record_dict = vCurScope and setmetatable({}, { __index=vCurScope.record_dict }) or {}, scope_refer = nNewIndex, parent_scope_refer = vCurScope and vCurScope.scope_refer, } vFileEnv.scope_list[nNewIndex] = nNextScope -- if vCurScope then -- vCurScope[#vCurScope + 1] = nNextScope -- end return nNextScope end function tlenv.create_region(vFileEnv, vParentRegion, vCurScope, vNode) local nRegion = tlenv.create_scope(vFileEnv, vCurScope, vNode) nRegion.sub_tag = "Region" nRegion.region_refer = nRegion.scope_refer nRegion.auto_stack = {} nRegion.child_refer_list = {} if nRegion.region_refer ~= tlenv.G_REGION_REFER then vParentRegion.child_refer_list[#vParentRegion.child_refer_list + 1] = nRegion.region_refer nRegion.parent_region_refer = vParentRegion.region_refer else nRegion.parent_region_refer = false end return nRegion end function tlenv.create_ident(vFileEnv, vCurScope, vIdentNode) local nNewIndex = #vFileEnv.ident_list + 1 local nName if vIdentNode.tag == "Id" then nName = vIdentNode[1] elseif vIdentNode.tag == "Dots" then nName = "..." else error("ident type error:"..tostring(vIdentNode.tag)) end local nIdent = { tag = "IdentDefine", node=vIdentNode, ident_refer=nNewIndex, nName, nNewIndex, } vFileEnv.ident_list[nNewIndex] = nIdent vCurScope.record_dict[nIdent[1]] = nNewIndex vCurScope[#vCurScope + 1] = nIdent return nIdent end --@(FileEnv, integer, integer, AstNode) function tlenv.update_cursor(vFileEnv, vRegionRefer, vScopeRefer, vAstNode) local nCursor = vFileEnv.cursor nCursor.cur_scope = vFileEnv.scope_list[vScopeRefer] nCursor.cur_region = vFileEnv.region_list[vRegionRefer] nCursor.cur_node = vAstNode end function tlenv.reset_cursor(vFileEnv) local nCursor = vFileEnv.cursor nCursor.cur_scope = vFileEnv.scope_list[tlenv.G_SCOPE_REFER] nCursor.cur_region = vFileEnv.region_list[tlenv.G_REGION_REFER] nCursor.cur_node = vFileEnv._G_node end function tlenv.dump(vFileEnv) return tlutils.dumpLambda(vFileEnv.root_scope, function(child) if child.tag == "Scope" then return child.node, "", nil else return child.node, nil, table.concat(child, ",") end end) end function tlenv.region_push_auto(vFileEnv, vRegionRefer, vAutoType) local nRegion = vFileEnv.region_list[vRegionRefer] local nNewIndex = #nRegion.auto_stack + 1 nRegion.auto_stack[nNewIndex] = vAutoType vAutoType.def_region_refer = vRegionRefer vAutoType.def_index = nNewIndex vAutoType.run_region_refer = vRegionRefer vAutoType.run_index = nNewIndex return tltAuto.AutoLink(vRegionRefer, nNewIndex) end function tlenv.function_call(vFileEnv, vRunRegionRefer, vFunctionType) local nRunRegion = vFileEnv.region_list[vRunRegionRefer] local nFunctionOwnRegion = vFileEnv.region_list[vFunctionType.own_region_refer] local nClosureIndex = #nRunRegion.auto_stack + 1 local nClosure = { tag = "TClosure", own_region_refer = vFunctionType.own_region_refer, def_region_refer = vRunRegionRefer, def_index = nClosureIndex, run_region_refer = vRunRegionRefer, run_index = nClosureIndex, caller_auto_link = tltAuto.AutoLink(vFunctionType.run_region_refer, vFunctionType.run_index), } nRunRegion.auto_stack[nClosureIndex] = nClosure for i, nAutoType in ipairs(nFunctionOwnRegion.auto_stack) do local nNewIndex = #nRunRegion.auto_stack + 1 local nCopyType = nil if nAutoType.tag == "TAutoType" then if nAutoType.sub_tag == "TFunctionAuto" then nCopyType = tlenv.closure_copy_function(vFileEnv, nClosure, nAutoType) elseif nAutoType.sub_tag == "TTableAuto" then nCopyType = tlenv.closure_copy_table(vFileEnv, nClosure, nAutoType) else error("unexception auto sub type"..tostring(nAutoType.sub_tag)) end elseif nAutoType.tag == "TClosure" then nCopyType = { tag = "TClosure", def_region_refer = vRunRegionRefer, def_index = nNewIndex, caller_auto_link = tlenv.closure_relink(vFileEnv, nClosure, nAutoType.caller_auto_link), } end nRunRegion.auto_stack[nNewIndex] = nCopyType nCopyType.run_region_refer = vRunRegionRefer nCopyType.run_index = nNewIndex end if vFunctionType[1][2] then local nOutputTuple = tltype.Tuple() for i, nType in ipairs(vFunctionType[1][2]) do if nType.tag == "TAutoLink" then nOutputTuple[i] = tlenv.closure_relink(vFileEnv, nClosure, nType) else nOutputTuple[i] = nType end end return nOutputTuple else return tltype.Tuple() end end function tlenv.closure_copy_table(vFileEnv, vClosure, vTableAuto) if vTableAuto.sub_tag ~= "TTableAuto" then return vTableAuto end local nFieldList = {} for i, nField in ipairs(vTableAuto[1]) do local nFieldKey = nField[1] local nFieldValue = nField[2] if nFieldValue.tag == "TAutoLink" then nFieldValue = tlenv.closure_relink(vFileEnv, vClosure, nFieldValue) end nFieldList[i] = tltable.Field(nFieldKey, nFieldValue) end local nTableAuto = tltAuto.TableAuto(tltable.TableConstructor(table.unpack(nFieldList))) nTableAuto.auto_solving_state = tltAuto.AUTO_SOLVING_FINISH nTableAuto.def_region_refer = vTableAuto.def_region_refer nTableAuto.def_index = vTableAuto.def_index return nTableAuto end function tlenv.closure_copy_function(vFileEnv, vClosure, vFunctionAuto) if vFunctionAuto.sub_tag ~= "TFunctionAuto" then return vFunctionAuto end -- input is static type... local nInputTuple, nOutputTuple = vFunctionAuto[1][1], vFunctionAuto[1][2] if not nOutputTuple then print("auto function nil return...") else nOutputTuple = tltype.Tuple() for i, nType in ipairs(vFunctionAuto[1][2]) do if nType.tag == "TAutoLink" and nType.link_region_refer ~= vFunctionAuto.own_region_refer then nOutputTuple[i] = tlenv.closure_relink(vFileEnv, vClosure, nType) else nOutputTuple[i] = nType end end end local nCopyAuto = tltAuto.FunctionAuto( vFunctionAuto.own_region_refer, tltype.FunctionConstructor(nInputTuple, nOutputTuple)) nCopyAuto.auto_solving_state = tltAuto.AUTO_SOLVING_FINISH nCopyAuto.def_region_refer = vFunctionAuto.def_region_refer nCopyAuto.def_index = vFunctionAuto.def_index return nCopyAuto end -- change link from link-stack to link-closure-from-stack -- used place: -- 1. copy table, table field; -- 2. copy function, function return; -- 3. copy closure, closure caller; -- 4. function call, return; function tlenv.closure_relink(vFileEnv, vClosure, vAutoLink) assert(vAutoLink.tag == "TAutoLink", "closure_relink called with unexcept type:"..tostring(vAutoLink.tag)) local nClosure = vClosure while nClosure and (nClosure.own_region_refer ~= vAutoLink.link_region_refer) do local nCallerLink = nClosure.caller_auto_link local nCallerType = vFileEnv.region_list[nCallerLink.link_region_refer].auto_stack[nCallerLink.link_index] nClosure = tlenv.type_find_closure(vFileEnv, nCallerType) end local nLinkedType = nil if not nClosure then nLinkedType = vFileEnv.region_list[vAutoLink.link_region_refer].auto_stack[vAutoLink.link_index] -- return tltAuto.AutoLink(vAutoLink.link_region_refer, vAutoLink.link_index) else nLinkedType = tlenv.closure_index_type(vFileEnv, nClosure, vAutoLink.link_index) -- return tltAuto.AutoLink(nLinkedType.run_region_refer, nLinkedType.run_index) end if nLinkedType.tag == "TAutoType" then if nLinkedType.sub_tag == "TCastAuto" then return nLinkedType[1] else return tltAuto.AutoLink(nLinkedType.run_region_refer, nLinkedType.run_index) end else return nLinkedType end end function tlenv.closure_index_type(vFileEnv, vClosure, vIndex) return vFileEnv.region_list[vClosure.run_region_refer].auto_stack[vClosure.run_index + vIndex] end function tlenv.type_find_closure(vFileEnv, vType) local nClosureIndex = vType.run_index - vType.def_index if nClosureIndex > 0 then return vFileEnv.region_list[vType.run_region_refer].auto_stack[nClosureIndex] else return nil end end return tlenv
-- Online Interiors IPL Edits -- Use https://github.com/Bob74/bob74_ipl/wiki to edit below -- Clubhouse 1 (Sandy Shores) Citizen.CreateThread(function() -- Getting the object to interact with BikerClubhouse1 = exports['bob74_ipl']:GetBikerClubhouse1Object() -- Setting red bricked walls BikerClubhouse1.Walls.Set(BikerClubhouse1.Walls.brick, BikerClubhouse1.Walls.Color.red, true) -- Setting furnitures B (fabric couch and chairs) BikerClubhouse1.Furnitures.Set(BikerClubhouse1.Furnitures.B, 0, true) -- Setting the decoration BikerClubhouse1.Decoration.Set(BikerClubhouse1.Decoration.A, true) -- Setting the big painting on the wall BikerClubhouse1.Mural.Set(BikerClubhouse1.Mural.route68, true) -- Enabling gun locker BikerClubhouse1.GunLocker.Set(BikerClubhouse1.GunLocker.on, true) -- Enabling mod booth BikerClubhouse1.ModBooth.Set(BikerClubhouse1.ModBooth.on, true) -- Clubhouse details BikerClubhouse1.Meth.Set(BikerClubhouse1.Meth.none, true) BikerClubhouse1.Cash.Set(BikerClubhouse1.Cash.none, true) BikerClubhouse1.Coke.Set(BikerClubhouse1.Coke.none, true) BikerClubhouse1.Weed.Set(BikerClubhouse1.Weed.none, true) BikerClubhouse1.Counterfeit.Set(BikerClubhouse1.Counterfeit.none, true) BikerClubhouse1.Documents.Set(BikerClubhouse1.Documents.none, true) RefreshInterior(BikerClubhouse1.interiorId) end)
local rcs = table.deepcopy(data.raw["rail-chain-signal"]["rail-chain-signal"]) rcs.name = "rndLabs-rail-chain-signal" local rcsItem = table.deepcopy(data.raw["item"]["rail-chain-signal"]) rcsItem.name = "rndLabs-rail-chain-signal-item" rcsItem.icons = { { icon = rcsItem.icon, tint = {r=0, g=0, b=1, a=1} } } rcsItem.place_result = "rndLabs-rail-chain-signal" data:extend({ rcs, rcsItem, { --------- prop recipie ---------- type = "recipe", name = "rndLabs-rail-chain-signal-recipe", enabled = true, energy_required = 0.5, ingredients = { {"iron-plate", 1} }, result = "rndLabs-rail-chain-signal-item" } }) local rs = table.deepcopy(data.raw["rail-signal"]["rail-signal"]) rs.name = "rndLabs-rail-signal" local rsItem = table.deepcopy(data.raw["item"]["rail-signal"]) rsItem.name = "rndLabs-rail-signal-item" rsItem.icons = { { icon = rsItem.icon, tint = {r=0, g=0, b=1, a=1} } } rsItem.place_result = "rndLabs-rail-signal" data:extend({ rs, rsItem, { --------- prop recipie ---------- type = "recipe", name = "rndLabs-rail-signal-recipe", enabled = true, energy_required = 0.5, ingredients = { {"iron-plate", 1} }, result = "rndLabs-rail-signal-item" } })
if not util.Promise then return false end function sqlier.ModelBase:getAsync(identity, callback) return util.Promise(function(resolve, reject) self:get(identity, resolve) end) end function sqlier.ModelBase:findAsync(filter, callback) return util.Promise(function(resolve, reject) self:find(filter, resolve) end) end function sqlier.ModelBase:filterAsync(filter, callback) return util.Promise(function(resolve, reject) self:filter(filter, resolve) end) end function sqlier.InstanceBase:saveAsync() return util.Promise(function(resolve, reject) self:save(resolve) end) end function sqlier.InstanceBase:deleteAsync() return util.Promise(function(resolve, reject) self:delete(resolve) end) end
-- Testing gvt.call local gvt = require 'luagravity' local env = require 'luagravity.env.simple' gvt.loop(env.nextEvent, function () local tot = 0 local r = gvt.create(function() gvt.await(0.2) end) local a = gvt.create(function() tot=tot+1 gvt.await(0) end) local b = gvt.create(function() tot=tot+1 gvt.await(0) end) local c = gvt.create(function() tot=tot+1 gvt.await(0) end) local d = gvt.create(function() tot=tot+1 gvt.await(0) end) local e = gvt.create(function() tot=tot+1 gvt.await(0) end) local f = gvt.create(function() tot=tot+1 gvt.await(0) end) local g = gvt.create(function() tot=tot+1 gvt.await(0) end) local h = gvt.create(function() tot=tot+1 gvt.await(0) end) local i = gvt.create(function() tot=tot+1 gvt.await(0) end) gvt.link(r, a) gvt.link(r, b) gvt.link(r, c) gvt.link(r, d) gvt.link(r, e) gvt.link(r, f) gvt.link(r, g) gvt.link(r, h) gvt.link(r, i) gvt.call(r) assert(tot == 9, tot) end) print '===> OK'
local MegalodonAi = {} MegalodonAi.__index = MegalodonAi function MegalodonAi:new(actor) assert(actor, "Is needed a actor to manipulate") local this = setmetatable({ actor = actor, elapsedTime = 0 }, MegalodonAi) return this end function MegalodonAi:update(dt) end return MegalodonAi
local function run(msg, matches) local group = load_data('bot/group.json') local addgroup = group[tostring(msg.chat_id)] if matches[1] == 'setrules' and is_owner(msg) or is_momod(msg) and groupa then redis:set('rules'..msg.chat_id_,matches[2]) tg.sendMessage(msg.chat_id_, 0, 1, '<b>Group Rules Saved</b>', 1, 'html') end if matches[1] == 'rules' and is_owner(msg) or is_momod(msg) and addgroup then rules1 = redis:get('rules'..msg.chat_id_) tg.sendMessage(msg.chat_id_, 0, 1, '<b>Group Rules :</b>\n'..rules1 , 1, 'html') end end return { patterns = { "^[/#!](setrules) (.*)$", "^[/#!](rules)$" }, run = run } --@senator_tea
local ScreenManager = require( 'lib.screenmanager.ScreenManager' ) local Screen = require( 'src.ui.screens.Screen' ) local TexturePacks = require( 'src.ui.texturepacks.TexturePacks' ) local GridHelper = require( 'src.util.GridHelper' ) local UIBackground = require( 'src.ui.elements.UIBackground' ) local UIOutlines = require( 'src.ui.elements.UIOutlines' ) local Translator = require( 'src.util.Translator' ) local Settings = require( 'src.Settings' ) -- ------------------------------------------------ -- Module -- ------------------------------------------------ local HelpScreen = Screen:subclass( 'HelpScreen' ) -- ------------------------------------------------ -- Constants -- ------------------------------------------------ local UI_GRID_WIDTH = 64 local UI_GRID_HEIGHT = 48 local HELP_TEXT = { { text = 'CHARACTERS', color = 'ui_help_section', children = { 'NOTE: Characters can also be selected by right-clicking on them!', { 'prev_character' }, { 'next_character' }, { 'end_turn' }, { 'open_inventory_screen' }, { 'open_health_screen' } } }, { text = 'WEAPONS', color = 'ui_help_section', children = { { 'next_weapon_mode' }, { 'prev_weapon_mode' }, { 'action_reload_weapon' } } }, { text = 'STANCES', color = 'ui_help_section', children = { { 'action_stand' }, { 'action_crouch' }, { 'action_prone' } } }, { text = 'INPUT', color = 'ui_help_section', children = { { 'attack_mode' }, { 'movement_mode' }, { 'interaction_mode' } } } } -- ------------------------------------------------ -- Private Methods -- ------------------------------------------------ --- -- Wraps the text into a Text object. -- @treturn Text The text object. -- local function assembleText() local text = love.graphics.newText( TexturePacks.getFont():get() ) local tw, th = TexturePacks.getTileDimensions() local offset = 0 -- Draw sections first. for i = 1, #HELP_TEXT do text:addf({ TexturePacks.getColor( HELP_TEXT[i].color ), HELP_TEXT[i].text }, (UI_GRID_WIDTH-2) * tw, 'left', 0, offset * th ) offset = offset + 1 -- Draw sub items with a slight offset to the right. for j = 1, #HELP_TEXT[i].children do offset = offset + 1 if type( HELP_TEXT[i].children[j] ) == 'table' then text:addf( Settings.getKeybinding( Settings.INPUTLAYOUTS.COMBAT, HELP_TEXT[i].children[j][1] ), (UI_GRID_WIDTH-2) * tw, 'left', 4*tw, offset * th ) text:addf( Translator.getText( HELP_TEXT[i].children[j][1] ), (UI_GRID_WIDTH-2) * tw, 'left', 10*tw, offset * th ) else text:addf( HELP_TEXT[i].children[j], (UI_GRID_WIDTH-2) * tw, 'left', 4*tw, offset * th ) end end offset = offset + 2 end return text end --- -- Generates the outlines for this screen. -- @tparam number x The origin of the screen along the x-axis. -- @tparam number y The origin of the screen along the y-axis. -- @treturn UIOutlines The newly created UIOutlines instance. -- local function generateOutlines( x, y ) local outlines = UIOutlines( x, y, 0, 0, UI_GRID_WIDTH, UI_GRID_HEIGHT ) -- Horizontal borders. for ox = 0, UI_GRID_WIDTH-1 do outlines:add( ox, 0 ) -- Top outlines:add( ox, 2 ) -- Header outlines:add( ox, UI_GRID_HEIGHT-1 ) -- Bottom end -- Vertical outlines. for oy = 0, UI_GRID_HEIGHT-1 do outlines:add( 0, oy ) -- Left outlines:add( UI_GRID_WIDTH-1, oy ) -- Right end outlines:refresh() return outlines end -- ------------------------------------------------ -- Public Methods -- ------------------------------------------------ function HelpScreen:initialize() self.x, self.y = GridHelper.centerElement( UI_GRID_WIDTH, UI_GRID_HEIGHT ) self.background = UIBackground( self.x, self.y, 0, 0, UI_GRID_WIDTH, UI_GRID_HEIGHT ) self.outlines = generateOutlines( self.x, self.y ) self.text = assembleText() self.header = love.graphics.newText( TexturePacks.getFont():get(), Translator.getText( 'ui_help_header' )) end function HelpScreen:draw() self.background:draw() self.outlines:draw() local tw, th = TexturePacks.getTileDimensions() TexturePacks.setColor( 'ui_text' ) love.graphics.draw( self.header, (self.x+1) * tw, (self.y+1) * th ) love.graphics.draw( self.text, (self.x+1) * tw, (self.y+3) * th ) TexturePacks.resetColor() end function HelpScreen:keypressed( key ) if key == 'escape' then ScreenManager.pop() end end function HelpScreen:resize( _, _ ) self.x, self.y = GridHelper.centerElement( UI_GRID_WIDTH, UI_GRID_HEIGHT ) self.background:setOrigin( self.x, self.y ) self.outlines:setOrigin( self.x, self.y ) end return HelpScreen
local speedyRobo = table.deepcopy(data.raw["roboport-equipment"]["personal-roboport-equipment"]) local speedyRoboItem = table.deepcopy(data.raw.item["personal-roboport-equipment"]) local speedyRoboRecipe = table.deepcopy(data.raw.recipe["personal-roboport-equipment"]) speedyRobo.name = "speedy-robo" speedyRobo.shape = { height = 1, type = "full", width = 1 } speedyRobo.energy_source = { buffer_capacity = "1W", input_flow_limit = "1W", type = "electric", usage_priority = "secondary-input" } speedyRobo.robot_limit = 100 speedyRobo.take_result = "speedy-robo" speedyRobo.construction_radius = 100 speedyRoboRecipe.name = "speedy-robo" speedyRoboRecipe.result = "speedy-robo" speedyRoboRecipe.tint = {r = 1, g = 0, b = 0, a = 0.3} speedyRoboRecipe.enabled = false speedyRoboItem.name = "speedy-robo" speedyRoboItem.tint = {r = 1, g = 0, b = 0, a = 0.3} speedyRoboItem.placed_as_equipment_result = "speedy-robo" data:extend {speedyRoboItem, speedyRobo, speedyRoboRecipe}
--- -- FDMM Unit Types Module. -- @module FDMM_UnitTypes env.info("---FDMM_UnitTypes Start---"); require('Additions/FDMM_LuaAdditions') --- FDMM unit types module. fdmm.unitTypes = {} do -- FDMM_UnitTypes --- Unit type table. -- A ridiculous structure mapping fdmmUnitTypes to dcsUnitTypes. -- Dates should be ranged [BeginningYear,EndingYear]. -- Also contains a lot of categorization that FDMM relies upon. -- @note See something wrong? Say something! That way we can fix it. -- @type Consts.UnitType fdmm.consts.UnitType = { Plane = { Fighter = { AirSuperiority = { F14A = 'F-14A', F14B = 'F-14B', F15C = 'F-15C', F15E = 'F-15E', F16A = 'F-16A', F16Cb50 = 'F-16C bl.50', F16CMb50 = 'F-16C_50', F16Cb52d = 'F-16C bl.52d', J11A = 'J-11A', MiG29A = 'MiG-29A', MiG29G = 'MiG-29G', MiG29S = 'MiG-29S', Su27 = 'Su-27', Su33 = 'Su-33', }, Interceptor = { F14A = 'F-14A', F14B = 'F-14B', F4E = 'F-4E', MiG21b = 'MiG-21Bis', MiG25PD = 'MiG-25PD', MiG31 = 'MiG-31', }, Strike = { AJS37 = 'AJS37', F4E = 'F-4E', FA18A = 'F/A-18A', FA18C = 'F/A-18C', FA18Cl20 = 'FA-18C_hornet', Su17M4 = 'Su-17M4', Su34 = 'Su-34', TornadoGR4 = 'Tornado GR4', TornadoIDS = 'Tornado IDS', }, Multirole = { AJS37 = 'AJS37', F4E = 'F-4E', F14A = 'F-14A', F14B = 'F-14B', F15C = 'F-15C', F15E = 'F-15E', F16A = 'F-16A', F16Cb50 = 'F-16C bl.50', F16CMb50 = 'F-16C_50', F16Cb52d = 'F-16C bl.52d', FA18A = 'F/A-18A', FA18C = 'F/A-18C', FA18Cl20 = 'FA-18C_hornet', J11A = 'J-11A', JF17 = 'JF-17', M2000C = 'M-2000C', M20005 = 'Mirage 2000-5', MiG21b = 'MiG-21Bis', MiG23MLD = 'MiG-23MLD', MiG29A = 'MiG-29A', MiG29G = 'MiG-29G', MiG29K = 'MiG-29K', MiG29S = 'MiG-29S', Su27 = 'Su-27', Su30 = 'Su-30', Su33 = 'Su-33', TornadoGR4 = 'Tornado GR4', TornadoIDS = 'Tornado IDS', }, Light = { F5E = 'F-5E', F5E3 = 'F-5E-3', F86F = 'F-86F Sabre', MiG15b = 'MiG-15bis', MiG19P = 'MiG-19P', }, }, Bomber = { Strategic = { B1B = 'B-1B', B52H = 'B-52H', Tu95MS = 'Tu-95MS', Tu160 = 'Tu-160', }, Tactical = { F111F = 'F-111F', Tu22M3 = 'Tu-22M3', }, Attack = { A10A = 'A-10A', A10C = 'A-10C', AV8BNA = 'AV8BNA', MiG27K = 'MiG-27K', Su24M = 'Su-24M', Su25 = 'Su-25', Su25T = 'Su-25T', Su25TM = 'Su-25TM', }, Stealth = { F117A = 'F-117A', }, Light = { C101CC = 'C-101CC', L39ZA = 'L-39ZA', }, ASW = { S3B = 'S-3B', Tu142 = 'Tu-142', }, }, Reconnaissance = { Arial = { An30M = 'An-30M', Tu142 = 'Tu-142', }, Bomber = { MiG25RBT = 'MiG-25RBT', Su24MR = 'Su-24MR', }, Drone = { MQ9 = 'MQ-9 Reaper', RQ1A = 'RQ-1A Predator', }, }, AWACS = { A50 = 'A-50', E2C = 'E-2C', E3A = 'E-3A', KJ2000 = 'KJ-2000', }, Refueling = { IL78M = 'IL-78M', KC130 = 'KC130', KC135 = 'KC-135', KC135MPRS = 'KC135MPRS', S3BTanker = 'S-3B Tanker', }, Transport = { Strategic = { C17A = 'C-17A', IL76MD = 'IL-76MD', }, Tactical = { An26B = 'An-26B', C130 = 'C-130', }, }, Trainer = { Jet = { C101EB = 'C-101EB', F16AMLU = 'F-16A MLU', HawkT1A = 'Hawk', L39C = 'L-39C', }, Prop = { TF51D = 'TF-51D', Yak52 = 'Yak-52', }, }, Civilian = { Aerobatic = { CEII = 'Christen Eagle II', }, Transport = { Yak40 = 'Yak-40', }, }, All = {}, -- resolved on startup processing CarrierBorne = { -- planes able to be spawned on ships AV8BNA = 'AV8BNA', E2C = 'E-2C', F4E = 'F-4E', FA18A = 'F/A-18A', FA18C = 'F/A-18C', FA18Cl20 = 'FA-18C_hornet', MiG29K = 'MiG-29K', S3B = 'S-3B', S3BTanker = 'S-3B Tanker', Su33 = 'Su-33', }, PlayerControllable = { -- planes that players can fly A10A = 'A-10A', A10C = 'A-10C', AJS37 = 'AJS37', AV8BNA = 'AV8BNA', F14B = 'F-14B', F15C = 'F-15C', F16CMb50 = 'F-16C_50', FA18Cl20 = 'FA-18C_hornet', F5E3 = 'F-5E-3', F86F = 'F-86F Sabre', JF17 = 'JF-17', M2000C = 'M-2000C', MiG15b = 'MiG-15bis', MiG19P = 'MiG-19P', MiG21b = 'MiG-21Bis', MiG29A = 'MiG-29A', MiG29G = 'MiG-29G', MiG29S = 'MiG-29S', Su25 = 'Su-25', Su25T = 'Su-25T', Su27 = 'Su-27', Su33 = 'Su-33', C101CC = 'C-101CC', C101EB = 'C-101EB', HawkT1A = 'Hawk', L39C = 'L-39C', L39ZA = 'L-39ZA', TF51D = 'TF-51D', Yak52 = 'Yak-52', CEII = 'Christen Eagle II', }, Unavailable = { -- planes in the DB tables, but not spawnable F111F = 'F-111F', MiG29K = 'MiG-29K', }, NATOReporting = { ['AV8BNA'] = ':(N/A)', ['A-50'] = ':\'Mainstay\'', ['An-26B'] = ':\'Curl\'', ['An-30M'] = ':\'Clank\'', ['IL-76MD'] = ':\'Candid\'', ['IL-78M'] = ':\'Midas\'', ['J-11A'] = ':\'Flanker-L\'', ['KJ-2000'] = ':\'Mainring\'', ['MiG-15bis'] = ':\'Fagot\'', ['MiG-19P'] = ':\'Farmer-B\'', ['MiG-21Bis'] = ':\'Fishbed-L/N\'', ['MiG-23MLD'] = ':\'Flogger-K\'', ['MiG-25RBT'] = ':\'Foxbat-B\'', ['MiG-25PD'] = ':\'Foxbat-E\'', ['MiG-27K'] = ':\'Flogger-J2\'', ['MiG-29A'] = ':\'Fulcrum-A\'', ['MiG-29K'] = ':\'Fulcrum-D\'', ['MiG-29S'] = ':\'Fulcrum-C\'', ['MiG-31'] = ':\'Foxhound\'', ['Su-17M4'] = ':\'Fitter-K\'', ['Su-24M'] = ':\'Fencer-D\'', ['Su-24MR'] = ':\'Fencer-E\'', ['Su-25'] = ':\'Frogfoot\'', ['Su-25T'] = ':\'Frogfoot\'', ['Su-25TM'] = ':\'Frogfoot\'', ['Su-27'] = ':\'Flanker-B\'', ['Su-30'] = ':\'Flanker-C\'', ['Su-33'] = ':\'Flanker-D\'', ['Su-34'] = ':\'Fullback\'', ['Tu-22M3'] = ':\'Backfire-C\'', ['Tu-95MS'] = ':\'Bear-H\'', ['Tu-142'] = ':\'Bear-F/J\'', ['Tu-160'] = ':\'Blackjack\'', ['Yak-40'] = ':\'Codling\'', }, WTOReporting = { ['AV8BNA'] = ':(N/A)', }, ReportNaming = { ['AJS37'] = 'AJS 37', ['AV8BNA'] = 'AV-8B', ['B-1B'] = 'B-1B', ['F-16C_50'] = 'F-16CM bl.50', ['FA-18C_hornet'] = 'F/A-18C l.20', ['F-86F Sabre'] = 'F-86F', ['KC130'] = 'KC-130', ['KC135MPRS'] = 'KC-135 MPRS', ['Hawk'] = 'Hawk T1A', ['M-2000C'] = 'Mirage 2000C', ['MiG-21Bis'] = 'MiG-21bis', ['MQ-9 Reaper'] = 'MQ-9', ['RQ-1A Predator'] = 'RQ-1A', }, ProperNaming = { ['A-10A'] = 'Thunderbolt II', ['A-10C'] = 'Thunderbolt II', ['AJS37'] = 'Viggen', ['AV8BNA'] = 'Harrier II', ['B-1B'] = 'Lancer', ['B-52H'] = 'Stratofortress', ['C-101CC'] = 'Aviojet', ['C-101EB'] = 'Aviojet', ['C-17A'] = 'Globemaster III', ['C-130'] = 'Hercules', ['E-2C'] = 'Hawkeye', ['E-3A'] = 'Sentry', ['F-4E'] = 'Phantom II', ['F-5E'] = 'Tiger II', ['F-5E-3'] = 'Tiger II', ['F-14A'] = 'Tomcat', ['F-14B'] = 'Tomcat', ['F-15C'] = 'Eagle', ['F-15E'] = 'Strike Eagle', ['F-16A'] = 'Fighting Falcon', ['F-16A MLU'] = 'Fighting Falcon', ['F-16C bl.50'] = 'Fighting Falcon', ['F-16C_50'] = 'Fighting Falcon', ['F-16C bl.52d'] = 'Fighting Falcon', ['F/A-18A'] = 'Hornet', ['F/A-18C'] = 'Hornet', ['FA-18C_hornet'] = 'Hornet', ['F-86F Sabre'] = 'Sabre', ['F-111F'] = 'Aardvark', ['F-117A'] = 'Nighthawk', ['KC-135'] = 'Stratotanker', ['KC135MPRS'] = 'Stratotanker', ['L-39C'] = 'Albatros', ['L-39ZA'] = 'Albatros', ['M-2000C'] = 'Chasseur', ['MQ-9 Reaper'] = 'Reaper', ['RQ-1A Predator'] = 'Predator', ['S-3B'] = 'Viking', ['S-3B Tanker'] = 'Viking', ['TF-51D'] = 'Mustang', }, Nicknaming = { ['A-10A'] = 'Warthog', ['A-10C'] = 'Warthog', ['F-16A'] = 'Viper', ['F-16A MLU'] = 'Viper', ['F-16C bl.50'] = 'Viper', ['F-16C_50'] = 'Viper', ['F-16C bl.52d'] = 'Viper', }, }, Helicopter = { Attack = { AH1W = 'AH-1W', AH64A = 'AH-64A', AH64D = 'AH-64D', Ka50 = 'Ka-50', Ka52 = 'Ka-52', Mi24V = 'Mi-24V', Mi28N = 'Mi-28N', }, Reconnaissance = { OH58D = 'OH-58D', SA342L = 'SA342L', SA342M = 'SA342M', SA342Mg = 'SA342Minigun', SA342Ms = 'SA342Mistral', }, Light = { SA342L = 'SA342L', SA342M = 'SA342M', SA342Mg = 'SA342Minigun', SA342Ms = 'SA342Mistral', UH1H = 'UH-1H', }, Transport = { Strategic = { CH47D = 'CH-47D', CH53E = 'CH-53E', Mi26 = 'Mi-26', }, Tactical = { Mi8MTV2 = 'Mi-8MT', SH3W = 'SH-3W', SH60B = 'SH-60B', UH1H = 'UH-1H', UH60A = 'UH-60A', }, Assault = { Mi24V = 'Mi-24V', SH60B = 'SH-60B', UH1H = 'UH-1H', UH60A = 'UH-60A', }, }, ASW = { Ka27 = 'Ka-27', SH3W = 'SH-3W', SH60B = 'SH-60B', }, All = {}, -- resolved on startup processing CarrierBorne = { -- helicopters able to be spawned on ship AH1W = 'AH-1W', CH53E = 'CH-53E', Ka27 = 'Ka-27', SH3W = 'SH-3W', SH60B = 'SH-60B', }, PlayerControllable = { -- helicopters that players can fly Ka50 = 'Ka-50', SA342L = 'SA342L', SA342M = 'SA342M', SA342Mg = 'SA342Minigun', SA342Ms = 'SA342Mistral', UH1H = 'UH-1H', Mi8MTV2 = 'Mi-8MT', }, Unavailable = { -- helicopters in the DB tables, but not spawnable Ka52 = 'Ka-52', SH3W = 'SH-3W', }, NATOReporting = { ['Ka-27'] = ':\'Helix\'', ['Ka-50'] = ':\'Hokum-A\'', ['Ka-52'] = ':\'Hokum-B\'', ['Mi-8MT'] = ':\'Hip\'', ['Mi-24V'] = ':\'Hind-E\'', ['Mi-26'] = ':\'Halo\'', ['Mi-28N'] = ':\'Havoc\'', }, WTOReporting = { }, ReportNaming = { ['SA342L'] = 'SA 342L', ['SA342M'] = 'SA 342M', ['SA342Minigun'] = 'SA 342 Mg', ['SA342Mistral'] = 'SA 342 Ms', }, ProperNaming = { ['AH-1W'] = 'SuperCobra', ['AH-64A'] = 'Apache', ['AH-64D'] = 'Apache', ['CH-47D'] = 'Chinook', ['CH-53E'] = 'Sea Stallion', ['Ka-50'] = 'Black Shark', ['Ka-52'] = 'Alligator', ['OH-58D'] = 'Kiowa', ['SA342L'] = 'Gazelle', ['SA342M'] = 'Gazelle', ['SA342Minigun'] = 'Gazelle', ['SA342Mistral'] = 'Gazelle', ['SH-3W'] = 'Sea King', ['SH-60B'] = 'Seahawk', ['UH-1H'] = 'Huey', ['UH-60A'] = 'Black Hawk', }, Nicknaming = { ['AH-1W'] = 'HueyCobra', ['Mi-24V'] = 'Crocodile', }, }, Ground = { Tracked = { HQ = { Sborka9S80M1 = 'Dog Ear radar', }, MBT = { ChallengerII = 'Challenger2', AMX56Leclerc = 'Leclerc', Leopard1A3 = 'Leopard1A3', Leopard2A5 = 'Leopard-2', M1A2Abrams = 'M-1 Abrams', M60A3Patton = 'M-60', MerkavaMk4 = 'Merkava_Mk4', T55 = 'T-55', T72B = 'T-72B', T80U = 'T-80UD', T90 = 'T-90', ZTZ96B = 'ZTZ96B', }, IFV = { BMD1 = 'BMD-1', -- airborne BMP1 = 'BMP-1', BMP2 = 'BMP-2', BMP3 = 'BMP-3', M2A2Bradley = 'M-2 Bradley', Marder1A3 = 'Marder', MCV80 = 'MCV-80', ZBD04A = 'ZBD04A', }, ARV = { BRDM2 = 'BRDM-2', BTRRD = 'BTR_D', -- airborne MTLBuBoman = 'Grad_FDDM', }, APC = { AAV7 = 'AAV7', -- marines M1043HMMWVMg = 'M1043 HMMWV Armament', M1126StrykerICV = 'M1126 Stryker ICV', M113 = 'M-113', MTLB = 'MTLB', }, MLRS = { BM21 = { -- also has wheeled components _HasWheeledComps = true, FireControl = { MTLBuBoman = 'Grad_FDDM', }, }, M270 = { -- also has wheeled components _HasWheeledComps = true, Launcher = { M270MLRSLN = 'MLRS', }, }, }, SPH = { M109Paladin = 'M-109', Gvozdika2S1 = 'SAU Gvozdika', Msta2S19 = 'SAU Msta', Akatsia2S3 = 'SAU Akatsia', NonaS2S9 = 'SAU 2-C9', -- airborne SpGHDana = 'SpGH_Dana', }, EWR = { RolandEWR = 'Roland Radar', }, SAM = { M48Chaparral = 'M48 Chaparral', M6Linebacker = 'M6 Linebacker', RolandADS = 'Roland ADS', SA6 = { SearchTrackRadar = { SA6KubSTR_1S91 = 'Kub 1S91 str', }, Launcher = { SA6KubLN_2P25 = 'Kub 2P25 ln', }, }, SA11 = { HQ = { SA11BukCC_9S470M1 = 'SA-11 Buk CC 9S470M1', }, SearchRadar = { SA11BukSR_9S18M1 = 'SA-11 Buk SR 9S18M1', }, Launcher = { SA11BukLN_9A310M1 = 'SA-11 Buk LN 9A310M1', }, }, SA13Strela10M3_9A35M3 = 'Strela-10M3', SA15Tor_9A331 = 'Tor 9A331', SA19Tunguska_2S6 = '2S6 Tunguska', }, SPAAG = { FlaKPzGepard1A2 = 'Gepard', ZSU234Shilka = 'ZSU-23-4 Shilka', M163Vulcan = 'Vulcan', }, }, Wheeled = { HQ = { LandRover101FC = 'Land_Rover_101_FC', SKP11ATCMCP = 'SKP-11', Ural375PBU = 'Ural-375 PBU', ZiL131KUNG = 'ZIL-131 KUNG', }, SPG = { M1128StrykerMGS = 'M1128 Stryker MGS', }, ATGM = { M1024HMMWVTOW = 'M1045 HMMWV TOW', M1134StrykerATGM = 'M1134 Stryker ATGM', }, ARV = { LAV25 = 'LAV-25', -- marines }, APC = { BMT2Cobra = 'Cobra', BTR80 = 'BTR-80', M1025HMMWV = 'Hummer', TPzFuchs = 'TPZ', }, SSM = { SS1CScudBLN = 'Scud_B', }, MLRS = { BM21 = { _HasTrackedComps = true, Launcher = { BM21Grad = 'Grad-URAL', }, }, BM27Uragan_9K57 = 'Uragan_BM-27', BM30Smerch_9A52 = 'Smerch', M270 = { -- also has tracked components _HasTrackedComps = true, FireControl = { M270MLRSFDDM = 'MLRS FDDM', }, }, }, EWR = { P1455G6 = '55G6 EWR', P181L13 = '1L13 EWR', }, SAM = { M1097Avenger = 'M1097 Avenger', HQ7 = { SearchTrackRadar = { HQ7SPSTR = 'HQ-7_STR_SP', }, Launcher = { HQ7SPLN = 'HQ-7_LN_SP', }, }, Patriot = { -- also has towed components _HasTowedComps = true, HQ = { PatriotECS_ANMSQ104 = 'Patriot ECS', }, DataProcessing = { PatriotICC = 'Patriot cp', }, Power = { PatriotEPPIII = 'Patriot EPP', }, RadarArray = { PatriotAMG_ANMRC137 = 'Patriot AMG', }, }, SA3S125 = { -- also has towed components _HasTowedComps = true, SearchRadar = { SA3S125SR_P19 = 'p-19 s-125 sr', }, }, SA8 = { Loader = { SA8OsaLD_9T217 = 'SA-8 Osa LD 9T217', }, Launcher = { SA8OsaLN_9A33 = 'Osa 9A33 ln', }, }, SA9Strela1_9P31 = 'Strela-1 9P31', SA10S300PS = { -- also has towed components _HasTowedComps = true, HQ = { SA10S300PSCP_54K6 = 'S-300PS 54K6 cp', }, SearchRadar = { SA10S300PSSR_64H6E = 'S-300PS 64H6E sr', }, MasterLauncher = { SA10S300PSLN_5P85C = 'S-300PS 5P85C ln', }, SlaveLauncher = { SA10S300PSLN_5P85D = 'S-300PS 5P85D ln', }, }, }, SPAAG = { ZU23Ural375 = { Soldier = { ZU23Ural375 = 'Ural-375 ZU-23', }, Insurgent = { ZU23Ural375_Insurgent = 'Ural-375 ZU-23 Insurgent', }, }, }, Power = { APA5D_Ural4320 = 'Ural-4320 APA-5D', APA80_ZiL131 = 'ZiL-131 APA-80', }, Fire = { M1142HEMTTTFFT = 'HEMTT TFFT', UralATsP6 = 'Ural ATsP-6', }, Transport = { Armored = { Ural432031A = 'Ural-4320-31', }, Open = { GAZ66 = 'GAZ-66', Ural375 = 'Ural-375', }, Covered = { GAZ3308 = 'GAZ-3308', KamAZ43101 = 'KAMAZ Truck', KrAZ6322 = 'KrAZ6322', M818 = 'M 818', Ural4320T = 'Ural-4320T', }, Lubricant = { ATMZ5 = 'ATMZ-5', }, Fuel = { ATZ10 = 'ATZ-10', M978HEMTTTanker = 'M978 HEMTT Tanker', }, }, Car = { M1025HMMWV = 'Hummer', LandRover109S3 = 'Land_Rover_109_S3', Tigr_233036 = 'Tigr_233036', UAZ469 = 'UAZ-469', }, }, Towed = { Drone = { HQ = { PreadtorGCS = 'Predator GCS', }, Repeater = { PredatorTS = 'Predator TrojanSpirit', }, }, SSM = { CSSC2 = { -- anti-ship SearchRadar = { CSSC2SilkwormSR = 'Silkworm_SR', }, Launcher = { CSSC2SilkwormLN = 'hy_launcher', }, }, }, SAM = { Hawk = { HQ = { HawkPCP = 'Hawk pcp', }, ContWaveAcqRadar = { HawkCWAR_ANMPQ55 = 'Hawk cwar', }, SearchRadar = { HawkSR_ANMPQ50 = 'Hawk sr', }, TrackRadar = { HawkTR_ANMPQ46 = 'Hawk tr', }, Launcher = { HawkLN_M192 = 'Hawk ln', }, }, Patriot = { -- also has wheeled components _HasWheeledComps = true, Launcher = { PatriotLN_M901 = 'Patriot ln', }, SearchTrackRadar = { PatriotSTR_ANMPQ53 = 'Patriot str', }, }, Rapier = { TrackRadar = { RapierFSATR = 'rapier_fsa_blindfire_radar', }, TrackOptical = { RapierFSATO = 'rapier_fsa_optical_tracker_unit', }, Launcher = { RapierFSALN = 'rapier_fsa_launcher', }, }, SA2S75 = { TrackRadar = { SA2S75TR_SNR75 = 'SNR_75V', }, Launcher = { SA2S75LN_SM90 = 'S_75M_Volhov', }, }, SA3S125 = { -- also has wheeled components _HasWheeledComps = true, TrackRadar = { SA3S125TR_SNR = 'snr s-125 tr', }, Launcher = { SA3S125LN_5P73 = '5p73 s-125 ln', }, }, SA10S300PS = { -- also has wheeled components _HasWheeledComps = true, SearchRadar = { SA10S300PSSR_5N66M = 'S-300PS 40B6MD sr', }, TrackRadar = { SA10S300PSTR_30N6 = 'S-300PS 40B6M tr', }, }, }, AAA = { ZU23 = { Soldier = { Fortified = { ZU23Closed = 'ZU-23 Emplacement Closed', }, Emplacement = { ZU23 = 'ZU-23 Emplacement', }, }, Insurgent = { Fortified = { ZU23Closed_Insurgent = 'ZU-23 Closed Insurgent', }, Emplacement = { ZU23_Insurgent = 'ZU-23 Insurgent', }, }, }, }, }, Infantry = { Beacon = { TACANBeacon_TTS3030 = 'TACAN_beacon', }, Mortar = { M2B11 = '2B11 mortar', }, SAM = { SA18 = { Soldier = { Comm = { SA18IGLAComm = 'SA-18 Igla comm', }, Launcher = { SA18IGLAMANPAD = 'SA-18 Igla manpad', }, }, Insurgent = { Comm = { SA18IGLAComm = 'SA-18 Igla comm', }, Launcher = { SA18IGLAMANPAD_Insurgent = 'Igla manpad INS', }, }, }, SA24 = { Comm = { SA24IGLASComm = 'SA-18 Igla-S comm', }, Launcher = { SA24IGLASMANPAD = 'SA-18 Igla-S manpad', }, }, Stinger = { Comm = { StingerComm = 'Stinger comm', IsraeliStingerComm = 'Stinger comm dsr', }, Launcher = { StingerMANPAD = 'Soldier stinger', }, }, }, MG = { Soldier = { SoldierM249 = 'Soldier M249', }, }, Rifle = { Soldier = { GeorgianM4 = 'Soldier M4 GRG', SoldierM4 = 'Soldier M4', RussianAK = 'Infantry AK', SoldierAK = 'Soldier AK', }, Insurgent = { InsurgentAK = 'Infantry AK Ins', }, Paratrooper = { ParatroopAKS74 = 'Paratrooper AKS-74', }, }, RPG = { Soldier = { SoldierRPG = 'Soldier RPG', }, Insurgent = { SoldierRPG = 'Soldier RPG', }, Paratrooper = { ParatroopRPG16 = 'Paratrooper RPG-16', }, }, }, Fort = { Barracks = 'house1arm', House = 'houseA_arm', HillsideBunker = 'Sandbox', PillboxBunker = 'Bunker', Outpost = 'outpost', RoadOutpost = 'outpost_road', WatchTower = 'house2arm', WarningBoard = 'warning_board_a', }, Civilian = { Trailer = { MAZ6303 = 'MAZ-6303', }, Fire = { M1142HEMTTTFFT = 'HEMTT TFFT', UralATsP6 = 'Ural ATsP-6', }, Transport = { Open = { ZiL4331 = 'ZIL-4331', }, Covered = { GAZ3307 = 'GAZ-3307', }, }, Bus = { Double = { IKARUS280 = 'IKARUS Bus', }, Single = { LAZ695 = 'LAZ Bus', ZIU9 = 'Trolley bus', }, }, Car = { VAZ2109 = 'VAZ Car', }, }, Animal = { Suidae = 'Suidae', }, All = {}, -- resolved on startup processing Airborne = { -- vehicles that are considered a part of airborne assault units (capable of air drop) BMD1 = 'BMD-1', BTRRD = 'BTR_D', ParatroopAKS74 = 'Paratrooper AKS-74', ParatroopRPG16 = 'Paratrooper RPG-16', }, Amphibious = { -- vehicles that can float on water, not just ford rivers (capable of sea crossing) AAV7 = 'AAV7', BMP1 = 'BMP-1', BMP2 = 'BMP-2', BRDM2 = 'BRDM-2', BTRRD = 'BTR_D', BTR80 = 'BTR-80', LAV25 = 'LAV-25', MTLB = 'MTLB', MTLBuBoman = 'Grad_FDDM', SA8OsaLD_9T217 = 'SA-8 Osa LD 9T217', SA8OsaLN_9A33 = 'Osa 9A33 ln', Gvozdika2S1 = 'SAU Gvozdika', NonaS2S9 = 'SAU 2-C9', }, HeavyWheeled = { -- wheeled vehicles less likely to get stuck in the mud (reduced stuck-in-mud chance) M1142HEMTTTFFT = 'HEMTT TFFT', M978HEMTTTanker = 'M978 HEMTT Tanker', SA10S300PSCP_54K6 = 'S-300PS 54K6 cp', SA10S300PSSR_64H6E = 'S-300PS 64H6E sr', SA10S300PSLN_5P85C = 'S-300PS 5P85C ln', SA10S300PSLN_5P85D = 'S-300PS 5P85D ln', SS1CScudBLN = 'Scud_B', TPzFuchs = 'TPZ', }, Marines = { -- vehicles that are considered a part of marine assault units (capable of amphibious launch) AAV7 = 'AAV7', LAV25 = 'LAV-25', }, Unavailable = { -- vehicles in the DB tables, but not spawnable SA8OsaLD_9T217 = 'SA-8 Osa LD 9T217', Suidae = 'Suidae', }, NATOReporting = { -- HQ ['Dog Ear radar'] = 'PPRU-M1 \'Dog Ear\' (Sborka-M1):\'Dog Ear\'', -- MBT ['T-55'] = ':(M1970)', ['T-72B'] = ':(M1988)', ['T-80UD'] = ':(M1989)', ['T-90'] = ':(M1990)', -- IFV ['BMD-1'] = ':(M1970)', ['BMP-1'] = ':(M1970)', ['BMP-2'] = ':(M1981)', ['BMP-3'] = ':(M1990/1)', -- ARV ['BRDM-2'] = ':(M1966)', ['BTR_D'] = ':(M1979)', ['Grad_FDDM'] = ':(M1974)', -- APC ['BTR-80'] = ':(M1987)', ['MTLB'] = ':(M1970)', -- SPH ['SAU 2-C9'] = 'SAU-120:(M1985)', ['SAU Akatsia'] = 'SAU-152:(M1973)', ['SAU Gvozdika'] = 'SAU-122:(M1974)', ['SAU Msta'] = 'SAU-152:(M1990)', -- MLRS ['Grad-URAL'] = 'BM-21:(M1964)', ['Uragan_BM-27'] = 'BM-27:(M1977)', ['Smerch'] = 'BM-30:(M1983)', -- SSM ['Scud_B'] = 'SS-1C \'Scud-B\' (R-17/MAZ-543):\'Scud-B\'', ['Silkworm_SR'] = 'CSS-C-2 \'Silkworm\':\'Silkworm\'', ['hy_launcher'] = 'CSS-C-2 \'Silkworm\':\'Silkworm\'', -- EWR ['55G6 EWR'] = 'P-14 \'Tall Rack\' (Nebo):\'Tall Rack\'', ['1L13 EWR'] = 'P-18 \'Spoon Rest-D\' (Nebo-SV):\'Spoon Rest-D\'', -- SAM ['S_75M_Volhov'] = 'SA-2D \'Guideline m.3\' (S-75M/SM-90):\'Guideline m.3\'', ['SNR_75V'] = 'SA-2D \'Fan Song-E\' (SNR-75V):\'Fan Song-E\'', ['5p73 s-125 ln'] = 'SA-3 \'Goa\' (S-125):\'Goa\'', ['p-19 s-125 sr'] = 'SA-3 \'Flat Face-B\' (S-125/P-19):\'Flat Face-B\'', ['snr s-125 tr'] = 'SA-3 \'Low Blow\' (SNR-125):\'Low Blow\'', ['Kub 1S91 str'] = 'SA-6 \'Straight Flush\' (Kub):\'Straight Flush\'', ['Kub 2P25 ln'] = 'SA-6 \'Gainful\' (Kub):\'Gainful\'', ['SA-8 Osa LD 9T217'] = 'SA-8 \'Gecko\' (Osa):\'Gecko\'', ['Osa 9A33 ln'] = 'SA-8 \'Gecko\' (Osa):\'Gecko\'', ['Strela-1 9P31'] = 'SA-9 \'Gaskin\' (Strela-1):\'Gaskin\'', ['S-300PS 40B6M tr'] = 'SA-10B \'Flap Lid-A\' (S-300PS):\'Flap Lid-A\'', ['S-300PS 40B6MD sr'] = 'SA-10B \'Clam Shell\' (S-300PS):\'Clam Shell\'', ['S-300PS 54K6 cp'] = 'SA-10B \'Grumble-B\' (S-300PS):\'Grumble-B\'', ['S-300PS 5P85C ln'] = 'SA-10B \'Grumble-B\' (S-300PS):\'Grumble-B\'', ['S-300PS 5P85D ln'] = 'SA-10B \'Grumble-B\' (S-300PS):\'Grumble-B\'', ['S-300PS 64H6E sr'] = 'SA-10B \'Big Bird\' (S-300PS):\'Big Bird\'', ['SA-11 Buk CC 9S470M1'] = 'SA-11 \'Gadfly\' (Buk):\'Gadfly\'', ['SA-11 Buk LN 9A310M1'] = 'SA-11 \'Gadfly\' (Buk):\'Gadfly\'', ['SA-11 Buk SR 9S18M1'] = 'SA-11 \'Tube Arm\' (Buk):\'Tube Arm\'', ['Strela-10M3'] = 'SA-13 \'Gopher\' (Strela-10M3):\'Gopher\'', ['Tor 9A331'] = 'SA-15 \'Gauntlet\' (Tor):\'Gauntlet\'', ['2S6 Tunguska'] = 'SA-19 \'Grison\' (Tunguska):\'Grison\'', -- SAM (Infantry) ['Igla manpad INS'] = 'SA-18 \'Grouse\' (Igla):\'Grouse\'', ['SA-18 Igla comm'] = 'SA-18 \'Grouse\' (Igla):\'Grouse\'', ['SA-18 Igla manpad'] = 'SA-18 \'Grouse\' (Igla):\'Grouse\'', ['SA-18 Igla-S comm'] = 'SA-24 \'Grinch\' (Igla-S):\'Grinch\'', ['SA-18 Igla-S manpad'] = 'SA-24 \'Grinch\' (Igla-S):\'Grinch\' ', -- SPAAG ['ZSU-23-4 Shilka'] = 'ZSU-23-4 \'Gun Dish\' (Shilka):\'Gun Dish\'', }, WTOReporting = { -- HQ ['Dog Ear radar'] = '9S80M1 Sborka-M1:(PPRU-M1)', -- MBT ['T-55'] = ':(O.155)', ['T-72B'] = ':(O.174M)', ['T-80UD'] = ':(O.219AS)', ['T-90'] = ':(O.188)', -- IFV ['BMD-1'] = ':(O.915)', ['BMP-1'] = ':(O.765Sp2)', ['BMP-2'] = ':(O.675)', ['BMP-3'] = ':(O.688M)', -- ARV ['BRDM-2'] = ':(BTR-40P-2)', ['BTR_D'] = ':(O.925)', ['Grad_FDDM'] = ':(O.10)', -- APC ['BTR-80'] = ':(GAZ-5903)', ['MTLB'] = ':(O.6)', -- SPH ['SAU 2-C9'] = '2S9:(SO.120)', ['SAU Akatsia'] = '2S3:(SO.152)', ['SAU Gvozdika'] = '2S1:(SAU.122)', ['SAU Msta'] = '2S19:(SP.152)', -- MLRS ['Grad-URAL'] = '9K51 BM-21:', ['Uragan_BM-27'] = '9K57 BM-27:(9P140)', ['Smerch'] = '9K58 BM-30:', -- SSM ['Scud_B'] = '9K72 R-17 Elbrus:(9P117M)', ['Silkworm_SR'] = 'HY-1A:', ['hy_launcher'] = 'HY-1A:', -- EWR ['55G6 EWR'] = '55G6 Nebo:(P-14)', ['1L13 EWR'] = '1L13 Nebo-SV:(P-18)', -- SAM ['S_75M_Volhov'] = 'S-75M SM-90:', ['SNR_75V'] = 'S-75M SNR-75V:', ['5p73 s-125 ln'] = 'S-125 5P73:', ['p-19 s-125 sr'] = 'S-125 1RL134:(P-19)', ['snr s-125 tr'] = 'S-125 SNR-125:', ['Kub 1S91 str'] = '2K12 Kub 1S91:', ['Kub 2P25 ln'] = '2K12 Kub 2P25:', ['SA-8 Osa LD 9T217'] = '9K33 Osa 9T217:', ['Osa 9A33 ln'] = '9K33 Osa 9A33:', ['Strela-1 9P31'] = '9K31 Strela-1 9P31:', ['S-300PS 40B6M tr'] = 'S-300PS 30N6:', ['S-300PS 40B6MD sr'] = 'S-300PS 5N66M:', ['S-300PS 54K6 cp'] = 'S-300PS 54K6:', ['S-300PS 5P85C ln'] = 'S-300PS 5P85C:', ['S-300PS 5P85D ln'] = 'S-300PS 5P85D:', ['S-300PS 64H6E sr'] = 'S-300PS 64H6E:', ['SA-11 Buk CC 9S470M1'] = '9K37 Buk 9S470M1:', ['SA-11 Buk LN 9A310M1'] = '9K37 Buk 9A310M1:', ['SA-11 Buk SR 9S18M1'] = '9K37 Buk 9S18M1:', ['Strela-10M3'] = '9K35M Strela-10M3 9A35M3:', ['Tor 9A331'] = '9K330 Tor 9A331:', ['2S6 Tunguska'] = '2S6 Tunguska:', -- SAM (Infantry) ['Igla manpad INS'] = '9K38 Igla:', ['SA-18 Igla comm'] = '9K38 Igla:', ['SA-18 Igla manpad'] = '9K38 Igla:', ['SA-18 Igla-S comm'] = '9K338 Igla-S:', ['SA-18 Igla-S manpad'] = '9K338 Igla-S:', -- SPAAG ['ZSU-23-4 Shilka'] = 'ZSU-23-4 Shilka:', }, ReportNaming = { -- HQ ['Dog Ear radar'] = '%R', ['Land_Rover_101_FC'] = 'Land Rover 101 FC', ['Predator TrojanSpirit'] = 'Predator TS', ['SKP-11'] = 'SKP-11 ATC MCP', ['ZIL-131 KUNG'] = 'ZiL-131 KUNG', -- MBT ['Challenger2'] = 'Challenger II', ['Leclerc'] = 'AMX-56 Leclerc', ['Leopard1A3'] = 'Leopard 1A3', ['Leopard-2'] = 'Leopard 2A5', ['M-1 Abrams'] = 'M1A2 Abrams', ['M-60'] = 'M60A3 Patton', ['Merkava_Mk4'] = 'Merkava Mk.IV', ['ZTZ96B'] = 'ZTZ-96B', -- IFV ['M-2 Bradley'] = 'M2A2 Bradley', ['Marder'] = 'Marder 1A3', ['MCV-80'] = 'MCV-80 Warrior', ['ZBD04A'] = 'ZBD-04A', -- SPG/ATGM ['M1045 HMMWV TOW'] = 'M1045 HMMWV TOW', ['M1128 Stryker MGS'] = 'M1128 Stryker MGS', ['M1134 Stryker ATGM'] = 'M1134 Stryker ATGM', -- ARV ['BTR_D'] = 'BTR-RD', ['Grad_FDDM'] = 'MT-LBu Boman', -- APC ['AAV7'] = 'AAV-7', ['Cobra'] = 'Cobra BMT-2', ['BTR-80'] = 'BTR-80', ['M1043 HMMWV Armament'] = 'M1043 HMMWV Mg', ['M1126 Stryker ICV'] = 'M1126 Stryker ICV', ['M-113'] = 'M113 APC', ['MTLB'] = 'MT-LB', ['TPZ'] = 'TPz Fuchs', -- SPH ['SAU 2-C9'] = '%R Nona-S', ['SAU Akatsia'] = '%R Akatsia', ['SAU Gvozdika'] = '%R Gvozdika', ['SAU Msta'] = '%R Msta-S', ['M-109'] = 'M109 Paladin', ['SpGH_Dana'] = 'SpGH Dana', -- MLRS ['Grad-URAL'] = '%R Grad', ['Uragan_BM-27'] = '%R Uragan', ['Smerch'] = '%R Smerch', ['MLRS'] = 'M270 MLRS LN', ['MLRS FDDM'] = 'M270 MLRS FDDM', -- SSM ['Scud_B'] = '%R LN', ['Silkworm_SR'] = '%R SR', ['hy_launcher'] = '%R LN', -- EWR ['55G6 EWR'] = '%R EWR', ['1L13 EWR'] = '%R EWR', ['Roland Radar'] = 'Roland EWR', -- SAM ['Hawk cwar'] = 'Hawk AN/MPQ-55 CWAR', ['Hawk ln'] = 'Hawk M192 LN', ['Hawk pcp'] = 'Hawk PCP', ['Hawk sr'] = 'Hawk AN/MPQ-50 SR', ['Hawk tr'] = 'Hawk AN/MPQ-46 TR', ['HQ-7_LN_SP'] = 'HQ-7 SP LN', ['HQ-7_STR_SP'] = 'HQ-7 SP STR', ['Patriot AMG'] = 'Patriot AN/MRC-137 AMG', ['Patriot cp'] = 'Patriot ICC', ['Patriot ECS'] = 'Patriot AN/MSQ-104 ECS', ['Patriot EPP'] = 'Patriot EPP-III', ['Patriot ln'] = 'Patriot M901 LN', ['Patriot str'] = 'Patriot AN/MPQ-53 STR', ['rapier_fsa_blindfire_radar'] = 'Rapier FSA Blindfire TR', ['rapier_fsa_launcher'] = 'Rapier FSA LN', ['rapier_fsa_optical_tracker_unit'] = 'Rapier FSA OT', ['S_75M_Volhov'] = '%R LN', ['SNR_75V'] = '%R TR', ['5p73 s-125 ln'] = '%R LN', ['p-19 s-125 sr'] = '%R SR', ['snr s-125 tr'] = '%R TR', ['Kub 1S91 str'] = '%R STR', ['Kub 2P25 ln'] = '%R LN', ['SA-8 Osa LD 9T217'] = '%R LD', ['Osa 9A33 ln'] = '%R LN', ['Strela-1 9P31'] = '%R', ['S-300PS 40B6M tr'] = '%R TR', ['S-300PS 40B6MD sr'] = '%R SR', ['S-300PS 54K6 cp'] = '%R CP', ['S-300PS 5P85C ln'] = '%R M/LN', ['S-300PS 5P85D ln'] = '%R S/LN', ['S-300PS 64H6E sr'] = '%R SR', ['SA-11 Buk CC 9S470M1'] = '%R CC', ['SA-11 Buk LN 9A310M1'] = '%R LN', ['SA-11 Buk SR 9S18M1'] = '%R SR', ['Strela-10M3'] = '%R', ['Tor 9A331'] = '%R', ['2S6 Tunguska'] = '%R', -- SAM (Infantry) ['Igla manpad INS'] = 'Insurgent %R MANPAD', ['SA-18 Igla comm'] = '%R Comm', ['SA-18 Igla manpad'] = '%R MANPAD', ['SA-18 Igla-S comm'] = '%R Comm', ['SA-18 Igla-S manpad'] = '%R MANPAD', ['Stinger comm'] = 'Stinger Comm', ['Stinger comm dsr'] = 'Israeli Stinger Comm', ['Soldier stinger'] = 'Stinger MANPAD', -- SPAAG ['Gepard'] = 'FlaKPz Gepard 1A2', ['Vulcan'] = 'M163 Vulcan', ['ZSU-23-4 Shilka'] = '%R', ['Ural-375 ZU-23'] = 'ZU-23/Ural-375', ['Ural-375 ZU-23 Insurgent'] = 'Insurgent ZU-23/Ural-375', -- AAA ['ZU-23 Emplacement Closed'] = 'ZU-23 (fortified)', ['ZU-23 Closed Insurgent'] = 'Insurgent ZU-23 (fortified)', ['ZU-23 Emplacement'] = 'ZU-23', ['ZU-23 Insurgent'] = 'Insurgent ZU-23', -- Infantry ['TACAN_beacon'] = 'TTS3030 TACAN Beacon', ['2B11 mortar'] = '2B11 Mortar', ['Soldier M4 GRG'] = 'Georgian Soldier M4', ['Infantry AK Ins'] = 'Insurgent AK', ['Paratrooper AKS-74'] = 'Paratrooper AKS-74', ['Paratrooper RPG-16'] = 'Paratrooper RPG-16', -- Support ['Ural-4320 APA-5D'] = 'APA-5D/Ural-4320', ['ZiL-131 APA-80'] = 'APA-80/ZiL-131', ['HEMTT TFFT'] = 'M1142 HEMTT TFFT', -- Transport ['Ural-4320-31'] = 'Ural-4320-31 armored truck', ['GAZ-66'] = 'GAZ-66 truck', ['Ural-375'] = 'Ural-375 truck', ['GAZ-3308'] = 'GAZ-3308 truck', ['KAMAZ Truck'] = 'KamAZ-43101 truck', ['KrAZ6322'] = 'KrAZ-6322 truck', ['M 818'] = 'M818 truck', ['Ural-4320T'] = 'Ural-4320T truck', -- Car ['Hummer'] = 'M1025 HMMWV', ['Land_Rover_109_S3'] = 'Land Rover 109 S3', ['Tigr_233036'] = 'GAZ-233036 Tigr', ['UAZ-469'] = 'UAZ-469 car', -- Fort (armed) ['Bunker'] = 'Pillbox bunker', ['Sandbox'] = 'Hillside bunker', ['house1arm'] = 'Barracks', ['house2arm'] = 'Watch tower', ['houseA_arm'] = 'Holdout', ['outpost'] = 'Outpost', ['outpost_road'] = 'Road outpost', ['warning_board_a'] = 'Warning board', -- Civilian ['MAZ-6303'] = 'MAZ-6303 trailer', ['IKARUS Bus'] = 'IKARUS-280 bus', ['LAZ Bus'] = 'LAZ-695 bus', ['Trolley bus'] = 'ZIU-9 bus', ['VAZ Car'] = 'VAZ-2109 car', ['ZIL-4331'] = 'ZiL-4331 truck', }, Nicknaming = { ['Hummer'] = 'Humvee', ['M1043 HMMWV Armament'] = 'Humvee', ['M1045 HMMWV TOW'] = 'Humvee', }, }, Train = { Transport = { Locomotive = { UnionPacificES44AH = 'ES44AH', RedStarCHME3T = 'Locomotive', }, Wagon = { BoxCar = 'Boxcartrinity', FlatCar = 'Coach a platform', GondolaCar = 'Coach cargo open', StockCar = 'Coach cargo', TankCarBlackLg = 'Tankcartrinity', TankCarBlueSh = 'Coach a tank blue', TankCarYellowSh = 'Coach a tank yellow', WellCar = 'Wellcarnsc', }, }, Civilian = { Locomotive = { ElectricVL80 = 'Electric locomotive', }, Wagon = { PassengerCar = 'Coach a passenger', }, }, All = {}, -- resolved on startup processing ReportNaming = { ['ES44AH'] = 'ES44AH locomotive', ['Locomotive'] = 'CHME3T locomotive', ['Boxcartrinity'] = 'Box car', ['Coach a platform'] = 'Flat car', ['Coach cargo open'] = 'Gondola car', ['Coach cargo'] = 'Stock car', ['Tankcartrinity'] = 'Large tank car', ['Coach a tank blue'] = 'Short tank car (blue)', ['Coach a tank yellow'] = 'Short tank car (yellow)', ['Wellcarnsc'] = 'Well car', ['Electric locomotive'] = 'VL80 locomotive', ['Coach a passenger'] = 'Passenger car', }, }, Ship = { Carrier = { Kuznetsov_AdmiralKuznetsov = 'KUZNECOW', -- 1143.5 Nimitz_CVN74JohnCStennis = 'Stennis', Nimitz_CVN70CarlVinson = 'VINSON', }, HeliCarrier = { Tarawa_LHA1Tarawa = 'LHA_Tarawa', }, BattleCruiser = { Kirov_PyotrVelikiy = 'PIOTR', -- 1144.2 }, Cruiser = { Slava_Moskva = 'MOSCOW', -- 1164 Ticonderoga = 'TICONDEROG', }, Destroyer = { Neustrashimy_Neustrashimy = 'NEUSTRASH', -- 1154.0 OliverHazardPerry = 'PERRY', Type052B = '052B', Type052C = '052C', }, Frigate = { KrivakII_Rezky = 'REZKY', -- 1135M GrishaV = 'ALBATROS', -- 1124.4 Type054A = '054A', }, Corvette = { TarantulIII = 'MOLNIYA', -- 1241.1MP }, Submarine = { Kilo = 'KILO', -- 877 Tango = 'SOM', -- 641B Type093 = 'Type 093', }, Gunboat = { Speedboat = 'speedboat' , }, Transport = { BulkCargo = { BulkCarrier_Yakushev = 'Dry-cargo ship-1', }, ISOCargo = { ContainerShip_Ivanov = 'Dry-cargo ship-2', }, Refueler = { Tanker_Elnya = 'ELNYA', }, }, Civilian = { Yacht_Zvezdny = 'ZWEZDNY', }, All = {}, -- resolved on startup processing NATOReporting = { ['KUZNECOW'] = 'Kuznetsov:', ['PIOTR'] = 'Kirov:', ['MOSCOW'] = 'Slava:', ['NEUSTRASH'] = 'Neustrashimy:', ['052B'] = 'Luyang I:', ['052C'] = 'Luyang II:', ['REZKY'] = 'Krivak II:', ['ALBATROS'] = 'Grisha V:', ['054A'] = 'Jiangkai II:', ['MOLNIYA'] = 'Tarantul III:', ['KILO'] = 'Kilo:', ['SOM'] = 'Tango:', ['Type 093'] = 'Shang:', ['ELNYA'] = 'Altay::Tanker', }, WTOReporting = { ['KUZNECOW'] = 'Orel:(P.1143.5)', ['PIOTR'] = 'Orlan:(P.1144.2)', ['MOSCOW'] = 'Atlant:(P.1164)', ['NEUSTRASH'] = 'Yastreb:(P.1154.0)', ['052B'] = 'Guangzhou:', ['052C'] = 'Lanzhou:', ['REZKY'] = 'Burevestnik M:(P.1135M)', ['ALBATROS'] = 'Albatros:(P.1124.4)', ['054A'] = 'Xuzhou:', ['MOLNIYA'] = 'Molniya:(P.1241.1MP)', ['KILO'] = 'Paltus:(P.877)', ['SOM'] = 'Som:(P.641B)', ['Type 093'] = '09-III:', ['ELNYA'] = 'Altay:(P.160):Oiler', }, ReportNaming = { ['KUZNECOW'] = '%R-class Carrier', ['Stennis'] = 'Nimitz-class (late) Carrier', ['VINSON'] = 'Nimitz-class (early) Carrier', ['LHA_Tarawa'] = 'Tarawa-class Assault Ship', ['PIOTR'] = '%R-class BattleCruiser', ['MOSCOW'] = '%R-class Cruiser', ['TICONDEROG'] = 'Ticonderoga-class Cruiser', ['NEUSTRASH'] = '%R-class Destroyer', ['PERRY'] = 'Oliver Hazard Perry-class Destroyer', ['052B'] = 'Type 052B (%R-class) Destroyer', ['052C'] = 'Type 052C (%R-class) Destroyer', ['REZKY'] = '%R-class Frigate', ['ALBATROS'] = '%R-class Frigate', ['054A'] = 'Type 054A (%R-class) Frigate', ['MOLNIYA'] = '%R-class Corvette', ['KILO'] = '%R-class Submarine', ['SOM'] = '%R-class Submarine', ['Type 093'] = 'Type 093 (%R-class) Submarine', ['speedboat'] = 'Speedboat', ['Dry-cargo ship-1'] = 'Bulk carrier Ship', ['Dry-cargo ship-2'] = 'Container Ship', ['ELNYA'] = '%R-class %N', ['ZWEZDNY'] = 'Civilian Yacht', }, Nicknaming = { ['052C'] = 'Chinese Aegis', }, }, Static = { -- values are in format "category:shape_name:type" Airbase = { AirshowCrowd = 'Fortifications:Crowd1:Airshow_Crowd', AirshowCone = 'Fortifications:Comp_cone:Airshow_Cone', FuelStorageTank = 'Fortifications:toplivo-bak:Fuel tank', HangarA = 'Fortifications:angar_a:Hangar A', HangarB = 'Fortifications:angar_b:Hangar B', ReinforcedHangar = 'Fortifications:ukrytie:Shelter', StorageShelter = 'Fortifications:ukrytie_b:Shelter B', RepairWorkshop = 'Fortifications:tech:Repair workshop', Windsock = 'Fortifications:H-Windsock_RW:Windsock', }, Barrier = { RoadBarrier = 'Cargos:f_bar_cargo:f_bar_cargo', Tetrapod = 'Cargos:tetrapod_cargo:tetrapod_cargo', LogsLg = 'Cargos:trunks_long_cargo:trunks_long_cargo', LogsSh = 'Cargos:trunks_small_cargo:trunks_small_cargo', PipesLg = 'Cargos:pipes_big_cargo:pipes_big_cargo', PipesSh = 'Cargos:pipes_small_cargo:pipes_small_cargo', }, Cargo = { AmmoBox = 'Cargos:ammo_box_cargo:ammo_cargo', Barrels = 'Cargos:barrels_cargo:barrels_cargo', Container = 'Cargos:bw_container_cargo:container_cargo', FuelTank = 'Cargos:fueltank_cargo:fueltank_cargo', ISOContainerLg = 'Cargos:iso_container_cargo:iso_container', ISOContainerSm = 'Cargos:iso_container_small_cargo:iso_container_small', M117Bombs = 'Cargos:m117_cargo:m117_cargo', OilTank = 'Cargos:oiltank_cargo:oiltank_cargo', SlungCargo = 'Cargos:ab-212_cargo:uh1h_cargo', }, Effect = { BigSmoke = 'Effects::big_smoke', BigSmokePresets = { SmallSmokeAndFire = 1, MediumSmokeAndFire = 2, LargeSmokeAndFire = 3, HugeSmokeAndFire = 4, SmallSmoke = 5, MediumSmoke = 6, LargeSmoke = 7, HugeSmoke = 8 }, -- effectPreset DustSmoke = 'Effects::dust_smoke', DustSmokePresets = { test1 = 1, test2 = 2, test3 = 3 }, -- effectPreset SmokingLine = 'Effects::smoking_line', SmokingLinePresets = { test1 = 1, test2 = 2, test3 = 3 }, -- effectPreset SmokyMarker = 'Effects::smoky_marker', SmokyMarkerPresets = { test1 = 1, test2 = 2, test3 = 3 }, -- effectPreset }, Factory = { ChemicalTank = 'Fortifications:him_bak_a:Chemical tank A', ManufacturingPlant = 'Fortifications:kombinat:Tech combine', EquipmentHangar = 'Fortifications:ceh_ang_a:Tech hangar A', FactoryWorkshop = 'Fortifications:tec_a:Workshop A', }, FARP = { AmmoStorage = 'Fortifications:SetkaKP:FARP Ammo Dump Coating', CommandPost = 'Fortifications:kp_ug:FARP CP Blindage', FuelDepot = 'Fortifications:GSM Rus:FARP Fuel Depot', Tent = 'Fortifications:PalatkaB:FARP Tent', Heliport = 'Heliports:FARPS:FARP', Helipad = 'Heliports:FARP:SINGLE_HELIPAD', HeliportCallsigns = { London = 1, Dallas = 2, Paris = 3, Moscow = 4, Berlin = 5, Rome = 6, Madrid = 7, Warsaw = 8, Dublin = 9, Perth = 10 }, -- heliport_callsign_id }, Fort = { Barracks = 'Fortifications::house1arm', Dormitory = 'Fortifications:kazarma2:Barracks 2', HillsideBunker = 'Fortifications::Sandbox', PillboxBunker = 'Fortifications::Bunker', CommandCenter = 'Fortifications:ComCenter:.Command Center', Generators = 'Fortifications:GeneratorF:GeneratorF', House = 'Fortifications::houseA_arm', Landmine = 'Fortifications:landmine:Landmine', Latrine = 'Fortifications:WC:WC', Outpost = 'Fortifications::outpost', RoadOutpost = 'Fortifications::outpost_road', StaffBuilding = 'Fortifications:aviashtab:Military staff', WatchTower = 'Fortifications::house2arm', }, Marker = { RedFlag = 'Fortifications:H-flag_R:Red_Flag', WhiteFlag = 'Fortifications:H-Flag_W:White_Flag', BlackTire = 'Fortifications:H-tyre_B:Black_Tyre', WhiteTire = 'Fortifications:H-tyre_W:White_Tyre', BlackTireRedFlag = 'Fortifications:H-tyre_B_RF:Black_Tyre_RF', BlackTireWhiteFlag = 'Fortifications:H-tyre_B_WF:Black_Tyre_WF', }, OilField = { OilDerrick = 'Fortifications:neftevyshka:Oil derrick', OilPlatform = 'Fortifications:plavbaza:Oil platform', OilPumpStation = 'Fortifications:nasos:Pump station', }, Railway = { RailwayCrossingA = 'Fortifications:pereezd_big:Railway crossing A', RailwayCrossingB = 'Fortifications:pereezd_small:Railway crossing B', RailwayStation = 'Fortifications:r_vok_sd:Railway station', }, SeaShelf = { GasPlatform = 'Heliports:gas_platform:Gas platform', OilRigPlatform = 'Heliports:oil_platform:Oil rig', }, Telecom = { CommsTower = 'Fortifications:tele_bash_m:Comms tower M', BroadcastTower = 'Fortifications:tele_bash:TV tower', }, Warehouse = { AmmunitionDepot = 'Warehouses:SkladC:.Ammunition depot', Tank1 = 'Warehouses:bak:Tank', Tank2 = 'Warehouses:airbase_tbilisi_tank_01:Tank 2', Tank3 = 'Warehouses:airbase_tbilisi_tank_02:Tank 3', Warehouse = 'Warehouses:sklad:Warehouse', }, Civilian = { BoilerHouse = 'Fortifications:kotelnaya_a:Boiler-house A', Cafe = 'Fortifications:stolovaya:Cafe', ContainerBrown = 'Fortifications:konteiner_brown:Container brown', ContainerRed1 = 'Fortifications:konteiner_red1:Container red 1', ContainerRed2 = 'Fortifications:konteiner_red2:Container red 2', ContainerRed3 = 'Fortifications:konteiner_red3:Container red 3', ContainerWhite = 'Fortifications:konteiner_white:Container white', ElectricPowerBox = 'Fortifications:tr_budka:Electric power box', FarmA = 'Fortifications:ferma_a:Farm A', FarmB = 'Fortifications:ferma_b:Farm B', GarageA = 'Fortifications:garage_a:Garage A', GarageB = 'Fortifications:garage_b:Garage B', GarageSmA = 'Fortifications:garagh-small-a:Garage small A', GarageSmB = 'Fortifications:garagh-small-b:Garage small B', Restaurant = 'Fortifications:restoran1:Restaurant 1', Shop = 'Fortifications:magazin:Shop', HouseSmA = 'Fortifications:domik1a:Small house 1A', HouseSmB = 'Fortifications:domik1b:Small house 1B', HouseSmC = 'Fortifications:dom2c:Small house 2C', HouseFnA = 'Fortifications:domik1a-all:Small house 1A area', HouseFnB = 'Fortifications:domik1b-all:Small house 1B area', HouseFnC = 'Fortifications:dom2c-all:Small house 1C area', WarehouseSm1 = 'Fortifications:s1:Small werehouse 1', WarehouseSm2 = 'Fortifications:s2:Small werehouse 2', WarehouseSm3 = 'Fortifications:s3:Small werehouse 3', WarehouseSm4 = 'Fortifications:s4:Small werehouse 4', SubsidiarySt1 = 'Fortifications:hozdomik1:Subsidiary structure 1', SubsidiarySt2 = 'Fortifications:hozdomik2:Subsidiary structure 2', SubsidiarySt3 = 'Fortifications:hozdomik3:Subsidiary structure 3', SubsidiaryStA = 'Fortifications:saray-a:Subsidiary structure A', SubsidiaryStB = 'Fortifications:saray-b:Subsidiary structure B', SubsidiaryStC = 'Fortifications:saray-c:Subsidiary structure C', SubsidiaryStD = 'Fortifications:saray-d:Subsidiary structure D', SubsidiaryStE = 'Fortifications:saray-e:Subsidiary structure E', SubsidiaryStF = 'Fortifications:saray-f:Subsidiary structure F', SubsidiaryStG = 'Fortifications:saray-g:Subsidiary structure G', Supermarket = 'Fortifications:uniwersam_a:Supermarket A', WaterTower = 'Fortifications:wodokachka_a:Water tower A', }, All = {}, -- resolved on startup processing Plane = {}, -- resolved on startup processing Helicopter = {}, -- resolved on startup processing Ground = {}, -- resolved on startup processing Ship = {}, -- resolved on startup processing Train = {}, -- resolved on startup processing ReportNaming = { -- Airbase ['Airshow_Crowd'] = 'Airshow crowd', ['Airshow_Cone'] = 'Airshow cone', ['Fuel tank'] = 'Fuel storage tank', ['Hangar A'] = 'Hangar (A)', ['Hangar B'] = 'Hangar (B)', ['Shelter'] = 'Reinforced hangar', ['Shelter B'] = 'Storage shelter', -- Barrier ['f_bar_cargo'] = 'Road barrier', ['tetrapod_cargo'] = 'Tetrapod', ['trunks_long_cargo'] = 'Long logs', ['trunks_small_cargo'] = 'Short logs', ['pipes_big_cargo'] = 'Long pipes', ['pipes_small_cargo'] = 'Short pipes', -- Cargo ['ammo_cargo'] = 'Ammo box', ['barrels_cargo'] = 'Barrels', ['container_cargo'] = 'Container', ['fueltank_cargo'] = 'Fuel tank', ['iso_container'] = 'Large ISO container', ['iso_container_small'] = 'Small ISO container', ['m117_cargo'] = 'M117 bombs', ['oiltank_cargo'] = 'Oil tank', ['uh1h_cargo'] = 'Slung cargo', -- Effect ['big_smoke'] = 'Big smoke', ['dust_smoke'] = 'Dust smoke', ['smoking_line'] = 'Smoking line', ['smoky_marker'] = 'Smoky marker', -- Factory ['Chemical tank A'] = 'Chemical tank', ['Tech combine'] = 'Manufacturing plant', ['Tech hangar A'] = 'Equipment hangar', ['Workshop A'] = 'Factory workshop', -- FARP ['FARP Ammo Dump Coating'] = 'Ammo storage', ['FARP CP Blindage'] = 'Command Post', ['FARP Fuel Depot'] = 'Fuel depot', ['FARP Tent'] = 'Tent', ['FARP'] = 'Heliport', ['SINGLE_HELIPAD'] = 'Helipad', -- Fort ['Barracks 2'] = 'Barracks dormitory', ['.Command Center'] = 'Command Center', ['GeneratorF'] = 'Generators', ['WC'] = 'Latrine', ['Military staff'] = 'Staff building', -- Marker ['Red_Flag'] = 'Red flag', ['White_Flag'] = 'White flag', ['Black_Tyre'] = 'Black tire', ['White_Tyre'] = 'White tire', ['Black_Tyre_RF'] = 'Black tire/Red flag', ['Black_Tyre_WF'] = 'Black tire/White flag', -- OilField ['Pump station'] = 'Oil pump station', -- Railway ['Railway crossing A'] = 'Railway crossing (A)', ['Railway crossing B'] = 'Railway crossing (B)', -- SeaShelf ['Oil rig'] = 'Oil rig platform', -- Telecom ['Comms tower M'] = 'Communications tower', ['TV tower'] = 'Broadcasting tower', -- Warehouse ['.Ammunition depot'] = 'Ammunition depot', ['Tank'] = 'Storage tank (1)', ['Tank 2'] = 'Storage tank (2)', ['Tank 3'] = 'Storage tank (3)', -- Civilian ['Boiler-house A'] = 'Boiler house', ['Container brown'] = 'Container (brown)', ['Container red 1'] = 'Container (red 1)', ['Container red 2'] = 'Container (red 2)', ['Container red 3'] = 'Container (red 3)', ['Container white'] = 'Container (white)', ['Farm A'] = 'Farm (A)', ['Farm B'] = 'Farm (B)', ['Garage A'] = 'Garage (A)', ['Garage B'] = 'Garage (B)', ['Garage small A'] = 'Small garage (A)', ['Garage small B'] = 'Small garage (B)', ['Restaurant 1'] = 'Restaurant', ['Small house 1A'] = 'Small house (A)', ['Small house 1B'] = 'Small house (B)', ['Small house 2C'] = 'Small house (C)', ['Small house 1A area'] = 'Fenced house (A)', ['Small house 1B area'] = 'Fenced house (B)', ['Small house 1C area'] = 'Fenced house (C)', ['Small werehouse 1'] = 'Small warehouse (1)', ['Small werehouse 2'] = 'Small warehouse (2)', ['Small werehouse 3'] = 'Small warehouse (3)', ['Small werehouse 4'] = 'Small warehouse (4)', ['Subsidiary structure 1'] = 'Subsidiary structure (1)', ['Subsidiary structure 2'] = 'Subsidiary structure (2)', ['Subsidiary structure 3'] = 'Subsidiary structure (3)', ['Subsidiary structure A'] = 'Subsidiary structure (A)', ['Subsidiary structure B'] = 'Subsidiary structure (B)', ['Subsidiary structure C'] = 'Subsidiary structure (C)', ['Subsidiary structure D'] = 'Subsidiary structure (D)', ['Subsidiary structure E'] = 'Subsidiary structure (E)', ['Subsidiary structure F'] = 'Subsidiary structure (F)', ['Subsidiary structure G'] = 'Subsidiary structure (G)', ['Supermarket A'] = 'Supermarket', ['Water tower A'] = 'Water tower', }, }, All = {}, -- resolved on startup processing Airborne = {}, -- resolved on startup processing Amphibious = {}, -- resolved on startup processing CarrierBorne = {}, -- resolved on startup processing HeavyWheeled = {}, -- resolved on startup processing Marines = {}, -- resolved on startup processing PlayerControllable = {}, -- resolved on startup processing Unavailable = {}, -- resolved on startup processing Available = {}, -- resolved on startup processing NATOReporting = {}, -- resolved on startup processing WTOReporting = {}, -- resolved on startup processing Nicknaming = {}, -- resolved on startup processing } fdmm.unitTypes._resKeyFilter = { 'All', 'Airborne', 'Amphibious', 'CarrierBorne', 'HeavyWheeled', 'Marines', 'PlayerControllable', 'Unavailable', 'Available', 'NATOReporting', 'WTOReporting', 'ReportNaming', 'ProperNaming', 'Nicknaming' } fdmm.unitTypes._resKeySuffixFilter = { 'Presets', 'Callsigns', 'Liveries' } function fdmm.unitTypes._isReservedKey(key) return string.hasPrefix(key, '_') or table.contains(fdmm.unitTypes._resKeyFilter, key) or string.hasAnySuffix(key, fdmm.unitTypes._resKeySuffixFilter) end function fdmm.unitTypes.processEntries() local categoryOverrides = { ['house1arm'] = 'Fortifications', ['houseA_arm'] = 'Fortifications', ['Sandbox'] = 'Fortifications', ['Bunker'] = 'Fortifications', ['outpost'] = 'Fortifications', ['outpost_road'] = 'Fortifications', ['house2arm'] = 'Fortifications', ['TACAN_beacon'] = 'Fortifications' } local function _createGroupAll(unitTypeGroup) local function _createGroupAll_recurse(node, groupAllList) for key, value in pairs(node) do if not fdmm.unitTypes._isReservedKey(key) then if type(value) == 'table' then _createGroupAll_recurse(value, groupAllList) -- recurse, b/c table elseif type(value) == 'string' then -- valid value local fdmmUnitType = key local unitCategory, shapeName, unitType = fdmm.utils.splitTuple(value) unitType = unitType or value if not groupAllList[fdmmUnitType] then -- not yet found groupAllList[fdmmUnitType] = value if string.isNotEmpty(unitType) then if not groupAllList._rev then groupAllList._rev = {} end if not groupAllList._rev[unitType] then groupAllList._rev[unitType] = fdmmUnitType elseif groupAllList._rev[unitType] ~= fdmmUnitType then -- different reverse entry env.error("Group all list reverse discrepancy for unitType=\'" .. unitType .. "\', groupAllList._rev[unitType]=\'" .. groupAllList._rev[unitType] .. "\' ~= fdmmUnitType=\'" .. fdmmUnitType .. "\'.") end end if string.isNotEmpty(shapeName) then if not groupAllList._revShape then groupAllList._revShape = {} end if not groupAllList._revShape[shapeName] then groupAllList._revShape[shapeName] = fdmmUnitType elseif groupAllList._revShape[shapeName] ~= fdmmUnitType then -- different reverse entry env.error("Group all list shape reverse discrepancy for shapeName=\'" .. shapeName .. "\', groupAllList._revShape[shapeName]=\'" .. groupAllList._revShape[shapeName] .. "\' ~= fdmmUnitType=\'" .. fdmmUnitType .. "\'.") end end elseif groupAllList[fdmmUnitType] ~= value then -- different than what we have env.error("Group all list discrepancy for fdmmUnitType=\'" .. fdmmUnitType .. "\', groupAllList[fdmmUnitType]=\'" .. groupAllList[fdmmUnitType] .. "\' ~= value=\'" .. value .. "\'.") end end end end end _createGroupAll_recurse(unitTypeGroup, unitTypeGroup.All) end local function _copyGroupAllToStaticAll(groupAllList, staticAllList, category) for fdmmUnitType, unitType in pairs(groupAllList) do if not fdmm.unitTypes._isReservedKey(fdmmUnitType) then -- possible todo: determine shape name? staticAllList[fdmmUnitType] = (categoryOverrides[unitType] or category) .. '::' .. unitType end end end local function _copyGroupAllToMasterAll(allList, masterAllList) for fdmmUnitType, value in pairs(allList) do if not fdmm.unitTypes._isReservedKey(fdmmUnitType) then local unitType = fdmm.unitTypes.getUnitType(value) if not masterAllList[fdmmUnitType] then masterAllList[fdmmUnitType] = unitType elseif masterAllList[fdmmUnitType] ~= unitType then -- different entry env.error("Master all list discrepancy for fdmmUnitType=\'" .. fdmmUnitType .. "\', masterAllList[fdmmUnitType]=\'" .. masterAllList[fdmmUnitType] .. "\' ~= unitType=\'" .. unitType .. "\'.") end end end end local function _createGroupNamingIfNeeded(unitTypeGroup) if not unitTypeGroup.NATOReporting then unitTypeGroup.NATOReporting = {} end if not unitTypeGroup.WTOReporting then unitTypeGroup.WTOReporting = {} end if not unitTypeGroup.ReportNaming then unitTypeGroup.ReportNaming = {} end if not unitTypeGroup.ProperNaming then unitTypeGroup.ProperNaming = {} end if not unitTypeGroup.Nicknaming then unitTypeGroup.Nicknaming = {} end end local function _copyGroupReportingToStaticReporting(unitTypeGroup, staticUnitTypeGroup) local function _copyGroupNamingToStaticNaming(groupReportNaming, staticReportNaming) for unitType, reportNaming in pairs(groupReportNaming) do if not fdmm.unitTypes._isReservedKey(unitType) then if not staticReportNaming[unitType] then staticReportNaming[unitType] = reportNaming elseif staticReportNaming[unitType] ~= reportNaming then -- different entry env.error("Static report naming discrepancy for unitType=\'" .. unitType .. "\', staticReportNaming[unitType]=\'" .. staticReportNaming[unitType] .. "\' ~= reportNaming=\'" .. reportNaming .. "\'.") end end end end _copyGroupNamingToStaticNaming(unitTypeGroup.NATOReporting, staticUnitTypeGroup.NATOReporting) _copyGroupNamingToStaticNaming(unitTypeGroup.WTOReporting, staticUnitTypeGroup.WTOReporting) _copyGroupNamingToStaticNaming(unitTypeGroup.ReportNaming, staticUnitTypeGroup.ReportNaming) _copyGroupNamingToStaticNaming(unitTypeGroup.ProperNaming, staticUnitTypeGroup.ProperNaming) _copyGroupNamingToStaticNaming(unitTypeGroup.Nicknaming, staticUnitTypeGroup.Nicknaming) end local function _fillInReportNaming(unitTypeGroup) for fdmmUnitType, value in pairs(unitTypeGroup.All) do if not fdmm.unitTypes._isReservedKey(fdmmUnitType) then local unitType = fdmm.unitTypes.getUnitType(value) if not unitTypeGroup.ReportNaming[unitType] then unitTypeGroup.ReportNaming[unitType] = unitType end end end end _createGroupAll(fdmm.consts.UnitType.Plane) _createGroupAll(fdmm.consts.UnitType.Helicopter) _createGroupAll(fdmm.consts.UnitType.Ground) _createGroupAll(fdmm.consts.UnitType.Ship) _createGroupAll(fdmm.consts.UnitType.Train) _copyGroupAllToStaticAll(fdmm.consts.UnitType.Plane.All, fdmm.consts.UnitType.Static.Plane, 'Planes') _copyGroupAllToStaticAll(fdmm.consts.UnitType.Helicopter.All, fdmm.consts.UnitType.Static.Helicopter, 'Helicopters') _copyGroupAllToStaticAll(fdmm.consts.UnitType.Ground.All, fdmm.consts.UnitType.Static.Ground, 'Unarmed') _copyGroupAllToStaticAll(fdmm.consts.UnitType.Train.All, fdmm.consts.UnitType.Static.Train, 'Unarmed') _copyGroupAllToStaticAll(fdmm.consts.UnitType.Ship.All, fdmm.consts.UnitType.Static.Ship, 'Ships') _createGroupAll(fdmm.consts.UnitType.Static) _copyGroupAllToMasterAll(fdmm.consts.UnitType.Plane.All, fdmm.consts.UnitType.All) _copyGroupAllToMasterAll(fdmm.consts.UnitType.Helicopter.All, fdmm.consts.UnitType.All) _copyGroupAllToMasterAll(fdmm.consts.UnitType.Ground.All, fdmm.consts.UnitType.All) _copyGroupAllToMasterAll(fdmm.consts.UnitType.Train.All, fdmm.consts.UnitType.All) _copyGroupAllToMasterAll(fdmm.consts.UnitType.Ship.All, fdmm.consts.UnitType.All) _copyGroupAllToMasterAll(fdmm.consts.UnitType.Static.All, fdmm.consts.UnitType.All) table.concatWith(fdmm.consts.UnitType.Airborne, fdmm.consts.UnitType.Ground.Airborne) table.concatWith(fdmm.consts.UnitType.Amphibious, fdmm.consts.UnitType.Ground.Amphibious) table.concatWith(fdmm.consts.UnitType.CarrierBorne, fdmm.consts.UnitType.Plane.CarrierBorne) table.concatWith(fdmm.consts.UnitType.CarrierBorne, fdmm.consts.UnitType.Helicopter.CarrierBorne) table.concatWith(fdmm.consts.UnitType.HeavyWheeled, fdmm.consts.UnitType.Ground.HeavyWheeled) table.concatWith(fdmm.consts.UnitType.Marines, fdmm.consts.UnitType.Ground.Marines) table.concatWith(fdmm.consts.UnitType.PlayerControllable, fdmm.consts.UnitType.Plane.PlayerControllable) table.concatWith(fdmm.consts.UnitType.PlayerControllable, fdmm.consts.UnitType.Helicopter.PlayerControllable) table.concatWith(fdmm.consts.UnitType.Unavailable, fdmm.consts.UnitType.Plane.Unavailable) table.concatWith(fdmm.consts.UnitType.Unavailable, fdmm.consts.UnitType.Helicopter.Unavailable) table.concatWith(fdmm.consts.UnitType.Unavailable, fdmm.consts.UnitType.Ground.Unavailable) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Plane.CarrierBorne) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Plane.PlayerControllable) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Plane.Unavailable) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Helicopter.CarrierBorne) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Helicopter.PlayerControllable) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Helicopter.Unavailable) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Ground.Airborne) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Ground.Amphibious) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Ground.HeavyWheeled) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Ground.Marines) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Ground.Unavailable) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.All) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Airborne) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Amphibious) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.CarrierBorne) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.HeavyWheeled) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Marines) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.PlayerControllable) fdmm.utils.ensureReversedDict(fdmm.consts.UnitType.Unavailable) _createGroupNamingIfNeeded(fdmm.consts.UnitType.Plane) _createGroupNamingIfNeeded(fdmm.consts.UnitType.Helicopter) _createGroupNamingIfNeeded(fdmm.consts.UnitType.Ground) _createGroupNamingIfNeeded(fdmm.consts.UnitType.Ship) _createGroupNamingIfNeeded(fdmm.consts.UnitType.Train) _createGroupNamingIfNeeded(fdmm.consts.UnitType.Static) _fillInReportNaming(fdmm.consts.UnitType.Plane) _fillInReportNaming(fdmm.consts.UnitType.Helicopter) _fillInReportNaming(fdmm.consts.UnitType.Ground) _fillInReportNaming(fdmm.consts.UnitType.Ship) _fillInReportNaming(fdmm.consts.UnitType.Train) _copyGroupReportingToStaticReporting(fdmm.consts.UnitType.Plane, fdmm.consts.UnitType.Static) _copyGroupReportingToStaticReporting(fdmm.consts.UnitType.Helicopter, fdmm.consts.UnitType.Static) _copyGroupReportingToStaticReporting(fdmm.consts.UnitType.Ground, fdmm.consts.UnitType.Static) _copyGroupReportingToStaticReporting(fdmm.consts.UnitType.Ship, fdmm.consts.UnitType.Static) _copyGroupReportingToStaticReporting(fdmm.consts.UnitType.Train, fdmm.consts.UnitType.Static) _fillInReportNaming(fdmm.consts.UnitType.Static) table.concatWith(fdmm.consts.UnitType.Nicknaming, fdmm.consts.UnitType.Plane.Nicknaming) table.concatWith(fdmm.consts.UnitType.Nicknaming, fdmm.consts.UnitType.Helicopter.Nicknaming) table.concatWith(fdmm.consts.UnitType.Nicknaming, fdmm.consts.UnitType.Ground.Nicknaming) table.concatWith(fdmm.consts.UnitType.Nicknaming, fdmm.consts.UnitType.Train.Nicknaming) table.concatWith(fdmm.consts.UnitType.Nicknaming, fdmm.consts.UnitType.Ship.Nicknaming) table.concatWith(fdmm.consts.UnitType.Nicknaming, fdmm.consts.UnitType.Static.Nicknaming) end function fdmm.unitTypes.createUnitTypeAvailability() assert(db, "Missing module: db") assert(dbYears, "Missing module: dbYears") fdmm.consts.UnitType.Available = {} for fdmmUnitType, unitType in pairs(fdmm.consts.UnitType.All) do if not fdmm.unitTypes._isReservedKey(fdmmUnitType) then local availability = {} if dbYears[unitType] then local countries = db.getHistoricalCountres(unitType) for _, country in pairs(countries) do local begYear, endYear = db.getYearsLocal(unitType, country) availability[string.lower(string.trim(country))] = { begYear, endYear } end else availability['all'] = { 1900, 9999 } end fdmm.consts.UnitType.Available[unitType] = availability end end end function fdmm.unitTypes.isMissingAvailability() local availabilityFilename = fdmm.fullPath .. "data/UnitTypeAvailability.json" return not fdmm.utils.getFileExists(availabilityFilename) end function fdmm.unitTypes.saveUnitTypeAvailability() env.info("FDDM: Saving UnitType availability...") local availabilityFilename = fdmm.fullPath .. "data/UnitTypeAvailability.json" fdmm.utils.encodeToJSONFile(fdmm.consts.UnitType.Available, availabilityFilename) end function fdmm.unitTypes.loadUnitTypeAvailability() env.info("FDDM: Loading UnitType availability...") local availabilityFilename = fdmm.fullPath .. "data/UnitTypeAvailability.json" fdmm.consts.UnitType.Available = fdmm.utils.decodeFromJSONFile(availabilityFilename) end function fdmm.unitTypes.crossRefEntries() assert(db, "Missing module: db") assert(dbYears, "Missing module: dbYears") env.info("FDMM: Cross-referencing units...") local function _crossRefUnits(keyPath, unitArray) local num = table.maxn(unitArray) for idx = 1,num do local unitData = unitArray[idx] if unitData then local unitType = unitData.Name local unitTypeAliases = unit_aliases._rev[unitType] local fdmmUnitType = fdmm.consts.UnitType.All._rev[unitType] if not fdmmUnitType and unitTypeAliases then if type(unitTypeAliases) == 'string' then unitTypeAliases = { unitTypeAliases } end for _,unitTypeAlias in ipairs(unitTypeAliases) do fdmmUnitType = fdmm.consts.UnitType.All._rev[unitTypeAlias] if fdmmUnitType then env.warning(" unitTypeAlias=[\'" .. unitTypeAlias .. "\'] is now unitType=[\'" .. unitType .. "\'].") break end end end if not fdmmUnitType then env.info(" Missing fdmmUnitType for unitType=[\'" .. (unitType or "<null>") .. "\'] from " .. keyPath .. "[" .. idx .. "].") end end end end fdmm.utils.ensureReversedDict(unit_aliases) _crossRefUnits('db.Units.Animals', db.Units.Animals.Animal) _crossRefUnits('db.Units.Cargos', db.Units.Cargos.Cargo) _crossRefUnits('db.Units.Cars', db.Units.Cars.Car) _crossRefUnits('db.Units.Fortifications', db.Units.Fortifications.Fortification) _crossRefUnits('db.Units.Helicopters', db.Units.Helicopters.Helicopter) _crossRefUnits('db.Units.Heliports', db.Units.Heliports.Heliport) _crossRefUnits('db.Units.LTAvehicles', db.Units.LTAvehicles.LTAvehicle) _crossRefUnits('db.Units.Personnel', db.Units.Personnel.Personnel) _crossRefUnits('db.Units.Planes', db.Units.Planes.Plane) _crossRefUnits('db.Units.Ships', db.Units.Ships.Ship) _crossRefUnits('db.Units.WWIIstructures', db.Units.WWIIstructures.WWIIstructure) _crossRefUnits('db.Units.Warehouses', db.Units.Warehouses.Warehouse) local checkDBYears = false -- change to true to run the following if checkDBYears then local unitArray = {} for unitType,_ in pairs(dbYears) do table.insert(unitArray, {Name = unitType}) end _crossRefUnits('dbYears', unitArray) end end function fdmm.unitTypes.whichAvailableToCountryIn(unitTypesDict, countryName, year) local retVal = {} local countryName = string.lower(countryName) for fdmmUnitType, value in pairs(unitTypesDict) do if not string.hasPrefix(fdmmUnitType, '_') then local unitType = fdmm.unitTypes.getUnitType(value) if not fdmm.unitTypes.isListedUnder(unitType, fdmm.consts.UnitType.Unavailable) then local availability = fdmm.consts.UnitType.Available[unitType] local yearRange = availability[countryName] or availability['all'] if yearRange and year >= yearRange[1] and year <= yearRange[2] then retVal[fdmmUnitType] = value end end end end return retVal end function fdmm.unitTypes.anyAvailableToCountryIn(unitTypesDict, countryName, year) local countryName = string.lower(countryName) for fdmmUnitType, value in pairs(unitTypesDict) do if not string.hasPrefix(fdmmUnitType, '_') then local unitType = fdmm.unitTypes.getUnitType(value) if not fdmm.unitTypes.isListedUnder(unitType, fdmm.consts.UnitType.Unavailable) then local availability = fdmm.consts.UnitType.Available[unitType] local yearRange = availability[countryName] or availability['all'] if yearRange and year >= yearRange[1] and year <= yearRange[2] then return true end end end end return false end function fdmm.unitTypes.isAvailableToCountryIn(unitType, countryName, year) local countryName = string.lower(countryName) if not fdmm.unitTypes.isListedUnder(unitType, fdmm.consts.UnitType.Unavailable) then local availability = fdmm.consts.UnitType.Available[unitType] local yearRange = availability[countryName] or availability['all'] if yearRange and year >= yearRange[1] and year <= yearRange[2] then return true end end return false end function fdmm.unitTypes.whichListedUnder(unitTypesDict, listedTypesDict) fdmm.utils.ensureReversedDict(listedTypesDict) local retVal = {} for fdmmUnitType, value in pairs(unitTypesDict) do if not string.hasPrefix(fdmmUnitType, '_') then local unitType = fdmm.unitTypes.getUnitType(value) if listedTypesDict._rev[unitType] then retVal[fdmmUnitType] = value end end end return retVal end function fdmm.unitTypes.anyListedUnder(unitTypesDict, listedTypesDict) fdmm.utils.ensureReversedDict(listedTypesDict) for fdmmUnitType, value in pairs(unitTypesDict) do if not string.hasPrefix(fdmmUnitType, '_') then local unitType = fdmm.unitTypes.getUnitType(value) if listedTypesDict._rev[unitType] then return true end end end return false end function fdmm.unitTypes.isListedUnder(unitType, listedTypesDict) fdmm.utils.ensureReversedDict(listedTypesDict) if listedTypesDict._rev[unitType] then return true end return false end function fdmm.unitTypes.getUnitType(value) local unitCategory, shapeName, unitType = fdmm.utils.splitTuple(value) unitType = unitType or value return unitType end function fdmm.unitTypes.getUnitTypeGroup(unitType) if fdmm.consts.UnitType.Plane.All._rev[unitType] then return fdmm.consts.UnitType.Plane elseif fdmm.consts.UnitType.Helicopter.All._rev[unitType] then return fdmm.consts.UnitType.Helicopter elseif fdmm.consts.UnitType.Ground.All._rev[unitType] then return fdmm.consts.UnitType.Ground elseif fdmm.consts.UnitType.Train.All._rev[unitType] then return fdmm.consts.UnitType.Train elseif fdmm.consts.UnitType.Ship.All._rev[unitType] then return fdmm.consts.UnitType.Ship elseif fdmm.consts.UnitType.Static.All._rev[unitType] or fdmm.consts.UnitType.Static.All._revShape[unitType] then return fdmm.consts.UnitType.Static end return nil end function fdmm.unitTypes.getUnitReportName(allianceType, unitType, unitTypeGroup) local allianceReportingKey = allianceType .. 'Reporting' local reportName = fdmm.consts.UnitType[allianceReportingKey][unitType] if string.isEmpty(reportName) then local unitTypeGroup = unitTypeGroup or fdmm.unitTypes.getUnitTypeGroup(unitType) local allianceReporting = unitTypeGroup[allianceReportingKey][unitType] local reportingFront, reportingBack, accessoryName = fdmm.utils.splitTuple(allianceReporting) reportingFront = reportingFront or allianceReporting reportName = unitTypeGroup.ReportNaming[unitType] local properName = unitTypeGroup.ProperNaming[unitType] if string.isNotEmpty(reportingFront) and string.contains(reportName, '%R') then reportName = reportName:gsub('%%R', reportingFront) end if string.isNotEmpty(accessoryName) and string.contains(reportName, '%N') then reportName = reportName:gsub('%%N', accessoryName) end if string.isNotEmpty(properName) and not string.contains(reportName, properName) then reportName = reportName .. ' ' .. properName end if string.isNotEmpty(reportingBack) and not string.contains(reportName, reportingBack) then reportName = reportName .. ' ' .. reportingBack end fdmm.consts.UnitType[allianceReportingKey][unitType] = reportName end return reportName end function fdmm.unitTypes.getNATOUnitReportName(unitType, unitTypeGroup) return fdmm.unitTypes.getUnitReportName(fdmm.enums.Alliance.NATO, unitType, unitTypeGroup) end function fdmm.unitTypes.getWTOUnitReportName(unitType, unitTypeGroup) return fdmm.unitTypes.getUnitReportName(fdmm.enums.Alliance.WTO, unitType, unitTypeGroup) end function fdmm.unitTypes.dumpUnitReportNames() env.info("FDMM: Dumping unit report names...") local function _dumpReportNames(unitTypeGroup) for _,fdmmUnitType in pairs(table.sortedKeysList(unitTypeGroup.All)) do if not string.hasPrefix(fdmmUnitType, '_') then local value = unitTypeGroup.All[fdmmUnitType] local unitType = fdmm.unitTypes.getUnitType(value) env.info(" [\'" .. fdmmUnitType .. "\'] = \'" .. unitType .. "\':") env.info(" NATO: " .. fdmm.unitTypes.getNATOUnitReportName(unitType, unitTypeGroup)) env.info(" WTO : " .. fdmm.unitTypes.getWTOUnitReportName(unitType, unitTypeGroup)) end end end _dumpReportNames(fdmm.consts.UnitType.Static) end end -- /FDMM_UnitTypes env.info("---FDMM_UnitTypes End---");
object_static_worldbuilding_terminal_cantina_droid_detector = object_static_worldbuilding_terminal_shared_cantina_droid_detector:new { } ObjectTemplates:addTemplate(object_static_worldbuilding_terminal_cantina_droid_detector, "object/static/worldbuilding/terminal/cantina_droid_detector.iff")
-- The unipolar_full_step example script was written as part of LabJack''s -- "Stepper Motor Controller" App-Note. There is an accompanying python script -- as well as a (Windows Only) LabVIEW example application that should be run -- in conjunction wth this script. -- See: https://labjack.com/support/app-notes/digital-IO/stepper-motor-controller print("Use the following registers:") print("46080: Target Position (steps)") print("46082: Current Position (steps)") print("46180: enable, 1:enable, 0: disable") print("46181: eStop, 1: eStop, 0: run") print("46182: hold, 1: hold position of motor, 0: release motor (after movement)") print("46183: setHome, (setHome)") local mbR = MB.R local mbW = MB.W -- Configurable Variables local enable = false -- 46180, "USER_RAM0_U16", type: 0; enable/disable control. local targ = 0 -- 46080, "USER_RAM1_I32", type: 2 local pos = 0 -- 46082, "USER_RAM0_I32", type: 2 local eStop = 0 -- 46181, "USER_RAM1_U16", type: 0; Value read before setting I/O line states to immediately disengage motor. local hold = 1 -- 46182, "USER_RAM2_U16", type: 0;Enable hold mode by default at end of movement sequence. local setHome = 0 -- 46183, "USER_RAM3_U16", type: 0; Set new "zero" or "home" -- Define FIO Channels local chA = 2008--EIO0 local chB = 2009--EIO1 local chC = 2012--EIO4 local chD = 2013--EIO5 mbW(chA, 0, 0) --EIO0 = DIO8 mbW(chB, 0, 0) --EIO1 = DIO9 mbW(chC, 0, 0) --EIO4 = DIO12 mbW(chD, 0, 0) --EIO5 = DIO13 --Define the Full Step Sequence local a = {1,0,0,0} -- This is the control logic for line A local b = {0,0,1,0} -- This is the control logic for line A'' local c = {0,1,0,0} -- This is the control logic for line B local d = {0,0,0,1} -- This is the control logic for line B'' local numSteps =table.getn(a) local i = 0 local m0, m1, m2, m3 = 0 -- Set initial USER_RAM values. mbW(46080, 2, targ) mbW(46082, 2, pos) mbW(46180, 0, enable) mbW(46181, 0, eStop) mbW(46182, 0, hold) mbW(46183, 0, setHome) -- Initialize variable used for the Re-Zero "target"/Motor control. LJ.IntervalConfig(0, 4) -- For stepper motor control LJ.IntervalConfig(1, 1000) -- For printing current state while true do if LJ.CheckInterval(1) then print("Current State", enable, target, pos, eStop) end if LJ.CheckInterval(0) then enable = (mbR(46180, 0) == 1) -- Determine if we should start moving. targ = mbR(46080, 2) -- Read desired "target" if enable then -- if allowed to move if pos == targ then--if we have reached the new position --write enable to 0 to signal finished enable = false mbW(46180, 0, 0) print("reached new pos") -- Determine if motor should be "held in place" hold = mbR(46182, 0) if hold == 0 then --set all low to allow free movement m0 = 0 m1 = 0 m2 = 0 m3 = 0 end --else if hold then keep the same position activated elseif pos < targ then -- if behind, go foreward pos = pos+1--increment position by 1 i = pos%numSteps+1--lua is 1-indexed, so add a 1 m0 = a[i]--write the new positions m1 = b[i] m2 = c[i] m3 = d[i] elseif pos > targ then-- if ahead, move back pos = pos-1 i = pos%numSteps+1 m0 = a[i] m1 = b[i] m2 = c[i] m3 = d[i] end else -- if not enable hold = mbR(46182, 0) setHome = mbR(46183, 0) if setHome == 1 then-- if home register is set to make a new home print("New home created") mbW(46183, 0, 0) pos = 0;--make a new home end if hold == 0 then m0 = 0 m1 = 0 m2 = 0 m3 = 0 end end -- Update variable with current position mbW(46082, 2, pos) eStop = mbR(46181, 0) if eStop == 1 then m0 = 0; m1 = 0; m2 = 0; m3 = 0 end mbW(chA, 0, m0) --EIO0 = DIO8 mbW(chB, 0, m1) --EIO1 = DIO9 mbW(chC, 0, m2) --EIO2 = DIO10 mbW(chD, 0, m3) --EIO3 = DIO11 end end
local PluginRoot = script:FindFirstAncestor("SurfaceTool") local Roact: Roact = require(PluginRoot.Packages.Roact) local Llama = require(PluginRoot.Packages.Llama) local Contexts = require(script.Parent.Contexts) local e = Roact.createElement local Component: RoactComponent = Roact.PureComponent:extend("PluginMenu") Component.defaultProps = { plugin = nil, -- Plugin id = nil, -- string open = false, -- boolean onOpen = nil, -- callback(menu: PluginMenu) onClose = nil, -- callback(menu: PluginMenu, result: PluginAction?) } function Component:init() local plugin: Plugin = self.props.plugin self.menu = plugin:CreatePluginMenu(self.props.id) self.open = function() coroutine.wrap(function() local result = self.menu:ShowAsync() if type(self.props.onClose) == "function" then self.props.onClose(self.menu, result) if self.props.show then self.open() end end end)() if type(self.props.onOpen) == "function" then self.props.onOpen(self.menu) end end end function Component:didMount() if self.props.open then self.open() end end function Component:willUnmount() self.menu:Destroy() end function Component:didUpdate(prevProps) if self.props.open ~= prevProps.open and self.props.open == true then self.open() end end function Component:render() return e(Contexts.Menu.Provider, { value = { instance = self.menu, open = self.open, }, }, self.props[Roact.Children]) end return function(props) props = props or {} return e(Contexts.Plugin.Consumer, { render = function(plugin: Plugin) return e(Component, Llama.Dictionary.merge(props, { plugin = plugin, })) end, }) end
-- example script that demonstrates use of thread:stop() local counter = 1 function response() if counter == 100 then wrk.thread:stop() end counter = counter + 1 end
local function hasPointerArg(v) for _, v in ipairs(v.arguments) do if v.pointer or v.type.name == 'Any' then return true end end return false end print('void PointerArgumentSafety_Impl()\n{') for _, v in pairs(_natives) do if matchApiSet(v) and hasPointerArg(v) then local avs = '' local i = 0 for _, a in ipairs(v.arguments) do -- 'Any*' can't be guaranteed-safe if a.pointer and a.type.name == 'Any' and not v.name:match('^_?GET_') then -- hackaround to allow GET_ dataview prevalent-stuff avs = avs .. ('\tcxt->GetArgument<void*>(%d) = nullptr; // Any* %s\n'):format(i, a.name) end if a.pointer or a.type.name == 'Any' then avs = avs .. ('\tif (!ValidateArg(cxt->GetArgument<void*>(%d))) { return; }\n'):format(i) end i = i + 1 end local a = (([[ // NAME static auto nh_HASH = rage::scrEngine::GetNativeHandler(HASH); rage::scrEngine::RegisterNativeHandler(HASH, [](rage::scrNativeCallContext* cxt) { ARG_VALIDATORS nh_HASH(cxt); }); ]]):gsub('HASH', v.hash):gsub("ARG_VALIDATORS", avs)):gsub('NAME', v.ns .. '/' .. v.name):gsub('\n', '\n\t'):gsub('^', '\t') print(a) end end print('}')
require('lint').linters_by_ft = { javascript = {'eslint'}, python = {'pylint'}, robot = {'robocop'}, sh = {'shellcheck'}, vim = {'vint'}, } vim.cmd([[ autocmd BufEnter,TextChanged,BufWritePost * lua require('lint').try_lint() ]])
-- Check whether Z encoded vectors from real images is dependant on Y. -- That is, check if the distribution of Z changes with different Ys. -- This codes requires to the file "isZconditionedOnY.dmp" (obtained from a modified -- version of generateReconstructedDataset.lua), which needs to contain: -- · Z = encoded vectors of real images -- · Yreal = real labels Y from the real images (binary, -1: disabled, 1: enabled) -- · Ygen = encoded labels Y' from the real images (optional) (non binary, ideally -1: disabled, 1: enabled) -- Load file containing Z and real Y local matio = require "matio" local data = torch.load('celebA/isZconditionedOnY.dmp') local Z = data.Z local Yreal = data.Yreal local Ygen = data.Ygen local Zmean = torch.mean(Z,1) for k=1,Z:size(2) do Z[{{},{k}}]:add(-Zmean[1][k]) end Z = Z * 1.8162 for k=1,Z:size(2) do Z[{{},{k}}]:add(Zmean[1][k]) end --matio.save('Z.mat',Z) --torch.save('celebA/Zmean.dmp', torch.mean(Z,1)) local sz = Z:size(1) -- Z1: Zs where attribute blonde is activated -- Create mask of positions where blonde is 1 local attIdx = 4 -- Blond hair -- Torch doesn't support boolean indexing. You need to transform -- a binary mask into the indices of the positions you want to keep local idx = torch.linspace(1,sz,sz):long() local mask = idx[Yreal[{{},{attIdx}}]:gt(0)] local Z1 = Z:index(1,mask) -- Z2: Zs where attribute dark hair is activated attIdx = 3-- Black hair mask = idx[Yreal[{{},{attIdx}}]:gt(0)] local Z2 = Z:index(1,mask) print(("Differences of std and mean on the %d dimensions of Z1 (%d elements) and Z2 (%d elements):"):format(Z1:size(2), Z1:size(1),Z2:size(1))) local Z1std = Z1:std(1):resize(Z1:size(2)) local Z2std = Z2:std(1):resize(Z2:size(2)) local dif = (Z1std-Z2std):abs() print(("Std error: Mean, max, min: %.4f, %.4f, %.4f"):format(dif:mean(), dif:max(), dif:min())) local Z1m = Z1:mean(1):resize(Z1:size(2)) local Z2m = Z2:mean(1):resize(Z2:size(2)) local dif = (Z1m-Z2m):abs() print(("Mean error: Mean, max, min: %.4f, %.4f, %.4f"):format(dif:mean(), dif:max(), dif:min())) -- Maximum difference: 0.3477 (mean) and 0.065 (std) print(Z1m:mean(), Z1std:mean()) print(Z2m:mean(), Z2std:mean()) print("\nMean of whole Z: ") print(("\t %.4f +- %.4f"):format(Z:mean(), Z:std())) print("Mean per dimension of whole Z: ") print(("\t %.4f +- %.4f"):format(Z:mean(1):mean(), Z:mean(1):std())) print("Std per dimension of whole Z: ") print(("\t %.4f +- %.4f"):format(Z:std(1):mean(), Z:std(1):std())) -- This is used to retrain the encoder with this new distribution of Zs --local data = {} --data.Zmean = Z:mean(1):resize(Z:size(2)) --data.Zstd = Z:std(1):resize(Z:size(2)) --torch.save('celebA/encoded_Z_distribution_real_images.dmp', data)
local nvim = require 'neovim' local cmd = { 'pre-commit', } nvim.ex.CompilerSet('makeprg=' .. table.concat(cmd, '\\ ')) -- local formats = vim.opt_global.errorformat:get() local formats = { '%f:%l:%c: %t%n %m', '%f:%l:%c:%t: %m', '%f:%l:%c: %m', '%f:%l: %trror: %m', '%f:%l: %tarning: %m', '%f:%l: %tote: %m', '%f:%l:%m', '%f: %trror: %m', '%f: %tarning: %m', '%f: %tote: %m', '%f: Failed to json decode (%m: line %l column %c (char %*\\\\d))', '%f: Failed to json decode (%m)', '%E%f:%l:%c: fatal error: %m', '%E%f:%l:%c: error: %m', '%W%f:%l:%c: warning: %m', 'Diff in %f:', '+++ %f', 'reformatted %f', } nvim.ex.CompilerSet('errorformat=' .. table.concat(formats, ','):gsub(' ', '\\ ')) vim.b.current_compiler = 'pre-commit'
local g = vim.g g.nvim_tree_ignore = { '.git' } g.nvim_tree_gitignore = true g.nvim_tree_auto_open = true g.nvim_tree_auto_ignore_ft = { 'startify' }
local HttpService = game:GetService("HttpService") local Packages = script:FindFirstAncestor("CmdrAdditions").Packages local Roact = require(Packages.Roact) local Util = require(Packages.Util) local Window = require(script.Window) local DEFAULT_SIZE = Vector2.new(310, 370) local WindowManager = Roact.Component:extend("WindowManager") function WindowManager:init() --[[self:spawnWindow({ Title = "Example window", Type = "Logs", Icon = "CommandLogs", Stream = "CommandLogs" })]] end function WindowManager:spawnWindow(data) local windowId = HttpService:GenerateGUID(false) self:setState({ [windowId] = data }) end function WindowManager:render() local windows = {} for windowId, data in pairs(self.state) do windows[windowId] = Roact.createElement(Window, Util.Dictionary.merge(data, { InitialSize = DEFAULT_SIZE, Destroy = function() self:setState({ [windowId] = Roact.None }) end })) end return Roact.createFragment(windows) end return WindowManager
-- License: CC0 1.0 Universal ( http://creativecommons.org/publicdomain/zero/1.0/legalcode ) -- do return { playerVsEnemy=function(player, enemy) return hitTest(player.hitBodyRect, enemy.hitBody); end, playerVsBullet=function(player, bullet) return hitTest(player.hitBodyRect, bullet.hitBody); end, playerVsExAttack=function(player, ex_attack) if not(ex_attack.hittable) then return false; end if ex_attack.hitBody.type == HitType.Circle then return hitTest(player.hitBodyCircle, ex_attack.hitBody); else return hitTest(player.hitBodyRect, ex_attack.hitBody); end end, copy=function(hit_body,fp) local obj = {}; for k,v in pairs(hit_body) do obj[k] = v; end return obj; end } end
Path = class("Path") local PathNode = { x = 0, y = 0, G = 0, H = 0, F = 0, } Path.MaxDeep = 3000 function Path.CreateNode(x,y,f,g,h) -- body local node = {} node.x = x or 0 node.y = y or 0 node.F = f or 0 node.G = g or 0 node.H = h or 0 return node end function Path:GenPath(start_pos,end_pos,max_deep) max_deep = Path.MaxDeep if not start_pos then print("start_pos nil") return {} end if not end_pos then print("end_pos nil") return {} end self.m_start_pt = start_pos or {x = 0,y = 0} self.m_end_pt = end_pos or {x = 0,y = 0} local path_list = {} local open_list = {} local close_list = {} local deep_count = 0 self.m_close_list_key_map = {} local start_node = Path.CreateNode(start_pos.x,start_pos.y) local is_obstacle = self:IsBlock(start_pos.x,start_pos.y) if not is_obstacle then --table.insert(open_list,start_node) table.insert(close_list,start_node) local function sort_compare(src,dest) -- body if src.F < dest.F then return true else return false end end local parent_node = start_node while parent_node do --todo open_list = {} local has_target = self:Round9Node(parent_node,open_list) if #open_list > 1 then table.sort(open_list, sort_compare) end parent_node = open_list[1] if parent_node then table.insert(close_list,parent_node) local key = string.format("x%dy%d",parent_node.x,parent_node.y) self.m_close_list_key_map[key] = true else break end if has_target then break end --max deep if deep_count > Path.MaxDeep then break end deep_count = deep_count + 1 end else end -- printInfo("close_list count %d",#close_list) -- for k,v in ipairs(close_list) do -- printInfo("close_list x:%d y:%d",v.x,v.y) -- end return close_list end function Path:CalcF(parent_node,path_node) -- body local f = 0 local g = self:CalcG(parent_node,path_node) local h = self:CalcH(path_node) f = g + h path_node.F = f return f end function Path:CalcG(parent_node,path_node) -- body path_node.G = parent_node.G + path_node.G return path_node.G end function Path:CalcH(path_node) -- body local lenX = math.abs(path_node.x - self.m_end_pt.x) local lenY = math.abs(path_node.y - self.m_end_pt.y) path_node.H = (lenY+lenX)*10 return (lenY+lenX)*10 end function Path:Round9Node(parent_node,list) -- body local x = parent_node.x local y = parent_node.y local reach_dest = false list = list or {} for i= x - 1,x + 1 do for j= y -1,y + 1 do --是否障碍物 local is_block = self:IsBlock(i,j) local in_close = self:InCloseList(i,j) if is_block or (i == x and j == y) or in_close then else local path_node = Path.CreateNode() path_node.x,path_node.y = i,j if i == self.m_end_pt.x and j == self.m_end_pt.y then table.insert(list,path_node) reach_dest = true --printInfo("-------------end x:%d y:%d",path_node.x,path_node.y) return reach_dest end if (i == x - 1 and j == y - 1) or (i == x - 1 and j == y + 1) or (i == x + 1 and j == y + 1) or (i == x + 1 and j == y - 1) then path_node.G = 14 else path_node.G = 10 end self:CalcF(parent_node,path_node) table.insert(list,path_node) end end end return reach_dest end function Path:InCloseList(x,y) -- body local key = string.format("x%dy%d",x,y) return self.m_close_list_key_map[key] end function Path:IsBlock(x,y) -- body return false end return Path
--- Event listener variables and functions. ... --- Adds the given function to be called once the event fires. --- @tparam function listener The listener to be called. function addListener(listener) end --- Remove the given function from being called once the event fires. --- @tparam function listener The listener to no longer call. function removeListener(listener) end
local function QuickNPC(Name, PrintName, SpawnName, Race, Distance, Model) local NPC = {} NPC.Name = Name NPC.PrintName = PrintName NPC.SpawnName = SpawnName NPC.Race = Race NPC.DistanceRetreat = Distance NPC.Model = Model return NPC end local function AddBool(Table, IsFrozen, IsInvincible, IsIdle) Table.Frozen = IsFrozen Table.Invincible = IsInvincible Table.Idle = IsIdle return Table end local function AddMultiplier(Table, Health, Damage) Table.HealthPerLevel = Health Table.DamagePerLevel = Damage return Table end local function AddDrop(Table, Name, Chance, Min, Max) Table.Drops = Table.Drops or {} Table.Drops[Name] = {Chance = Chance, Min = Min, Max = Max} return Table end local NPC = QuickNPC("combine_thumper", "Combine Thumper", "prop_physics", nil, nil, "models/props_combine/CombineThumper001a.mdl") NPC = AddMultiplier(NPC, 5) NPC = AddBool(NPC, true, false, false) Register.NPC(NPC)
require "maths" require "planete" require "tableaux" require "biomes" require "region" require "sous-region" --[[ ################################################################# ################################################################# ############### love.load == initialisation ################# ############### Effectuée au début du programme ################# ################################################################# ################################################################# lithosphere(INT): Tableau contenant l'altitude de chaque régions de la planète. precipitation(INT): Tableau contenant la pluie de chaque régions de la planète en mm par an. regions(OBJET): Tableau contenant les informations de chaques régions de la planète. rectangles(OBJET): Tableau contenant les pixels de la map à afficher. ]] function love.load() planete1 = Planete.new() planete1:setAltitude() planete1:setErosion() planete1:setPrecipitation() planete1:setBiome() planete1.regions[1][1]:genererSousRegions() --[[ for i=1,200 do for j=1,200 do planete1.regions[i][j]:genererSousRegions() end end ]] end --[[ ################################################################# ################################################################# ######### love.updated == Exécutée a chaque frame ############### ######### Ne pas utiliser pour l'affichage ############### ################################################################# ################################################################# ]] function love.updated(dt) end --[[ ################################################################# ################################################################# ######### love.draw == Exécutée a chaque frame ############## ######### A utiliser pour l'affichage ############## ################################################################# ################################################################# ]] function love.draw() planete1:draw() --planete1.regions[1][1]:draw() end
local local0 = 1 local local1 = 0 - local0 local local2 = 6.8 - local0 local local3 = 0 - local0 local local4 = 0 - local0 local local5 = 7.1 - local0 local local6 = 0 - local0 local local7 = 3 - local0 local local8 = 0 - local0 local local9 = 3 - local0 function OnIf_552100(arg0, arg1, arg2) if arg2 == 0 then LesserDemonVariation_LHead552100_ActAfter_RealTime(arg0, arg1) end return end function LesserDemonVariation_LHead552100Battle_Activate(arg0, arg1) local local0 = {} local local1 = {} local local2 = {} Common_Clear_Param(local0, local1, local2) local local3 = arg0:GetHpRate(TARGET_SELF) local local4 = arg0:GetDist(TARGET_ENE_0) local local5 = arg0:GetEventRequest() local local6 = arg0:GetRandam_Int(1, 100) if arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_F, 120) then if 8 <= local4 then local0[1] = 0 local0[2] = 100 local0[3] = 0 local0[4] = 0 local0[5] = 0 elseif 2 <= local4 then local0[1] = 60 local0[2] = 0 local0[3] = 40 local0[4] = 0 local0[5] = 0 else local0[1] = 0 local0[2] = 0 local0[3] = 0 local0[4] = 50 local0[5] = 50 end else arg1:AddSubGoal(GOAL_COMMON_Wait, 1, TARGET_ENE_0, 0, 0, 0) end local1[1] = REGIST_FUNC(arg0, arg1, LesserDemonVariation_LHead552100_Act01) local1[2] = REGIST_FUNC(arg0, arg1, LesserDemonVariation_LHead552100_Act02) local1[3] = REGIST_FUNC(arg0, arg1, LesserDemonVariation_LHead552100_Act03) local1[4] = REGIST_FUNC(arg0, arg1, LesserDemonVariation_LHead552100_Act04) local1[5] = REGIST_FUNC(arg0, arg1, LesserDemonVariation_LHead552100_Act05) Common_Battle_Activate(arg0, arg1, local0, local1, REGIST_FUNC(arg0, arg1, LesserDemonVariation_LHead552100_ActAfter_AdjustSpace), local2) return end function LesserDemonVariation_LHead552100_Act01(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) arg1:AddSubGoal(GOAL_COMMON_NonspinningAttack, 10, 3000, TARGET_ENE_0, DIST_None) arg1:AddSubGoal(GOAL_COMMON_Wait, arg0:GetRandam_Float(3, 5), 0, 0, 0, 0) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function LesserDemonVariation_LHead552100_Act02(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) arg1:AddSubGoal(GOAL_COMMON_NonspinningAttack, 10, 3001, TARGET_ENE_0, DIST_None) arg1:AddSubGoal(GOAL_COMMON_Wait, arg0:GetRandam_Float(3, 5), 0, 0, 0, 0) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function LesserDemonVariation_LHead552100_Act03(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) arg1:AddSubGoal(GOAL_COMMON_NonspinningAttack, 10, 3002, TARGET_ENE_0, DIST_None) arg1:AddSubGoal(GOAL_COMMON_Wait, arg0:GetRandam_Float(3, 5), 0, 0, 0, 0) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function LesserDemonVariation_LHead552100_Act04(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) arg1:AddSubGoal(GOAL_COMMON_NonspinningAttack, 10, 3003, TARGET_ENE_0, DIST_None) arg1:AddSubGoal(GOAL_COMMON_Wait, arg0:GetRandam_Float(3, 5), 0, 0, 0, 0) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function LesserDemonVariation_LHead552100_Act05(arg0, arg1, arg2) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) arg1:AddSubGoal(GOAL_COMMON_NonspinningAttack, 10, 3004, TARGET_ENE_0, DIST_None) arg1:AddSubGoal(GOAL_COMMON_Wait, arg0:GetRandam_Float(3, 5), 0, 0, 0, 0) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function LesserDemonVariation_LHead552100_ActAfter_AdjustSpace(arg0, arg1, arg2) return end function LesserDemonVariation_LHead552100_ActAfter_RealTime(arg0, arg1) local local0 = arg0:GetDist(TARGET_ENE_0) local local1 = arg0:GetRandam_Int(1, 100) return end function LesserDemonVariation_LHead552100Battle_Update(arg0, arg1) return GOAL_RESULT_Continue end function LesserDemonVariation_LHead552100Battle_Terminate(arg0, arg1) return end local0 = 17.5 - local0 function LesserDemonVariation_LHead552100Battle_Interupt(arg0, arg1) if arg0:IsLadderAct(TARGET_SELF) then return false elseif UseItem_Act(arg0, arg1, 10, 30) and arg0:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_F, 120) then arg1:AddSubGoal(GOAL_COMMON_Attack, 10, 3001, TARGET_ENE_0, UPVAL0, 0) return true else return false end end return
-- -- Chartboost Corona SDK -- Created by: Chris -- -- This enum is used by internal Chartboost code! -- Do not modify its public interface! -- -- Enumeration of impression states -- local ret = { CBImpressionStateOther = "CBImpressionStateOther", CBImpressionStateWaitingForDisplay = "CBImpressionStateWaitingForDisplay", CBImpressionStateDisplayedByDefaultController = "CBImpressionStateDisplayedByDefaultController", CBImpressionStateWaitingForDismissal = "CBImpressionStateWaitingForDismissal", CBImpressionStateWaitingForCaching = "CBImpressionStateWaitingForCaching", CBImpressionStateCached = "CBImpressionStateCached" } ret.assert = function(imp) for k,v in pairs(ret) do if v == imp then return true end end return false end return ret
module('enemies', package.seeall) superball = body:new { size = 40, variance = 13, life = 60, timeout = 40, collides = true, ord = 6, __type = 'superball' } function superball:__init() if not rawget(self.position, 1) then enemy.__init(self) end local vx, vy = math.random(v, v+50), math.random(v, v+50) vx = self.x < height/2 and vx or -vx vy = self.y < width/2 and vy or -vy self.speed = vector:new {vx, vy} self.coloreffect = self.shot.coloreffect self.variance = self.shot.variance self.shoottimer = timer:new { timelimit = 1.5 + math.random(), works_on_gamelost = false, time = math.random()*1.6 } function self.shoottimer.funcToCall( timer ) timer.timelimit = 1 + math.random() local e = self.shot:new{} e.position = self.position:clone() local pos = psycho.position:clone() if not psycho.speed:equals(0, 0) then pos:add(psycho.speed:normalized():mult(v / 2, v / 2)) end e.speed = pos:sub(self.position):normalize():mult(1.5 * v, 1.5 * v):rotate((math.random()-.5)*torad(30)) e:register(self.extra and unpack(self.extra) or nil) end if state == survival then self.speedtimer = timer:new { timelimit = math.random()*4 + 1 } function self.speedtimer.funcToCall(timer) timer.timelimit = math.random()*3 + 1 local vx, vy = math.random(-50, 50), math.random(-50, 50) vx = vx + v*sign(vx) vy = vy + v*sign(vy) self.speed:set(vx, vy) end end self.lifeCircle = circleEffect:new { alpha = 60, sizeGrowth = 0, size = self.size + self.life, position = self.position, index = false, linewidth = 6 } self.timeout = timer:new { timelimit = self.timeout, onceonly = true, funcToCall = function() self.collides = false self.speed:set(self.exitposition):sub(self.position):normalize():mult(1.1*v, 1.1*v) end } end function superball:onInit( shot, exitpos, timeout, ... ) self.shot = shot and enemies[shot] or state == survival and enemy or enemies.simpleball self.timeout = timeout self.exitposition = self.exitposition or clone(exitpos) or clone(self.position) self.extra = select('#', ...) > 0 and {...} or nil end function superball:start( shot ) self.healthbak = self.life self.lifeCircle.size = self.size + self.life self.shoottimer:start() self.timeout:start() if state == survival then self.speedtimer:start() end self.lifeCircle.position = self.position self.lifeCircle:register() end function superball:update(dt) body.update(self, dt) if self.collides then if self.x + self.size > width then self.speed:set(-math.abs(self.Vx)) elseif self.x - self.size < 0 then self.speed:set( math.abs(self.Vx)) end if self.y + self.size > height then self.speed:set(nil, -math.abs(self.Vy)) elseif self.y - self.size < 0 then self.speed:set(nil, math.abs(self.Vy)) end end for i,v in pairs(shot.bodies) do if (v.size + self.lifeCircle.size)^2 >= (v.x - self.x)^2 + (v.y - self.y)^2 then v.collides = true v.explosionEffects = false local bakvariance = v.variance v.variance = self.variance neweffects(v,10) v.variance = bakvariance self.life = self.life - 4 self.lifeCircle.size = self.size + self.life if self.life <= 0 then self.diereason = "shot" self.delete = true break end end end if psycho.canbehit and not gamelost and self:collidesWith(psycho) then psycho.diereason = "shot" lostgame() end end function superball:handleDelete() if self.diereason == "shot" then addscore(4*self.healthbak + 2*self.size) end neweffects(self,100) self.lifeCircle.sizeGrowth = -300 self.shoottimer:remove() if state == survival then self.speedtimer:remove() end self.timeout:remove() end
local PushUISize, PushUIColor, PushUIStyle, PushUIAPI, PushUIConfig, PushUIFrames = unpack(select(2, ...)) PushUIFrames.AnimationStage = PushUIAPI.inhiert() function PushUIFrames.AnimationStage:__create_snapshot() self._snapshot.alpha = self._relativelayer:GetAlpha() self._snapshot.scale_h, self._snapshot.scale_v = self._relativelayer:GetScale() local _a, _p, _pa, _x, _y = self._relativelayer:GetPoint() self._snapshot.archor = _a self._snapshot.parent = _p self._snapshot.parent_archor = _pa self._snapshot.x = _x self._snapshot.y = _y if self._relativelayer.GetRotation then self._snapshot.r = self._relativelayer:GetRotation() end end function PushUIFrames.AnimationStage:__finialized() if self._fade then self._relativelayer:SetAlpha(self._fade:GetToAlpha()) end if self._scale then self._relativelayer:SetScale(self._scale:GetToScale()) end if self._rotation and self._relativelayer.GetRotation then self._relativelayer:SetRotation(self._rotation:GetRadians()) end if self._translation then self._relativelayer:ClearAllPoints() self._relativelayer:SetPoint( self._snapshot.archor, self._snapshot.parent, self._snapshot.parent_archor, self._translation._toX, self._translation._toY) end self._fade = nil self._scale = nil self._translation = nil self._rotation = nil end function PushUIFrames.AnimationStage.__did_finish(ag) ag.stage:__finialized() if ag.stage._handle then ag.stage._handle(ag.stage._relativeObj, true) end end function PushUIFrames.AnimationStage.__did_cancel(ag) ag.stage:__finialized() if ag.stage._handle then ag.stage._handle(ag.stage._relativeObj, false) end end function PushUIFrames.AnimationStage:play(duration, on_complete) self:stop() self._handle = on_complete self:__create_snapshot() if self._fade then self._fade:SetDuration(duration) end if self._scale then self._scale:SetDuration(duration) end if self._rotation then self._rotation:SetDuration(duration) end if self._translation then self._translation:SetDuration(duration) end if self._fade or self._scale or self._rotation or self._translation then self._agroup:SetScript("OnFinished", self.__did_finish) self._agroup:SetScript("OnStop", self.__did_cancel) self._agroup:Play() end end function PushUIFrames.AnimationStage:stop() if self._agroup:IsPlaying() then self:__create_snapshot() self._agroup:Stop() end end function PushUIFrames.AnimationStage:is_playing() return self._agroup:IsPlaying() end function PushUIFrames.AnimationStage:set_fade(to_alpha) if not self._fade then self._fade = self._agroup:CreateAnimation("Alpha") self._fade:SetFromAlpha(self._relativelayer:GetAlpha()) self._fade:SetSmoothing("IN_OUT") end self._fade:SetToAlpha(to_alpha) end function PushUIFrames.AnimationStage:set_scale(h, v, origin, x, y) local _hrate = h or 1 local _vrate = v or 1 local _origin = "CENTER" local _x = 0 local _y = 0 if nil ~= origin then _origin = origin end if nil ~= x then _x = x end if nil ~= y then _y = y end if not self._scale then self._scale = self._agroup:CreateAnimation("Scale") self._scale:SetSmoothing("IN_OUT") end self._scale:SetToScale(_hrate, _vrate) self._scale:SetOrigin(_origin, _x, _y) end function PushUIFrames.AnimationStage:set_rotation(r) if not self._relativelayer.GetRotation then return end if not self._rotation then self._rotation = self._agroup:CreateAnimation("Rotation") end self._rotation:SetRadians(r) end function PushUIFrames.AnimationStage:set_translation(to_x, to_y) if not self._translation then self._translation = self._agroup:CreateAnimation("Translation") self._translation:SetSmoothing("IN_OUT") end self._translation._toX = to_x self._translation._toY = to_y end function PushUIFrames.AnimationStage:c_str(view) if not view then print("No view to create animation") end if not view then return end local _layer = view.layer if not _layer then print("the view is not a uiview") end if not view.layer then _layer = view end self._relativeObj = view self._relativelayer = _layer self._agroup = _layer:CreateAnimationGroup() self._agroup.stage = self if not self._agroup then print("failed to craete animation group") end self._fade = nil self._scale = nil self._translation = nil self._rotation = nil self._snapshot = {} end -- by Push Chen -- twitter: @littlepush
-------------------------------------------------------------------------------- -- Copyright (c) 2006-2013 Fabien Fleutot and others. -- -- All rights reserved. -- -- This program and the accompanying materials are made available -- under the terms of the Eclipse Public License v1.0 which -- accompanies this distribution, and is available at -- http://www.eclipse.org/legal/epl-v10.html -- -- This program and the accompanying materials are also made available -- under the terms of the MIT public license which accompanies this -- distribution, and is available at http://www.lua.org/license.html -- -- Contributors: -- Fabien Fleutot - API and implementation -- -------------------------------------------------------------------------------- -- Export all public APIs from sub-modules, squashed into a flat spacename local MT = { __type='metalua.compiler.parser' } local MODULE_REL_NAMES = { "annot.grammar", "expr", "meta", "misc", "stat", "table", "ext" } local function new() local M = { lexer = require "metalua.compiler.parser.lexer" (); extensions = { } } for _, rel_name in ipairs(MODULE_REL_NAMES) do local abs_name = "metalua.compiler.parser."..rel_name local extender = require (abs_name) if not M.extensions[abs_name] then if type (extender) == 'function' then extender(M) end M.extensions[abs_name] = extender end end return setmetatable(M, MT) end return { new = new }
local Shop = {} local Data = require "data.data" local Input = require "util.input" local Memory = require "util.memory" local Menu = require "util.menu" local Player = require "util.player" local Inventory = require "storage.inventory" function Shop.transaction(options) local item, itemMenu, menuIdx, quantityMenu if options.sell then menuIdx = 1 itemMenu = Data.yellow and 28 or 29 quantityMenu = 158 for __,sit in ipairs(options.sell) do local idx = Inventory.indexOf(sit.name) if idx ~= -1 then item = sit item.index = idx item.amount = Inventory.count(sit.name) break end end end if not item and options.buy then menuIdx = 0 itemMenu = Data.yellow and 122 or 123 quantityMenu = 161 for __,bit in ipairs(options.buy) do local needed = (bit.amount or 1) - Inventory.count(bit.name) if needed > 0 then item = bit item.amount = needed break end end end if not item then if not Menu.isOpened() then return true end Input.press("B") elseif Player.isFacing(options.direction or "Left") then if Menu.isOpened() then local mainMenu = Data.yellow and 245 or 32 if Menu.isCurrently(mainMenu, "shop") then Menu.select(menuIdx, true, false, "shop") elseif Menu.getCol() == 15 then Input.press("A") elseif Menu.isCurrently(itemMenu, "transaction") then if Menu.select(item.index, "accelerate", true, "transaction", true) then if Menu.isCurrently(quantityMenu, "shop") then local currAmount = Memory.value("shop", "transaction_amount") if Menu.balance(currAmount, item.amount, false, 99, true) then Input.press("A") end else Input.press("A") end end else Input.press("B") end else Input.press("A", 2) end else Player.interact(options.direction or "Left") end return false end function Shop.vend(options) local item for __,bit in ipairs(options.buy) do local needed = (bit.amount or 1) - Inventory.count(bit.name) if needed > 0 then item = bit item.buy = needed break end end if not item then if not Menu.isOpened() then return true end Input.press("B") elseif Player.face(options.direction) then if Menu.isOpened() then if Memory.value("battle", "text") > 1 and not Menu.hasTextbox() then Menu.select(item.index, true) else Input.press("A") end else Input.press("A", 2) end end return false end return Shop
--[[ OmniCC configuration localization - Portuguese --]] if GetLocale() ~= 'ptBR' then return end local L = OMNICC_LOCALS L.GeneralSettings = "Geral" L.FontSettings = "Aspecto do Texto" L.RuleSettings = "Regras" L.PositionSettings = "Posição do Texto" L.Font = "Fonte" L.FontSize = "Tamanho do Texto" L.FontOutline = "Contorno do Texto" L.Outline_OUTLINE = "Fino" L.Outline_THICKOUTLINE = "Espesso" L.Outline_OUTLINEMONOCHROME = "Monocromático" L.MinDuration = "Duração mínima para exibir texto" L.MinSize = "Tamanho mínimo para exibir texto" L.ScaleText = "Redimensionar texto automaticamente" L.EnableText = "Ativar texto" L.Add = "Adicionar" L.Remove = "Remover" L.FinishEffect = "Efeito Final" L.MinEffectDuration = "Duração mínima para exibir o efeito final" L.MMSSDuration = "Duração mínima para exibir o texto como MM:SS" L.TenthsDuration = "Duração mínima para mostrar décimos de segundo" L.ColorAndScale = "Cor e Tamanho" L.Color_soon = "Perto de expirar" L.Color_seconds = "Menos de um minuto" L.Color_minutes = "Menos de uma hora" L.Color_hours = "Mais de uma hora" L.SpiralOpacity = "Transparência das espirais" L.UseAniUpdater = "Otimizar desempenho" --text positioning L.XOffset = "X" L.YOffset = "Y" L.Anchor = 'Posicionar' L.Anchor_LEFT = 'Esquerda' L.Anchor_CENTER = 'Centro' L.Anchor_RIGHT = 'Direita' L.Anchor_TOPLEFT = 'Topo Esquerdo' L.Anchor_TOP = 'Topo' L.Anchor_TOPRIGHT = 'Topo Direito' L.Anchor_BOTTOMLEFT = 'Fundo Esquerdo' L.Anchor_BOTTOM = 'Fundo' L.Anchor_BOTTOMRIGHT = 'Fundo Direito' --groups L.Groups = 'Grupos' L.Group_base = 'Padrão' L.Group_action = 'Ações' L.Group_pet = 'Ações do Animal' L.AddGroup = 'Adicionar Grupo...' --[[ Tooltips ]]-- L.ScaleTextTip = [[Quando ativada, esta opção faz o texto a encolher para caber dentro de elementos que sejam pequenos.]] L.SpiralOpacityTip = [[Define a transparência das espirais negras que normalmente são exibidas em botões em cooldown.]] L.UseAniUpdaterTip = [[Otimiza o desempenho do processador, mas pode causar falhas em alguns sistemas. Desativar esta opção irá resolver o problema.]] L.MinDurationTip = [[Determina o tempo mínimo que um cooldown tem de ter a fim de mostrar o texto. Esta configuração é usada maioritariamente para filtrar o GCD.]] L.MinSizeTip = [[Determina o tamanho mínimo que elementos têm de ter para exibir texto. Alguns exemplos: 100 - O tamanho de um botão de ação 80 - O tamanho de um botão de classe ou de ação do pet 55 - O tamanho de um buff da janela do alvo]] L.MinEffectDurationTip = [[Determina o tempo mínimo para um cooldown mostrar o efeito final]] L.MMSSDurationTip = [[Determina o limite para mostrar um cooldown em MM:SS.]] L.TenthsDurationTip = [[Determina o limite para mostrar décimos de segundos.]] L.FontSizeTip = [[Controla o tamanho do texto]] L.FontOutlineTip = [[Controla a espessura do contorno à volta do texto.]] L.UseBlacklistTip = [[Ativa o uso de lista negra. Quando ativada, qualquer elemento com um nome que corresponda a um item na lista negra não mostrará texto.]] L.FrameStackTip = [[Se ativado, mostra os nomes dos elementos quando você passa com o rato sobre eles.]] L.XOffsetTip = [[Controla o deslocamento horizontal do texto.]] L.YOffsetTip = [[Controla o deslocamento vertical do texto.]]
--!A cross-platform build utility based on Lua -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- Copyright (C) 2015-present, TBOOX Open Source Group. -- -- @author ruki -- @file install_package.lua -- -- imports import("core.base.option") import("core.project.config") import("lib.detect.find_tool") -- install package -- -- @param name the package name, e.g. dub::log -- @param opt the options, e.g. { verbose = true, mode = "release", plat = , arch = , require_version = "x.x.x", buildhash = "xxxxxx"} -- -- @return true or false -- function main(name, opt) -- find dub local dub = find_tool("dub") if not dub then raise("dub not found!") end -- fetch the given package local argv = {"fetch", name} if option.get("verbose") then table.insert(argv, "-v") end if opt.require_version and opt.require_version ~= "latest" and opt.require_version ~= "master" then table.insert(argv, "--version=" .. opt.require_version) end os.vrunv(dub.program, argv) -- build the given package argv = {"build", name, "-y"} if opt.mode == "debug" then table.insert(argv, "--build=debug") else table.insert(argv, "--build=release") end if option.get("verbose") then table.insert(argv, "-v") end local archs = {x86_64 = "x86_64", x64 = "x86_64", i386 = "x86", x86 = "x86"} local arch = archs[opt.arch] if arch then table.insert(argv, "--arch=" .. arch) else raise("cannot install package(%s) for arch(%s)!", name, opt.arch) end os.vrunv(dub.program, argv) end
--------------------------------------------- -- Sweet Breath -- -- Description: Deals water damage to enemies within a fan-shaped area originating from the caster. -- Type: Magical Water (Element) -- --------------------------------------------- require("scripts/globals/settings") require("scripts/globals/status") require("scripts/globals/monstertpmoves") --------------------------------------------- function onMobSkillCheck(target,mob,skill) return 0 end function onMobWeaponSkill(target, mob, skill) local typeEffect = tpz.effect.SLEEP_I MobStatusEffectMove(mob, target, typeEffect, 1, 0, 30) local dmgmod = MobBreathMove(mob, target, 0.125, 3, tpz.magic.ele.WATER, 500) local dmg = MobFinalAdjustments(dmgmod, mob, skill, target, tpz.attackType.BREATH, tpz.damageType.WATER, MOBPARAM_IGNORE_SHADOWS) target:takeDamage(dmg, mob, tpz.attackType.BREATH, tpz.damageType.WATER) return dmg end
--tyrant mod for minetest 0.4.13 --library to provide a shared api for area protection mods -- Boilerplate to support localized strings if intllib mod is installed. local S if minetest.get_modpath("intllib") then S = intllib.Getter() else -- If you use insertions, but not insertion escapes this will work: S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end end --circlewalktogetherbreak tyrant={ integrations={} } --[[tyrant integration register: functions preceeded with ! must exist, others can but don't have to. tyrant.register_integration(name(preferably modname), { ! function get_all_area_ids() - should return: true and an ipairable table with areaids as VALUEs or false and a table with areaids as KEYs ! function get_is_area_at(areaid, pos) should return true if this position is inside the area. function get_area_priority(areaid) should return a number determining the priority of this area over others. areas having the same priority will co-exist. default definition: return 0 ! function check_permission(areaid, player_name, action, pos) checks if <player> is allowed to do <action> in <areaid> action can be one of: "enter"(walk into area), "activate"(right-click nodes), "punch"(nodes), "inv"(change inventories), "build"(is_protected), "pvp"(hit other players) should return one of these combinations: true if the action is allowed true, true if the action is allowed and no other area should prohibit the action. false if the action is forbidden, a default error message will be shown. false, message if the action is forbidden, message will be shown. if more than one area with the same, highest priority is at the event's position, in case any of these areas is denying the action, it will be denied, except another area returned true, true !Warning! player_name CAN BE NIL, in this case something non-playery such as TNT committed the action. Please handle this case! ! function get_area_intersects_with(areaid, pos1, pos2) should return true if any point inside the area between pos1 and pos2 intersects with areaid function is_hostile_mob_spawning_allowed(areaid) should return true if hostile mobs should spawn inside the area and false if not. default definition: return true if more than one area with the same, highest priority is at the event's position, in case any of these areas is denying the action, it will be denied. function on_area_info_requested(areaid, player_name) called when a player clicks an area in the area selection menu recalled either by /areas_here or /all_areas should show a formspec with either management options or information to the player default definition: shows simple information formspec on what the player can do here. function get_display_name(areaid) get the display name of areaid. default definition: return integration_name..":"..areaid } the following functions are available for all integrations and other mods to access things provided by tyrant tyrant.check_action_allowed(pos, player_name, action* [, no_notification]) checks if the action specified is allowed at pos for player. if no_notification is set, players will not be notified on violation. * see check_permission() above tyrant.check_hostile_mobs_allowed(pos) checks for any area having the hostile_mob_spawning function returning false. If it retunrs false, should not spawn the hostile mob. to be included in mob frameworks. tyrant.get_area_priority_at(pos) returns the highest priority any area has at this point can be used to determine if a new area can be established here. tyrant.get_area_priority_inside(pos1, pos2) returns the highest priority any area has inside the area ranging from pos1 to pos2. can be used to determine if a new area can be established here. tyrant.get_areas_at(pos) returns a table containing all areas at pos in the following format: { [integration1]={ [1]=areaid1, [2]=areaid2... } [integration2]... } In most cases, this is one area (the one with the highest priority), but can be more. tyrant.get_all_areas() returns a table in the format like get_areas_at() tyrant.show_player_areas_at(pos, player_name) opens up an area selection formspec for all areas at the given position. tyrant.show_player_all_areas(player_name) opens up an area selection formspec for all areas minetest.is_protected() wraps to check_action_allowed(..., "build") a minetest.register_on_punchplayer wraps to check_action_allowed(..., "pvp") ) ]] --tyrant.falsemessages --at the same time source for denial messages and for isAction. tyrant.falsemessages={ enter="You may not enter @1", activate="You may not right-click nodes inside @1", inv="You may not change inventories inside @1", build="You may not build inside @1", punch="You may not punch nodes inside @1", pvp="PvP (Player vs. Player) is not allowed inside @1" } minetest.register_privilege("tyrant_bypass", { description = S("Can bypass any restrictions set up by any areas integrated in tyrant."), }) tyrant.check_action_allowed=function(pos, pname, action, no_notification) if minetest.check_player_privs(pname, {tyrant_bypass=true}) or minetest.check_player_privs(pname, {protection_bypass=true}) then return true end local intareas=tyrant.get_areas_at(pos) if not tyrant.falsemessages[action] then error("given invalid action >"..(action or "nil").."< to tyrant.check_action_allowed") end --print("inside actionallowed action",action) local all_allow, all_error=true, "" for intname,areaids in pairs(intareas) do --print(" intname", intname) for _,areaid in ipairs(areaids) do --print(" areaid", areaid) local permit, err_or_override=tyrant.integrations[intname].check_permission(areaid, pname, action, pos) --print(" pe", permit, err_or_override) if permit then if err_or_override then return true end else all_allow=false all_error=err_or_override or S(tyrant.falsemessages[action], tyrant.integrations[intname].get_display_name(areaid) or intname..":"..areaid) end end end if not no_notification and pname and not all_allow then tyrant.fs_message(pname, all_error); end return all_allow, all_error end tyrant.get_all_areas=function() local ialist={} for intname,intdef in pairs(tyrant.integrations) do local as_values, areaids=intdef.get_all_area_ids() ialist[intname]={} if as_values then for _,areaid in ipairs(areaids) do ialist[intname][#ialist[intname]+1]=areaid end else for areaid,_ in pairs(areaids) do ialist[intname][#ialist[intname]+1]=areaid end end end return ialist end tyrant.get_areas_at=function(pos) local last_prior=-127 local ialist={} for intname,intdef in pairs(tyrant.integrations) do local as_values, areaids=intdef.get_all_area_ids() if as_values then for _,areaid in ipairs(areaids) do if tyrant.integrations[intname].get_is_area_at(areaid, pos) then local now_prior=tyrant.integrations[intname].get_area_priority(areaid) if now_prior>last_prior then ialist={} last_prior=now_prior end if now_prior>=last_prior then if not ialist[intname] then ialist[intname]={} end ialist[intname][#ialist[intname]+1]=areaid end end end else for areaid,_ in pairs(areaids) do if tyrant.integrations[intname].get_is_area_at(areaid, pos) then local now_prior=tyrant.integrations[intname].get_area_priority(areaid) if now_prior>last_prior then ialist={} last_prior=now_prior end if now_prior==last_prior then if not ialist[intname] then ialist[intname]={} end ialist[intname][#ialist[intname]+1]=areaid end end end end end return ialist end --protection, nodebuild tyrant.old_is_protected = minetest.is_protected function minetest.is_protected(pos, name) local t1=os.clock() local allowed, err=tyrant.check_action_allowed(pos, name, "build") --print("[tyrant][benchmark] "..math.floor((os.clock()-t1)*1000).."ms for is_protected("..name.." at "..minetest.pos_to_string(pos)..")") if not allowed then return true end return tyrant.old_is_protected(pos, name) end --position golbalstep tyrant.position_recheck_and_hud_timer=1 minetest.register_globalstep(function(dtime) if tyrant.position_recheck_and_hud_timer<=0 then local t1=os.clock() for name, object in pairs(minetest.get_connected_players()) do tyrant.position_handler(object:get_player_name(), object:getpos(), object) end tyrant.update_hud() --print("[tyrant][benchmark] "..math.floor((os.clock()-t1)*1000).."ms for movement check (all players)") tyrant.position_recheck_and_hud_timer=1 else tyrant.position_recheck_and_hud_timer=tyrant.position_recheck_and_hud_timer-dtime end end) tyrant.last_valid_player_positions={} tyrant.last_known_player_positions={} tyrant.position_handler=function(pname, pos, player) local rpos, lvpos=vector.round(pos), tyrant.last_known_player_positions[pname] if lvpos and rpos.x==lvpos.x and rpos.y==lvpos.y and rpos.z==lvpos.z then --no position change, no need to recheck! return end tyrant.last_known_player_positions[pname]=vector.round(pos) local allowed, err=tyrant.check_action_allowed(vector.round(pos), pname, "enter", true) if not allowed then tyrant.forbidden_entry_hdlr(pname, pos, player, err) else tyrant.last_valid_player_positions[pname]=vector.round(pos) --print("lvp "..minetest.pos_to_string(tyrant.last_valid_player_positions[pname])) end end tyrant.forbidden_entry_hdlr=function(pname, pos, player, err) if not tyrant.last_valid_player_positions[pname] then --ignore --print("ignored forbidden state lastvalidpos nil") return end local a, newerr=tyrant.check_action_allowed(tyrant.last_valid_player_positions[pname], pname, "enter", true) if not a then --print("ignored forbidden state lastvalidpos not safe, "..minetest.pos_to_string(tyrant.last_valid_player_positions[pname]).." tells "..newerr) --ignore return else tyrant.fs_message(pname, err) player:setpos(tyrant.last_valid_player_positions[pname]) end --player:set_hp(player:get_hp()-1) end --And now: PvP (only if on_punchplayer exists) if minetest.setting_getbool("enable_pvp") then if minetest.register_on_punchplayer then minetest.register_on_punchplayer( function(player, hitter_param, time_from_last_punch, tool_capabilities, dir, damage) local t1=os.clock() --to fix throwing entities (sadly not working...) local hitter=hitter_param if hitter:get_luaentity() and hitter:get_luaentity().name and string.match(hitter:get_luaentity().name, "^throwing") and hitter:get_luaentity().player then hitter=hitter:get_luaentity().player print("[tyrant] on_punchplayer detected a throwing arrow") end if not player or not hitter then print("[tyrant] on_punchplayer called with nil objects.") end if not hitter:is_player() then --no case of pvp! return false else --PvP here. check areas local allow, err=tyrant.check_action_allowed(player:getpos(), hitter:get_player_name(), "pvp") if not allow then hitter:set_hp(player:get_hp()-1) end return not allow--should disable normal damage...(do no dmg.) end --print("[tyrant][benchmark] "..math.floor((os.clock()-t1)*1000).."ms for pvp event ("..hitter:get_player_name().." hitting "..player:get_player_name().." at "..minetest.pos_to_string(pos)..")") end) else print("[tyrant]Warning: PvP protection is not working because your version of Minetest is too old. Please upgrade to 0.4.13 to use this feature.") print("[tyrant]You can disable PvP world-wide via the minetest.conf option. PvP settings of areas are ignored!") end else print("[tyrant]PvP disabled world-wide via config, PvP settings of areas are ignored!") end tyrant.fs_message=function(pname, msg) minetest.show_formspec(pname, "tyrantmessage", "size[10,1]label[0.2,0.2;"..msg.."]") end tyrant.sort_coords=function(c1, c2) return {x=math.min(c1.x, c2.x), y=math.min(c1.y, c2.y), z=math.min(c1.z, c2.z)}, {x=math.max(c1.x, c2.x), y=math.max(c1.y, c2.y), z=math.max(c1.z, c2.z)} end --nice_desc_of_area tyrant.nice_desc_of_area=function(intname, areaid, pname) local you="" --print(intname) if tyrant.hudaccess[pname] then if tyrant.hudaccess[pname][intname] then if tyrant.hudaccess[pname][intname][areaid] then you=" -> "..tyrant.hudaccess[pname][intname][areaid] end end end return (tyrant.integrations[intname].get_display_name(areaid) or areaid)..you end tyrant.hudaccess={} tyrant.hudactions={ [true]={ enter=S("E"), activate=S("A"), inv=S("I"), build=S("B"), punch="", pvp="", }, [false]={ enter="-", activate="-", inv="-", build="-", punch="", pvp="" } } tyrant.hudactions_order={ "enter", "activate", "inv", "build" } tyrant.update_hudaccess=function() local intareas=tyrant.get_all_areas() for _,player in ipairs(minetest.get_connected_players()) do local pname=player:get_player_name() for intname,areaids in pairs(intareas) do for _,areaid in ipairs(areaids) do local str="" for _,action in ipairs(tyrant.hudactions_order) do local permit, err_or_override=tyrant.integrations[intname].check_permission(areaid, pname, action, player:getpos()) str=str..tyrant.hudactions[permit and true or false][action] end if not tyrant.hudaccess[pname] then tyrant.hudaccess[pname]={} end if not tyrant.hudaccess[pname][intname] then tyrant.hudaccess[pname][intname]={} end tyrant.hudaccess[pname][intname][areaid]=str end end end end tyrant.update_hudaccess_timer=10 --hudaccess golbalstep minetest.register_globalstep(function(dtime) tyrant.update_hudaccess_timer=tyrant.update_hudaccess_timer+dtime if(tyrant.update_hudaccess_timer>5) then tyrant.update_hudaccess_timer=0 tyrant.update_hudaccess() end end) -- ---stolen stuff from areas tyrant.hud = {} tyrant.update_hud=function(dtime) for _, player in pairs(minetest.get_connected_players()) do local name = player:get_player_name() local pos = vector.round(player:getpos()) local areaStrings = {} local intareas=tyrant.get_areas_at(pos) for intname,areaids in pairs(intareas) do for _,areaid in ipairs(areaids) do table.insert(areaStrings, tyrant.nice_desc_of_area(intname, areaid, name)) end end ---areas in front --[[ local any=false for _, areaid in pairs(tyrant.get_areas_at(pos)) do if not any then table.insert(areaStrings, "2 Blöcke voraus:") any=true end table.insert(areaStrings, tyrant.nice_desc_of_area(areaid, name)) end ]] local areaString if #areaStrings > 0 then areaString = S("Here is:").."\n".. table.concat(areaStrings, "\n") else areaString = "" end local hud = tyrant.hud[name] if not hud then hud = {} tyrant.hud[name] = hud hud.areasId = player:hud_add({ hud_elem_type = "text", name = "TYRANT", number = 0xFFFFFF, position = {x=0, y=1}, offset = {x=8, y=-8}, text = areaString, scale = {x=200, y=60}, alignment = {x=1, y=-1}, }) hud.oldAreas = areaString return elseif hud.oldAreas ~= areaString then player:hud_change(hud.areasId, "text", areaString) hud.oldAreas = areaString end end end minetest.register_on_leaveplayer(function(player) tyrant.hud[player:get_player_name()] = nil end) --block defs for use override (metadata put/take/move + onrightclick) minetest.after(0, function() for key, value in pairs(minetest.registered_nodes) do getmetatable(value).__newindex = nil if value.on_rightclick then --if an on_rightclick function exists local t1=os.clock() local old_on_rc=value.on_rightclick value.on_rightclick=function(pos, node, player, itemstack, pointed_thing) print("[tyrant][info]node at "..minetest.pos_to_string(pos)..": "..(player and player:get_player_name() or "UNKNOWN").." right-clicks "..(node and node.name or "an unknown node")) if pos and player and player:is_player() then local allowed, err=tyrant.check_action_allowed(pos, player:get_player_name(), "activate") if not allowed then print("[tyrant][info]rightclick blocked:"..err) return false end end return old_on_rc(pos, node, player, itemstack, pointed_thing) end --print("[tyrant][benchmark] "..math.floor((os.clock()-t1)*1000).."ms for rightclick event") end local old_allow_metadata_inventory_move=value.allow_metadata_inventory_move or function(_, _, _, _, _, count) return count end minetest.registered_nodes[key].allow_metadata_inventory_move=function(pos, from_list, from_index, to_list, to_index, count, player) local t1=os.clock() print("[denaid][info]meta inventory at "..minetest.pos_to_string(pos)..": "..(player and player:get_player_name() or "UNKNOWN").." moves "..count.." items from "..from_list..":"..from_index.." to "..to_list..":"..to_index) if pos and player and player.is_player and player:is_player() then--player.is_player since pipeworks creates a fake player not including this function. local allowed, err=tyrant.check_action_allowed(pos, player:get_player_name(), "inv") if not allowed then print("[tyrant][info]inventory transaction blocked:"..err) return false end end local allow= old_allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) if allow==0 then print("[denaid][info]Inventory transaction denied by block definition") end --print("[tyrant][benchmark] "..math.floor((os.clock()-t1)*1000).."ms for inventory move event") return allow end local old_allow_metadata_inventory_put=value.allow_metadata_inventory_put or function(_, _, _, stack) return stack:get_count() end minetest.registered_nodes[key].allow_metadata_inventory_put=function(pos, listname, index, stack, player) local t1=os.clock() print("[denaid][info]meta inventory at "..minetest.pos_to_string(pos)..": "..(player and player:get_player_name() or "UNKNOWN").." puts "..stack:get_count().."x "..stack:get_name().." into "..listname..":"..index) if pos and player and player.is_player and player:is_player() then--player.is_player since pipeworks creates a fake player not including this function. local allowed, err=tyrant.check_action_allowed(pos, player:get_player_name(), "inv") if not allowed then print("[tyrant][info]inventory transaction blocked:"..err) return false end end local allow= old_allow_metadata_inventory_put(pos, listname, index, stack, player) if allow==0 then print("[denaid][info]Inventory transaction denied by block definition") end --print("[tyrant][benchmark] "..math.floor((os.clock()-t1)*1000).."ms for inventory put event") return allow end local old_allow_metadata_inventory_take=value.allow_metadata_inventory_take or function(_, _, _, stack) return stack:get_count() end minetest.registered_nodes[key].allow_metadata_inventory_take=function(pos, listname, index, stack, player) local t1=os.clock() print("[denaid][info]meta inventory at "..minetest.pos_to_string(pos)..": "..(player and player:get_player_name() or "UNKNOWN").." takes "..stack:get_count().."x "..stack:get_name().." from "..listname..":"..index) if pos and player and player.is_player and player:is_player() then--player.is_player since pipeworks creates a fake player not including this function. local allowed, err=tyrant.check_action_allowed(pos, player:get_player_name(), "inv") if not allowed then print("[tyrant][info]inventory transaction blocked:"..err) return false end end local allow= old_allow_metadata_inventory_take(pos, listname, index, stack, player) if allow==0 then print("[denaid][info]Inventory transaction denied by block definition") end --print("[tyrant][benchmark] "..math.floor((os.clock()-t1)*1000).."ms for inventory take event") return allow end end end) tyrant.areaselect={} tyrant.show_area_selection_form=function(player, intareas, desc) local ttbl={} local fsstr="" local first=true for intname,areaids in pairs(intareas) do for _,areaid in ipairs(areaids) do local entry=tyrant.nice_desc_of_area(intname, areaid, player) if first then fsstr=entry first=false else fsstr=fsstr..","..entry end table.insert(ttbl, intname..":"..areaid) end end tyrant.areaselect[player]=ttbl local trfa={} trfa[true]="true" trfa[false]="false" local formtext="size[5,8]label[0,02;"..S("Choose area by double-clicking").."]label[0,1;"..desc.."]".. "textlist[0,2;5,6;areas;"..fsstr..";0;false]" minetest.show_formspec(player, "tyrantareaselect", formtext) end minetest.register_on_player_receive_fields(function(player, formname, fields) if formname=="tyrantareaselect" then local pname=player:get_player_name() if tyrant.areaselect[pname] then --fields got send over --do anything if fields.areas then local val=minetest.explode_textlist_event(fields.areas) if val.type=="DCL" and tyrant.areaselect[pname][val.index] then local integration, areaid=string.match(tyrant.areaselect[pname][val.index], "^([^:]+):(.+)") if integration and areaid then tyrant.integrations[integration].on_area_info_requested(areaid, pname) end end end end end end) tyrant.show_player_all_areas=function(player_name) tyrant.show_area_selection_form(player_name, tyrant.get_all_areas(), S("All Areas")) end tyrant.show_player_areas_at=function(pos, player_name) tyrant.show_area_selection_form(player_name, tyrant.get_areas_at(vector.round(pos)), S("Areas at @1", minetest.pos_to_string(vector.round(pos)))) end --chat commands core.register_chatcommand("all_areas", { params = "", description = S("List all areas"), privs = {}, func = function(name, param) tyrant.show_player_all_areas(name) end, }) core.register_chatcommand("areas_here", { params = "", description = S("List areas at your position"), privs = {}, func = function(name, param) tyrant.show_player_areas_at(vector.round(minetest.get_player_by_name(name):getpos()), name) end, }) --integration registration tyrant.register_integration=function(name, register) if string.match(name, ":") then error("tyrant integration names may not contain ':'!") end if not (register.get_all_area_ids or register.get_is_area_at or register.check_permission or register.get_area_intersects_with) then error("register tyrant integration: missing required function in "..name) end local predef={ get_area_priority=function(areaid) return 0 end, is_hostile_mob_spawning_allowed=function(areaid) return true end, on_area_info_requested=function(areaid, player_name) tyrant.fs_message(player_name, tyrant.nice_desc_of_area(name, areaid, player_name)) end, get_display_name=function(areaid) return name..":"..areaid end, } for k,v in pairs(register) do predef[k]=v end tyrant.integrations[name]=predef end --still missing api tyrant.check_hostile_mobs_allowed=function(pos) local intareas=tyrant.get_areas_at(pos) local all_allow=true for intname,areaids in pairs(intareas) do for _,areaid in ipairs(areaids) do local permit=tyrant.integrations[intname].is_hostile_mob_spawning_allowed(areaid) if not permit then all_allow=false end end end return all_allow end tyrant.get_area_priority_at=function(pos) local last_prior=-127 for intname,intdef in pairs(tyrant.integrations) do local as_values, areaids=intdef.get_all_area_ids() if as_values then for _,areaid in ipairs(areaids) do if tyrant.integrations[intname].get_is_area_at(areaid, pos) then local now_prior=tyrant.integrations[intname].get_area_priority(areaid) if now_prior>last_prior then last_prior=now_prior end end end else for areaid,_ in pairs(areaids) do if tyrant.integrations[intname].get_is_area_at(areaid, pos) then local now_prior=tyrant.integrations[intname].get_area_priority(areaid) if now_prior>last_prior then last_prior=now_prior end end end end end return last_prior end tyrant.get_area_priority_inside=function(pos1, pos2) local last_prior=-127 for intname,intdef in pairs(tyrant.integrations) do local as_values, areaids=intdef.get_all_area_ids() if as_values then for _,areaid in ipairs(areaids) do if tyrant.integrations[intname].get_area_intersects_with(areaid, pos1, pos2) then local now_prior=tyrant.integrations[intname].get_area_priority(areaid) if now_prior>last_prior then last_prior=now_prior end end end else for areaid,_ in pairs(areaids) do if tyrant.integrations[intname].get_area_intersects_with(areaid, pos1, pos2) then local now_prior=tyrant.integrations[intname].get_area_priority(areaid) if now_prior>last_prior then last_prior=now_prior end end end end end return last_prior end
print(type(a)) a = 10 print(type(a)) a = "a string!!" print(type(a)) a = print a(type(a)) print("======分割线======") a = "one string" b = string.gsub(a,"one","another") print(a) print(b) print("========分割线======") print("10" + 1) print("10 + 1") --print("-5.3e - 10" * "2") --print("hello" + 1) print("=========分割线=======") -- ..在lua中是字符串连接符 print(10 .. 20) print("=========分割线=======") line = io.read() n = tonumber(line) if n == nil then error(line .. "is not a valid number") else print(n * 2) end print("=========分割线=======") print(tostring(10) == "10") print(10 .. "" == "10")
import "metabase_common.lua" import "platform_windows.lua" writer "writer_msvc.lua" option("msvc", "customwriter", "writer_msvc_windows.lua") option("msvcglobals", "Keyword", "Win32Proj") option("msvconfiguration", "CharacterSet", "Unicode") option("msvccompile", "MultiProcessorCompilation", "true") option("msvccompile", "MinimalRebuild", "false") option("msvccompile", "WarningLevel", "Level3") option("msvccompile", "TreatWarningAsError", "false") option("msvccompile", "IntrinsicFunctions", "true") config "Debug" option("msvccompile", "Optimization", "Disabled") option("msvclink", "GenerateDebugInformation", "true") config_end() config "Release" option("msvccompile", "Optimization", "MaxSpeed") option("msvccompile", "FunctionLevelLinking", "true") option("msvclink", "GenerateDebugInformation", "true") option("msvclink", "EnableCOMDATFolding", "true") option("msvclink", "OptimizeReferences", "true") config_end() config "Profile" option("msvccompile", "Optimization", "MaxSpeed") option("msvccompile", "FunctionLevelLinking", "true") option("msvclink", "GenerateDebugInformation", "true") option("msvclink", "EnableCOMDATFolding", "true") option("msvclink", "OptimizeReferences", "true") config_end() config "Master" option("msvccompile", "Optimization", "MaxSpeed") option("msvccompile", "FunctionLevelLinking", "true") option("msvclink", "GenerateDebugInformation", "false") option("msvclink", "EnableCOMDATFolding", "true") option("msvclink", "OptimizeReferences", "true") config_end()
local classes = classes; local super = classes.Object; local class = inherit({ name = "Vector3", super = super, func = inherit({}, super.func), get = inherit({}, super.get), set = inherit({}, super.set), concrete = true, }, super); classes[class.name] = class; local cache = setmetatable({}, { __mode = "v" }); function class.new(x, y, z) if (x ~= nil) then local x_t = type(x); if (x_t ~= "number") then error("bad argument #1 to '" ..__func__.. "' (number expected, got " ..x_t.. ")", 2); end else x = 0; end if (y ~= nil) then local y_t = type(y); if (y_t ~= "number") then error("bad argument #2 to '" ..__func__.. "' (number expected, got " ..y_t.. ")", 2); end else y = 0; end if (z ~= nil) then local z_t = type(z); if (z_t ~= "number") then error("bad argument #3 to '" ..__func__.. "' (number expected, got " ..z_t.. ")", 2); end else z = 0; end local cacheId = x.. ":" ..y.. ":" ..z; local obj = cache[cacheId]; if (not obj) then local success; success, obj = pcall(super.new, class); if (not success) then error(obj, 2) end obj.x = x; obj.y = y; obj.z = z; cache[cacheId] = obj; end return obj; end class.meta = extend({ __metatable = super.name.. ":" ..class.name, __add = function(obj1, obj2) local obj1_t = type(obj1); if (obj1_t ~= "Vector3" and obj1_t ~= "number") then error("bad operand #1 to '+' (Vector3/number expected, got " ..obj1_t.. ")", 2); end local obj2_t = type(obj2); if (obj2_t ~= "Vector3" and obj2_t ~= "number") then error("bad operand #2 to '+' (Vector3/number expected, got " ..obj2_t.. ")", 2); end return (obj1_t == "number") and class.new(obj1+obj2.x, obj1+obj2.y, obj1+obj2.z) or (obj2_t == "number") and class.new(obj1.x+obj2, obj1.y+obj2, obj1.z+obj2) or class.new(obj1.x+obj2.x, obj1.y+obj2.y, obj1.z+obj2.z); end, __sub = function(obj1, obj2) local obj1_t = type(obj1); if (obj1_t ~= "Vector3" and obj1_t ~= "number") then error("bad operand #1 to '-' (Vector3/number expected, got " ..obj1_t.. ")", 2); end local obj2_t = type(obj2); if (obj2_t ~= "Vector3" and obj2_t ~= "number") then error("bad operand #2 to '-' (Vector3/number expected, got " ..obj2_t.. ")", 2); end return (obj1_t == "number") and class.new(obj1-obj2.x, obj1-obj2.y, obj1-obj2.z) or (obj2_t == "number") and class.new(obj1.x-obj2, obj1.y-obj2, obj1.z-obj2) or class.new(obj1.x-obj2.x, obj1.y-obj2.y, obj1.z-obj2.z); end, __mul = function(obj1, obj2) local obj1_t = type(obj1); if (obj1_t ~= "Vector3" and obj1_t ~= "number") then error("bad operand #1 to '*' (Vector3/number expected, got " ..obj1_t.. ")", 2); end local obj2_t = type(obj2); if (obj2_t ~= "Vector3" and obj2_t ~= "number") then error("bad operand #2 to '*' (Vector3/Matrix3x3/number expected, got " ..obj2_t.. ")", 2); end return (obj1_t == "number") and class.new(obj1*obj2.x, obj1*obj2.y, obj1*obj2.z) or (obj2_t == "Matrix3x3") and class.new( obj1.x*obj2.m00 + obj1.y*obj2.m10 + obj1.z*obj2.m20, obj1.x*obj2.m01 + obj1.y*obj2.m11 + obj1.z*obj2.m21, obj1.x*obj2.m02 + obj1.y*obj2.m12 + obj1.z*obj2.m22 ) or (obj2_t == "number") and class.new(obj1.x*obj2, obj1.y*obj2, obj1.z*obj2) or class.new(obj1.x*obj2.x, obj1.y*obj2.y, obj1.z*obj2.z); end, __div = function(obj1, obj2) local obj1_t = type(obj1); if (obj1_t ~= "Vector3" and obj1_t ~= "number") then error("bad operand #1 to '/' (Vector3/number expected, got " ..obj1_t.. ")", 2); end local obj2_t = type(obj2); if (obj2_t ~= "Vector3" and obj2_t ~= "number") then error("bad operand #2 to '/' (Vector3/number expected, got " ..obj2_t.. ")", 2); end return (obj1_t == "number") and class.new(obj1/obj2.x, obj1/obj2.y, obj1/obj2.z) or (obj2_t == "number") and class.new(obj1.x/obj2, obj1.y/obj2, obj1.z/obj2) or class.new(obj1.x/obj2.x, obj1.y/obj2.y, obj1.z/obj2.z); end, __unm = function(obj) return class.new(-obj.x, -obj.y, -obj.z); end, __tostring = function(obj) return obj.x.. ", " ..obj.y.. ", " ..obj.z; end, }, super.meta); function class.func.unpack(obj) return obj.x, obj.y, obj.z; end function class.get.mag(obj) if (not obj.mag) then obj.mag = math.sqrt(obj.x^2 + obj.y^2 + obj.z^2); end return obj.mag; end function class.get.unit(obj) local mag = obj:get_mag(); if (mag == 0) then error("attempt to get unit of 0 magnitude vector", 2); end if (not obj.unit) then obj.unit = obj/mag; end return obj.unit; end function class.get.vec2(obj) if (not obj.vec2) then obj.vec2 = classes.Vector2.new(obj.x, obj.y); end return obj.vec2; end
fx_version 'adamant' games {'gta5'} description 'NPC-Taco-Shop' version '1.0.0' client_script "client/client.lua" client_script "client/client_dropoffs.lua" client_script "@npc-scripts/client/errorlog.lua" server_script "server/server.lua"
return { global = { fields = { love = { fields = { audio = { description = "Provides an interface to create noise with the user's speakers.", fields = { getDistanceModel = { args = {}, description = "Returns the distance attenuation model.", link = "https://love2d.org/wiki/love.audio.getDistanceModel", returnTypes = { { name = "DistanceModel", type = "ref" } }, type = "function" }, getDopplerScale = { args = {}, description = "Gets the current global scale factor for velocity-based doppler effects.", link = "https://love2d.org/wiki/love.audio.getDopplerScale", returnTypes = { { type = "number" } }, type = "function" }, getOrientation = { args = {}, description = "Returns the orientation of the listener.", link = "https://love2d.org/wiki/love.audio.getOrientation", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getPosition = { args = {}, description = "Returns the position of the listener.", link = "https://love2d.org/wiki/love.audio.getPosition", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getSourceCount = { args = {}, description = "Returns the number of sources which are currently playing or paused.", link = "https://love2d.org/wiki/love.audio.getSourceCount", returnTypes = { { type = "number" } }, type = "function" }, getVelocity = { args = {}, description = "Returns the velocity of the listener.", link = "https://love2d.org/wiki/love.audio.getVelocity", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getVolume = { args = {}, description = "Returns the master volume.", link = "https://love2d.org/wiki/love.audio.getVolume", returnTypes = { { type = "number" } }, type = "function" }, newSource = { link = "https://love2d.org/wiki/love.audio.newSource", returnTypes = { { name = "Source", type = "ref" } }, type = "function", variants = { { args = { { name = "filename" }, { displayName = "[type]", name = "type" } }, description = "Creates a new Source from a file or SoundData. Sources created from SoundData are always static." }, { args = { { name = "file" }, { displayName = "[type]", name = "type" } }, description = "Creates a new Source from a file or SoundData. Sources created from SoundData are always static." }, { args = { { name = "decoder" }, { displayName = "[type]", name = "type" } }, description = "Creates a new Source from a file or SoundData. Sources created from SoundData are always static." }, { args = { { name = "soundData" } }, description = "Creates a new Source from a file or SoundData. Sources created from SoundData are always static." }, { args = { { name = "fileData" } }, description = "Creates a new Source from a file or SoundData. Sources created from SoundData are always static." } } }, pause = { link = "https://love2d.org/wiki/love.audio.pause", type = "function", variants = { { args = {}, description = "This function will pause all currently active Sources." }, { args = { { name = "source" } }, description = "This function will only pause the specified Source." } } }, play = { args = { { name = "source" } }, description = "Plays the specified Source.", link = "https://love2d.org/wiki/love.audio.play", type = "function" }, resume = { link = "https://love2d.org/wiki/love.audio.resume", type = "function", variants = { { args = {}, description = "Resumes all audio" }, { args = { { name = "source" } }, description = "Resumes all audio" } } }, rewind = { link = "https://love2d.org/wiki/love.audio.rewind", type = "function", variants = { { args = {}, description = "Rewinds all playing audio." }, { args = { { name = "source" } }, description = "Rewinds all playing audio." } } }, setDistanceModel = { args = { { name = "model" } }, description = "Sets the distance attenuation model.", link = "https://love2d.org/wiki/love.audio.setDistanceModel", type = "function" }, setDopplerScale = { args = { { name = "scale" } }, description = "Sets a global scale factor for velocity-based doppler effects. The default scale value is 1.", link = "https://love2d.org/wiki/love.audio.setDopplerScale", type = "function" }, setOrientation = { args = { { name = "fx" }, { name = "fy" }, { name = "fz" }, { name = "ux" }, { name = "uy" }, { name = "uz" } }, description = "Sets the orientation of the listener.", link = "https://love2d.org/wiki/love.audio.setOrientation", type = "function" }, setPosition = { args = { { name = "x" }, { name = "y" }, { name = "z" } }, description = "Sets the position of the listener, which determines how sounds play.", link = "https://love2d.org/wiki/love.audio.setPosition", type = "function" }, setVelocity = { args = { { name = "x" }, { name = "y" }, { name = "z" } }, description = "Sets the velocity of the listener.", link = "https://love2d.org/wiki/love.audio.setVelocity", type = "function" }, setVolume = { args = { { name = "volume" } }, description = "Sets the master volume.", link = "https://love2d.org/wiki/love.audio.setVolume", type = "function" }, stop = { link = "https://love2d.org/wiki/love.audio.stop", type = "function", variants = { { args = {}, description = "This function will stop all currently active sources." }, { args = { { name = "source" } }, description = "This function will only stop the specified source." } } } }, link = "https://love2d.org/wiki/love.audio", type = "table" }, conf = { args = { { name = "t" } }, description = "If a file called conf.lua is present in your game folder (or .love file), it is run before the LÖVE modules are loaded. You can use this file to overwrite the love.conf function, which is later called by the LÖVE 'boot' script. Using the love.conf function, you can set some configuration options, and change things like the default size of the window, which modules are loaded, and other stuff.", link = "https://love2d.org/wiki/love.conf", type = "function" }, directorydropped = { args = { { name = "path" } }, description = "Callback function triggered when a directory is dragged and dropped onto the window.", link = "https://love2d.org/wiki/love.directorydropped", type = "function" }, draw = { args = {}, description = "Callback function used to draw on the screen every frame.", link = "https://love2d.org/wiki/love.draw", type = "function" }, errhand = { args = { { name = "msg" } }, description = "The error handler, used to display error messages.", link = "https://love2d.org/wiki/love.errhand", type = "function" }, event = { description = "Manages events, like keypresses.", fields = { clear = { args = {}, description = "Clears the event queue.", link = "https://love2d.org/wiki/love.event.clear", type = "function" }, poll = { args = {}, description = "Returns an iterator for messages in the event queue.", link = "https://love2d.org/wiki/love.event.poll", returnTypes = { { type = "function" } }, type = "function" }, pump = { args = {}, description = "Pump events into the event queue. This is a low-level function, and is usually not called by the user, but by love.run. Note that this does need to be called for any OS to think you're still running, and if you want to handle OS-generated events at all (think callbacks). love.event.pump can only be called from the main thread, but afterwards, the rest of love.event can be used from any other thread.", link = "https://love2d.org/wiki/love.event.pump", type = "function" }, push = { args = { { name = "e" }, { displayName = "[a]", name = "a" }, { displayName = "[b]", name = "b" }, { displayName = "[c]", name = "c" }, { displayName = "[d]", name = "d" } }, description = "Adds an event to the event queue.", link = "https://love2d.org/wiki/love.event.push", type = "function" }, quit = { link = "https://love2d.org/wiki/love.event.quit", type = "function", variants = { { args = {}, description = "Adds the quit event to the queue.\n\nThe quit event is a signal for the event handler to close LÖVE. It's possible to abort the exit process with the love.quit callback." }, { args = { { displayName = "[exitstatus]", name = "exitstatus" } }, description = "Adds the quit event to the queue.\n\nThe quit event is a signal for the event handler to close LÖVE. It's possible to abort the exit process with the love.quit callback." }, { args = { { name = "\"restart\"" } }, description = "Adds the quit event to the queue.\n\nThe quit event is a signal for the event handler to close LÖVE. It's possible to abort the exit process with the love.quit callback." } } }, wait = { args = {}, description = "Like love.event.poll but blocks until there is an event in the queue.", link = "https://love2d.org/wiki/love.event.wait", returnTypes = { { name = "Event", type = "ref" }, { name = "Variant", type = "ref" }, { name = "Variant", type = "ref" }, { name = "Variant", type = "ref" }, { name = "Variant", type = "ref" } }, type = "function" } }, link = "https://love2d.org/wiki/love.event", type = "table" }, filedropped = { args = { { name = "file" } }, description = "Callback function triggered when a file is dragged and dropped onto the window.", link = "https://love2d.org/wiki/love.filedropped", type = "function" }, filesystem = { description = "Provides an interface to the user's filesystem.", fields = { append = { args = { { name = "name" }, { name = "data" }, { displayName = "[size]", name = "size" } }, description = "Append data to an existing file.", link = "https://love2d.org/wiki/love.filesystem.append", returnTypes = { { type = "boolean" }, { type = "string" } }, type = "function" }, areSymlinksEnabled = { args = {}, description = "Gets whether love.filesystem follows symbolic links.", link = "https://love2d.org/wiki/love.filesystem.areSymlinksEnabled", returnTypes = { { type = "boolean" } }, type = "function" }, createDirectory = { args = { { name = "name" } }, description = "Creates a directory.", link = "https://love2d.org/wiki/love.filesystem.createDirectory", returnTypes = { { type = "boolean" } }, type = "function" }, exists = { args = { { name = "filename" } }, description = "Check whether a file or directory exists.", link = "https://love2d.org/wiki/love.filesystem.exists", returnTypes = { { type = "boolean" } }, type = "function" }, getAppdataDirectory = { args = {}, description = "Returns the application data directory (could be the same as getUserDirectory)", link = "https://love2d.org/wiki/love.filesystem.getAppdataDirectory", returnTypes = { { type = "string" } }, type = "function" }, getDirectoryItems = { args = { { name = "dir" } }, description = "Returns a table with the names of files and subdirectories in the specified path. The table is not sorted in any way; the order is undefined.\n\nIf the path passed to the function exists in the game and the save directory, it will list the files and directories from both places.", link = "https://love2d.org/wiki/love.filesystem.getDirectoryItems", returnTypes = { { type = "table" } }, type = "function" }, getIdentity = { args = { { name = "name" } }, description = "Gets the write directory name for your game. Note that this only returns the name of the folder to store your files in, not the full location.", link = "https://love2d.org/wiki/love.filesystem.getIdentity", type = "function" }, getLastModified = { args = { { name = "filename" } }, description = "Gets the last modification time of a file.", link = "https://love2d.org/wiki/love.filesystem.getLastModified", returnTypes = { { type = "number" }, { type = "string" } }, type = "function" }, getRealDirectory = { args = { { name = "filepath" } }, description = "Gets the platform-specific absolute path of the directory containing a filepath.\n\nThis can be used to determine whether a file is inside the save directory or the game's source .love.", link = "https://love2d.org/wiki/love.filesystem.getRealDirectory", returnTypes = { { type = "string" } }, type = "function" }, getRequirePath = { args = {}, description = "Gets the filesystem paths that will be searched when require is called.\n\nThe paths string returned by this function is a sequence of path templates separated by semicolons. The argument passed to require will be inserted in place of any question mark (\"?\") character in each template (after the dot characters in the argument passed to require are replaced by directory separators.)\n\nThe paths are relative to the game's source and save directories, as well as any paths mounted with love.filesystem.mount.", link = "https://love2d.org/wiki/love.filesystem.getRequirePath", returnTypes = { { type = "string" } }, type = "function" }, getSaveDirectory = { args = {}, description = "Gets the full path to the designated save directory. This can be useful if you want to use the standard io library (or something else) to read or write in the save directory.", link = "https://love2d.org/wiki/love.filesystem.getSaveDirectory", returnTypes = { { type = "string" } }, type = "function" }, getSize = { args = { { name = "filename" } }, description = "Gets the size in bytes of a file.", link = "https://love2d.org/wiki/love.filesystem.getSize", returnTypes = { { type = "number" }, { type = "string" } }, type = "function" }, getSource = { args = {}, description = "Returns the full path to the the .love file or directory. If the game is fused to the LÖVE executable, then the executable is returned.", link = "https://love2d.org/wiki/love.filesystem.getSource", returnTypes = { { type = "string" } }, type = "function" }, getSourceBaseDirectory = { args = {}, description = "Returns the full path to the directory containing the .love file. If the game is fused to the LÖVE executable, then the directory containing the executable is returned.\n\nIf love.filesystem.isFused is true, the path returned by this function can be passed to love.filesystem.mount, which will make the directory containing the main game readable by love.filesystem.", link = "https://love2d.org/wiki/love.filesystem.getSourceBaseDirectory", returnTypes = { { type = "string" } }, type = "function" }, getUserDirectory = { args = {}, description = "Returns the path of the user's directory.", link = "https://love2d.org/wiki/love.filesystem.getUserDirectory", returnTypes = { { type = "string" } }, type = "function" }, getWorkingDirectory = { args = {}, description = "Gets the current working directory.", link = "https://love2d.org/wiki/love.filesystem.getWorkingDirectory", returnTypes = { { type = "string" } }, type = "function" }, init = { args = { { name = "appname" } }, description = "Initializes love.filesystem, will be called internally, so should not be used explicitly.", link = "https://love2d.org/wiki/love.filesystem.init", type = "function" }, isDirectory = { args = { { name = "path" } }, description = "Check whether something is a directory.", link = "https://love2d.org/wiki/love.filesystem.isDirectory", returnTypes = { { type = "boolean" } }, type = "function" }, isFile = { args = { { name = "path" } }, description = "Check whether something is a file.", link = "https://love2d.org/wiki/love.filesystem.isFile", returnTypes = { { type = "boolean" } }, type = "function" }, isFused = { args = {}, description = "Gets whether the game is in fused mode or not.\n\nIf a game is in fused mode, its save directory will be directly in the Appdata directory instead of Appdata/LOVE/. The game will also be able to load C Lua dynamic libraries which are located in the save directory.\n\nA game is in fused mode if the source .love has been fused to the executable (see Game Distribution), or if \"--fused\" has been given as a command-line argument when starting the game.", link = "https://love2d.org/wiki/love.filesystem.isFused", returnTypes = { { type = "boolean" } }, type = "function" }, isSymlink = { args = { { name = "path" } }, description = "Gets whether a filepath is actually a symbolic link.\n\nIf symbolic links are not enabled (via love.filesystem.setSymlinksEnabled), this function will always return false.", link = "https://love2d.org/wiki/love.filesystem.isSymlink", returnTypes = { { type = "boolean" } }, type = "function" }, lines = { args = { { name = "name" } }, description = "Iterate over the lines in a file.", link = "https://love2d.org/wiki/love.filesystem.lines", returnTypes = { { type = "function" } }, type = "function" }, load = { args = { { name = "name" }, { displayName = "[errormsg]", name = "errormsg" } }, description = "Loads a Lua file (but does not run it).", link = "https://love2d.org/wiki/love.filesystem.load", returnTypes = { { type = "function" } }, type = "function" }, mount = { link = "https://love2d.org/wiki/love.filesystem.mount", returnTypes = { { type = "boolean" } }, type = "function", variants = { { args = { { name = "archive" }, { name = "mountpoint" } }, description = "Mounts a zip file or folder in the game's save directory for reading." }, { args = { { name = "archive" }, { name = "mountpoint" }, { displayName = "[appendToPath]", name = "appendToPath" } }, description = "Mounts a zip file or folder in the game's save directory for reading." } } }, newFile = { args = { { name = "filename" }, { displayName = "[mode]", name = "mode" } }, description = "Creates a new File object. It needs to be opened before it can be accessed.", link = "https://love2d.org/wiki/love.filesystem.newFile", returnTypes = { { name = "File", type = "ref" }, { type = "string" } }, type = "function" }, newFileData = { link = "https://love2d.org/wiki/love.filesystem.newFileData", returnTypes = { { name = "FileData", type = "ref" } }, type = "function", variants = { { args = { { name = "contents" }, { name = "name" }, { displayName = "[decoder]", name = "decoder" } }, description = "Creates a new FileData object." }, { args = { { name = "filepath" } }, description = "Creates a new FileData from a file on the storage device." } } }, read = { args = { { name = "name" }, { displayName = "[bytes]", name = "bytes" } }, description = "Read the contents of a file.", link = "https://love2d.org/wiki/love.filesystem.read", returnTypes = { { type = "string" }, { type = "number" } }, type = "function" }, remove = { args = { { name = "name" } }, description = "Removes a file or directory.", link = "https://love2d.org/wiki/love.filesystem.remove", returnTypes = { { type = "boolean" } }, type = "function" }, setIdentity = { args = { { name = "name" }, { displayName = "[appendToPath]", name = "appendToPath" } }, description = "Sets the write directory for your game. Note that you can only set the name of the folder to store your files in, not the location.", link = "https://love2d.org/wiki/love.filesystem.setIdentity", type = "function" }, setRequirePath = { args = { { name = "paths" } }, description = "Sets the filesystem paths that will be searched when require is called.\n\nThe paths string given to this function is a sequence of path templates separated by semicolons. The argument passed to require will be inserted in place of any question mark (\"?\") character in each template (after the dot characters in the argument passed to require are replaced by directory separators.)\n\nThe paths are relative to the game's source and save directories, as well as any paths mounted with love.filesystem.mount.", link = "https://love2d.org/wiki/love.filesystem.setRequirePath", type = "function" }, setSource = { args = { { name = "path" } }, description = "Sets the source of the game, where the code is present. This function can only be called once, and is normally automatically done by LÖVE.", link = "https://love2d.org/wiki/love.filesystem.setSource", type = "function" }, setSymlinksEnabled = { args = { { name = "enable" } }, description = "Sets whether love.filesystem follows symbolic links. It is enabled by default in version 0.10.0 and newer, and disabled by default in 0.9.2.", link = "https://love2d.org/wiki/love.filesystem.setSymlinksEnabled", type = "function" }, unmount = { args = { { name = "archive" } }, description = "Unmounts a zip file or folder previously mounted for reading with love.filesystem.mount.", link = "https://love2d.org/wiki/love.filesystem.unmount", returnTypes = { { type = "boolean" } }, type = "function" }, write = { link = "https://love2d.org/wiki/love.filesystem.write", returnTypes = { { type = "boolean" }, { type = "string" } }, type = "function", variants = { { args = { { name = "name" }, { name = "data" }, { displayName = "[size]", name = "size" } }, description = "Write data to a file.\n\nIf you are getting the error message \"Could not set write directory\", try setting the save directory. This is done either with love.filesystem.setIdentity or by setting the identity field in love.conf." }, { args = { { name = "name" }, { name = "data" }, { displayName = "[size]", name = "size" } }, description = "Write data to a file.\n\nIf you are getting the error message \"Could not set write directory\", try setting the save directory. This is done either with love.filesystem.setIdentity or by setting the identity field in love.conf." } } } }, link = "https://love2d.org/wiki/love.filesystem", type = "table" }, focus = { args = { { name = "focus" } }, description = "Callback function triggered when window receives or loses focus.", link = "https://love2d.org/wiki/love.focus", type = "function" }, gamepadaxis = { args = { { name = "joystick" }, { name = "axis" } }, description = "Called when a Joystick's virtual gamepad axis is moved.", link = "https://love2d.org/wiki/love.gamepadaxis", type = "function" }, gamepadpressed = { args = { { name = "joystick" }, { name = "button" } }, description = "Called when a Joystick's virtual gamepad button is pressed.", link = "https://love2d.org/wiki/love.gamepadpressed", type = "function" }, gamepadreleased = { args = { { name = "joystick" }, { name = "button" } }, description = "Called when a Joystick's virtual gamepad button is released.", link = "https://love2d.org/wiki/love.gamepadreleased", type = "function" }, getVersion = { args = {}, description = "Gets the current running version of LÖVE.", link = "https://love2d.org/wiki/love.getVersion", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "string" } }, type = "function" }, graphics = { description = "The primary responsibility for the love.graphics module is the drawing of lines, shapes, text, Images and other Drawable objects onto the screen. Its secondary responsibilities include loading external files (including Images and Fonts) into memory, creating specialized objects (such as ParticleSystems or Canvases) and managing screen geometry.\n\nLÖVE's coordinate system is rooted in the upper-left corner of the screen, which is at location (0, 0). The x axis is horizontal: larger values are further to the right. The y axis is vertical: larger values are further towards the bottom.\n\nIn many cases, you draw images or shapes in terms of their upper-left corner.\n\nMany of the functions are used to manipulate the graphics coordinate system, which is essentially the way coordinates are mapped to the display. You can change the position, scale, and even rotation in this way.", fields = { arc = { link = "https://love2d.org/wiki/love.graphics.arc", type = "function", variants = { { args = { { name = "drawmode" }, { name = "x" }, { name = "y" }, { name = "radius" }, { name = "angle1" }, { name = "angle2" }, { displayName = "[segments]", name = "segments" } }, description = "Draws an arc using the \"pie\" ArcType." }, { args = { { name = "drawmode" }, { name = "arctype" }, { name = "x" }, { name = "y" }, { name = "radius" }, { name = "angle1" }, { name = "angle2" }, { displayName = "[segments]", name = "segments" } }, description = "Draws a filled or unfilled arc at position (x, y). The arc is drawn from angle1 to angle2 in radians. The segments parameter determines how many segments are used to draw the arc. The more segments, the smoother the edge." } } }, circle = { link = "https://love2d.org/wiki/love.graphics.circle", type = "function", variants = { { args = { { name = "mode" }, { name = "x" }, { name = "y" }, { name = "radius" } }, description = "Draws a circle." }, { args = { { name = "mode" }, { name = "x" }, { name = "y" }, { name = "radius" }, { name = "segments" } }, description = "Draws a circle." } } }, clear = { link = "https://love2d.org/wiki/love.graphics.clear", type = "function", variants = { { args = {}, description = "Clears the screen to the background color in 0.9.2 and earlier, or to transparent black (0, 0, 0, 0) in LÖVE 0.10.0 and newer." }, { args = { { name = "r" }, { name = "g" }, { name = "b" }, { displayName = "[a]", name = "a" } }, description = "Clears the screen or active Canvas to the specified color." }, { args = { { name = "color" }, { name = "..." } }, description = "Clears multiple active Canvases to different colors, if multiple Canvases are active at once via love.graphics.setCanvas." } } }, discard = { link = "https://love2d.org/wiki/love.graphics.discard", type = "function", variants = { { args = { { displayName = "[discardcolor]", name = "discardcolor" }, { displayName = "[discardstencil]", name = "discardstencil" } }, description = "Discards (trashes) the contents of the screen or active Canvas. This is a performance optimization function with niche use cases.\n\nIf the active Canvas has just been changed and the \"replace\" BlendMode is about to be used to draw something which covers the entire screen, calling love.graphics.discard rather than calling love.graphics.clear or doing nothing may improve performance on mobile devices.\n\nOn some desktop systems this function may do nothing." }, { args = { { name = "discardcolors" }, { displayName = "[discardstencil]", name = "discardstencil" } }, description = "Discards (trashes) the contents of the screen or active Canvas. This is a performance optimization function with niche use cases.\n\nIf the active Canvas has just been changed and the \"replace\" BlendMode is about to be used to draw something which covers the entire screen, calling love.graphics.discard rather than calling love.graphics.clear or doing nothing may improve performance on mobile devices.\n\nOn some desktop systems this function may do nothing." } } }, draw = { link = "https://love2d.org/wiki/love.graphics.draw", type = "function", variants = { { args = { { name = "drawable" }, { displayName = "[x]", name = "x" }, { displayName = "[y]", name = "y" }, { displayName = "[r]", name = "r" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Draws a Drawable object (an Image, Canvas, SpriteBatch, ParticleSystem, Mesh, or Video) on the screen with optional rotation, scaling and shearing.\n\nObjects are drawn relative to their local coordinate system. The origin is by default located at the top left corner of Image and Canvas. All scaling, shearing, and rotation arguments transform the object relative to that point. Also, the position of the origin can be specified on the screen coordinate system.\n\nIt's possible to rotate an object about its center by offsetting the origin to the center. Angles must be given in radians for rotation. One can also use a negative scaling factor to flip about its centerline.\n\nNote that the offsets are applied before rotation, scaling, or shearing; scaling and shearing are applied before rotation.\n\nThe right and bottom edges of the object are shifted at an angle defined by the shearing factors." }, { args = { { name = "texture" }, { name = "quad" }, { displayName = "[x]", name = "x" }, { displayName = "[y]", name = "y" }, { displayName = "[r]", name = "r" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Draws a Drawable object (an Image, Canvas, SpriteBatch, ParticleSystem, Mesh, or Video) on the screen with optional rotation, scaling and shearing.\n\nObjects are drawn relative to their local coordinate system. The origin is by default located at the top left corner of Image and Canvas. All scaling, shearing, and rotation arguments transform the object relative to that point. Also, the position of the origin can be specified on the screen coordinate system.\n\nIt's possible to rotate an object about its center by offsetting the origin to the center. Angles must be given in radians for rotation. One can also use a negative scaling factor to flip about its centerline.\n\nNote that the offsets are applied before rotation, scaling, or shearing; scaling and shearing are applied before rotation.\n\nThe right and bottom edges of the object are shifted at an angle defined by the shearing factors." } } }, ellipse = { link = "https://love2d.org/wiki/love.graphics.ellipse", type = "function", variants = { { args = { { name = "mode" }, { name = "x" }, { name = "y" }, { name = "radiusx" }, { name = "radiusy" } }, description = "Draws an ellipse." }, { args = { { name = "mode" }, { name = "x" }, { name = "y" }, { name = "radiusx" }, { name = "radiusy" }, { name = "segments" } }, description = "Draws an ellipse." } } }, getBackgroundColor = { args = {}, description = "Gets the current background color.", link = "https://love2d.org/wiki/love.graphics.getBackgroundColor", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getBlendMode = { args = {}, description = "Gets the blending mode.", link = "https://love2d.org/wiki/love.graphics.getBlendMode", returnTypes = { { name = "BlendMode", type = "ref" }, { name = "BlendAlphaMode", type = "ref" } }, type = "function" }, getCanvas = { args = {}, description = "Gets the current target Canvas.", link = "https://love2d.org/wiki/love.graphics.getCanvas", returnTypes = { { name = "Canvas", type = "ref" } }, type = "function" }, getCanvasFormats = { args = {}, description = "Gets the available Canvas formats, and whether each is supported.", link = "https://love2d.org/wiki/love.graphics.getCanvasFormats", returnTypes = { { type = "table" } }, type = "function" }, getColor = { args = {}, description = "Gets the current color.", link = "https://love2d.org/wiki/love.graphics.getColor", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getColorMask = { args = {}, description = "Gets the active color components used when drawing. Normally all 4 components are active unless love.graphics.setColorMask has been used.\n\nThe color mask determines whether individual components of the colors of drawn objects will affect the color of the screen. They affect love.graphics.clear and Canvas:clear as well.", link = "https://love2d.org/wiki/love.graphics.getColorMask", returnTypes = { { type = "boolean" }, { type = "boolean" }, { type = "boolean" }, { type = "boolean" } }, type = "function" }, getCompressedImageFormats = { args = {}, description = "Gets the available compressed image formats, and whether each is supported.", link = "https://love2d.org/wiki/love.graphics.getCompressedImageFormats", returnTypes = { { type = "table" } }, type = "function" }, getDefaultFilter = { args = {}, description = "Returns the default scaling filters used with Images, Canvases, and Fonts.", link = "https://love2d.org/wiki/love.graphics.getDefaultFilter", returnTypes = { { name = "FilterMode", type = "ref" }, { name = "FilterMode", type = "ref" }, { type = "number" } }, type = "function" }, getDimensions = { args = {}, description = "Gets the width and height of the window.", link = "https://love2d.org/wiki/love.graphics.getDimensions", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getFont = { args = {}, description = "Gets the current Font object.", link = "https://love2d.org/wiki/love.graphics.getFont", returnTypes = { { name = "Font", type = "ref" } }, type = "function" }, getHeight = { args = {}, description = "Gets the height of the window.", link = "https://love2d.org/wiki/love.graphics.getHeight", returnTypes = { { type = "number" } }, type = "function" }, getLineJoin = { args = {}, description = "Gets the line join style.", link = "https://love2d.org/wiki/love.graphics.getLineJoin", returnTypes = { { name = "LineJoin", type = "ref" } }, type = "function" }, getLineStyle = { args = {}, description = "Gets the line style.", link = "https://love2d.org/wiki/love.graphics.getLineStyle", returnTypes = { { name = "LineStyle", type = "ref" } }, type = "function" }, getLineWidth = { args = {}, description = "Gets the current line width.", link = "https://love2d.org/wiki/love.graphics.getLineWidth", returnTypes = { { type = "number" } }, type = "function" }, getPointSize = { args = {}, description = "Gets the point size.", link = "https://love2d.org/wiki/love.graphics.getPointSize", returnTypes = { { type = "number" } }, type = "function" }, getRendererInfo = { args = {}, description = "Gets information about the system's video card and drivers.", link = "https://love2d.org/wiki/love.graphics.getRendererInfo", returnTypes = { { type = "string" }, { type = "string" }, { type = "string" }, { type = "string" } }, type = "function" }, getScissor = { args = {}, description = "Gets the current scissor box.", link = "https://love2d.org/wiki/love.graphics.getScissor", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getShader = { args = {}, description = "Returns the current Shader. Returns nil if none is set.", link = "https://love2d.org/wiki/love.graphics.getShader", returnTypes = { { name = "Shader", type = "ref" } }, type = "function" }, getStats = { args = {}, description = "Gets performance-related rendering statistics.", link = "https://love2d.org/wiki/love.graphics.getStats", returnTypes = { { type = "table" } }, type = "function" }, getStencilTest = { args = {}, description = "Gets whether stencil testing is enabled.\n\nWhen stencil testing is enabled, the geometry of everything that is drawn will be clipped / stencilled out based on whether it intersects with what has been previously drawn to the stencil buffer.\n\nEach Canvas has its own stencil buffer.", link = "https://love2d.org/wiki/love.graphics.getStencilTest", returnTypes = { { type = "boolean" }, { type = "boolean" } }, type = "function" }, getSupported = { args = {}, description = "Gets the optional graphics features and whether they're supported on the system.\n\nSome older or low-end systems don't always support all graphics features.", link = "https://love2d.org/wiki/love.graphics.getSupported", returnTypes = { { type = "table" } }, type = "function" }, getSystemLimits = { args = {}, description = "Gets the system-dependent maximum values for love.graphics features.", link = "https://love2d.org/wiki/love.graphics.getSystemLimits", returnTypes = { { type = "table" } }, type = "function" }, getWidth = { args = {}, description = "Gets the width of the window.", link = "https://love2d.org/wiki/love.graphics.getWidth", returnTypes = { { type = "number" } }, type = "function" }, intersectScissor = { link = "https://love2d.org/wiki/love.graphics.intersectScissor", type = "function", variants = { { args = { { name = "x" }, { name = "y" }, { name = "width" }, { name = "height" } }, description = "Limits the drawing area to a specified rectangle." }, { args = {}, description = "Disables scissor." } } }, isGammaCorrect = { args = {}, description = "Gets whether gamma-correct rendering is supported and enabled. It can be enabled by setting t.gammacorrect = true in love.conf.\n\nNot all devices support gamma-correct rendering, in which case it will be automatically disabled and this function will return false. It is supported on desktop systems which have graphics cards that are capable of using OpenGL 3 / DirectX 10, and iOS devices that can use OpenGL ES 3.", link = "https://love2d.org/wiki/love.graphics.isGammaCorrect", returnTypes = { { type = "boolean" } }, type = "function" }, isWireframe = { args = {}, description = "Gets whether wireframe mode is used when drawing.", link = "https://love2d.org/wiki/love.graphics.isWireframe", returnTypes = { { type = "boolean" } }, type = "function" }, line = { link = "https://love2d.org/wiki/love.graphics.line", type = "function", variants = { { args = { { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "..." } }, description = "Draws lines between points." }, { args = { { name = "points" } }, description = "Draws lines between points." } } }, newCanvas = { args = { { displayName = "[width]", name = "width" }, { displayName = "[height]", name = "height" }, { displayName = "[format]", name = "format" }, { displayName = "[msaa]", name = "msaa" } }, description = "Creates a new Canvas object for offscreen rendering.\n\nAntialiased Canvases have slightly higher system requirements than normal Canvases. Additionally, the supported maximum number of MSAA samples varies depending on the system. Use love.graphics.getSystemLimit to check.\n\nIf the number of MSAA samples specified is greater than the maximum supported by the system, the Canvas will still be created but only using the maximum supported amount (this includes 0.)", link = "https://love2d.org/wiki/love.graphics.newCanvas", returnTypes = { { name = "Canvas", type = "ref" } }, type = "function" }, newFont = { link = "https://love2d.org/wiki/love.graphics.newFont", returnTypes = { { name = "Font", type = "ref" } }, type = "function", variants = { { args = { { name = "filename" } }, description = "Create a new BMFont or TrueType font." }, { args = { { name = "filename" }, { name = "size" } }, description = "Create a new TrueType font." }, { args = { { name = "filename" }, { name = "imagefilename" } }, description = "Create a new BMFont." }, { args = { { name = "size" } }, description = "Create a new instance of the default font (Vera Sans) with a custom size." } } }, newImage = { link = "https://love2d.org/wiki/love.graphics.newImage", returnTypes = { { name = "Image", type = "ref" } }, type = "function", variants = { { args = { { name = "filename" } }, description = "Creates a new Image from a filepath, FileData, an ImageData, or a CompressedImageData, and optionally generates or specifies mipmaps for the image." }, { args = { { name = "imageData" } }, description = "Creates a new Image from a filepath, FileData, an ImageData, or a CompressedImageData, and optionally generates or specifies mipmaps for the image." }, { args = { { name = "compressedImageData" } }, description = "Creates a new Image from a filepath, FileData, an ImageData, or a CompressedImageData, and optionally generates or specifies mipmaps for the image." }, { args = { { name = "filename" }, { name = "flags" } }, description = "Creates a new Image from a filepath, FileData, an ImageData, or a CompressedImageData, and optionally generates or specifies mipmaps for the image." } } }, newImageFont = { link = "https://love2d.org/wiki/love.graphics.newImageFont", returnTypes = { { name = "Font", type = "ref" } }, type = "function", variants = { { args = { { name = "filename" }, { name = "glyphs" } }, description = "Creates a new Font by loading a specifically formatted image.\n\nIn versions prior to 0.9.0, LÖVE expects ISO 8859-1 encoding for the glyphs string." }, { args = { { name = "imageData" }, { name = "glyphs" } }, description = "Creates a new Font by loading a specifically formatted image.\n\nIn versions prior to 0.9.0, LÖVE expects ISO 8859-1 encoding for the glyphs string." }, { args = { { name = "filename" }, { name = "glyphs" }, { displayName = "[extraspacing]", name = "extraspacing" } }, description = "Creates a new Font by loading a specifically formatted image.\n\nIn versions prior to 0.9.0, LÖVE expects ISO 8859-1 encoding for the glyphs string." } } }, newMesh = { link = "https://love2d.org/wiki/love.graphics.newMesh", returnTypes = { { name = "Mesh", type = "ref" } }, type = "function", variants = { { args = { { name = "vertices" }, { displayName = "[mode]", name = "mode" }, { displayName = "[usage]", name = "usage" } }, description = "Creates a standard Mesh with the specified vertices." }, { args = { { name = "vertexcount" }, { displayName = "[mode]", name = "mode" }, { displayName = "[usage]", name = "usage" } }, description = "Creates a standard Mesh with the specified number of vertices." }, { args = { { name = "vertexformat" }, { name = "vertices" }, { displayName = "[mode]", name = "mode" }, { displayName = "[usage]", name = "usage" } }, description = "Creates a Mesh with custom vertex attributes and the specified vertex data." }, { args = { { name = "vertexformat" }, { name = "vertexcount" }, { displayName = "[mode]", name = "mode" }, { displayName = "[usage]", name = "usage" } }, description = "Creates a Mesh with custom vertex attributes and the specified number of vertices." } } }, newParticleSystem = { args = { { name = "texture" }, { displayName = "[buffer]", name = "buffer" } }, description = "Creates a new ParticleSystem.", link = "https://love2d.org/wiki/love.graphics.newParticleSystem", returnTypes = { { name = "ParticleSystem", type = "ref" } }, type = "function" }, newQuad = { args = { { name = "x" }, { name = "y" }, { name = "width" }, { name = "height" }, { name = "sw" }, { name = "sh" } }, description = "Creates a new Quad.\n\nThe purpose of a Quad is to describe the result of the following transformation on any drawable object. The object is first scaled to dimensions sw * sh. The Quad then describes the rectangular area of dimensions width * height whose upper left corner is at position (x, y) inside the scaled object.", link = "https://love2d.org/wiki/love.graphics.newQuad", returnTypes = { { name = "Quad", type = "ref" } }, type = "function" }, newScreenshot = { args = { { displayName = "[copyAlpha]", name = "copyAlpha" } }, description = "Creates a screenshot and returns the image data.", link = "https://love2d.org/wiki/love.graphics.newScreenshot", returnTypes = { { name = "ImageData", type = "ref" } }, type = "function" }, newShader = { link = "https://love2d.org/wiki/love.graphics.newShader", returnTypes = { { name = "Shader", type = "ref" } }, type = "function", variants = { { args = { { name = "code" } }, description = "Creates a new Shader object for hardware-accelerated vertex and pixel effects. A Shader contains either vertex shader code, pixel shader code, or both.\n\nVertex shader code must contain at least one function, named position, which is the function that will produce transformed vertex positions of drawn objects in screen-space.\n\nPixel shader code must contain at least one function, named effect, which is the function that will produce the color which is blended onto the screen for each pixel a drawn object touches." }, { args = { { name = "pixelcode" }, { name = "vertexcode" } }, description = "Creates a new Shader object for hardware-accelerated vertex and pixel effects. A Shader contains either vertex shader code, pixel shader code, or both.\n\nVertex shader code must contain at least one function, named position, which is the function that will produce transformed vertex positions of drawn objects in screen-space.\n\nPixel shader code must contain at least one function, named effect, which is the function that will produce the color which is blended onto the screen for each pixel a drawn object touches." } } }, newSpriteBatch = { args = { { name = "texture" }, { displayName = "[maxsprites]", name = "maxsprites" }, { displayName = "[usage]", name = "usage" } }, description = "Creates a new SpriteBatch object.", link = "https://love2d.org/wiki/love.graphics.newSpriteBatch", returnTypes = { { name = "SpriteBatch", type = "ref" } }, type = "function" }, newText = { args = { { name = "font" }, { displayName = "[textstring]", name = "textstring" } }, description = "Creates a new drawable Text object.", link = "https://love2d.org/wiki/love.graphics.newText", returnTypes = { { name = "Text", type = "ref" } }, type = "function" }, newVideo = { link = "https://love2d.org/wiki/love.graphics.newVideo", returnTypes = { { name = "Video", type = "ref" } }, type = "function", variants = { { args = { { name = "filename" }, { displayName = "[loadaudio]", name = "loadaudio" } }, description = "Creates a new drawable Video. Currently only Ogg Theora video files are supported." }, { args = { { name = "videostream" }, { displayName = "[loadaudio]", name = "loadaudio" } }, description = "Creates a new drawable Video. Currently only Ogg Theora video files are supported." } } }, origin = { args = {}, description = "Resets the current coordinate transformation.\n\nThis function is always used to reverse any previous calls to love.graphics.rotate, love.graphics.scale, love.graphics.shear or love.graphics.translate. It returns the current transformation state to its defaults.", link = "https://love2d.org/wiki/love.graphics.origin", type = "function" }, points = { link = "https://love2d.org/wiki/love.graphics.points", type = "function", variants = { { args = { { name = "x" }, { name = "y" }, { name = "..." } }, description = "Draws one or more points." }, { args = { { name = "points" } }, description = "Draws one or more points." }, { args = { { name = "points" } }, description = "Draws one or more points." } } }, polygon = { link = "https://love2d.org/wiki/love.graphics.polygon", type = "function", variants = { { args = { { name = "mode" }, { name = "..." } }, description = "Draw a polygon.\n\nFollowing the mode argument, this function can accept multiple numeric arguments or a single table of numeric arguments. In either case the arguments are interpreted as alternating x and y coordinates of the polygon's vertices.\n\nWhen in fill mode, the polygon must be convex and simple or rendering artifacts may occur." }, { args = { { name = "mode" }, { name = "vertices" } }, description = "Draw a polygon.\n\nFollowing the mode argument, this function can accept multiple numeric arguments or a single table of numeric arguments. In either case the arguments are interpreted as alternating x and y coordinates of the polygon's vertices.\n\nWhen in fill mode, the polygon must be convex and simple or rendering artifacts may occur." } } }, pop = { args = {}, description = "Pops the current coordinate transformation from the transformation stack.\n\nThis function is always used to reverse a previous push operation. It returns the current transformation state to what it was before the last preceding push. For an example, see the description of love.graphics.push.", link = "https://love2d.org/wiki/love.graphics.pop", type = "function" }, present = { args = {}, description = "Displays the results of drawing operations on the screen.\n\nThis function is used when writing your own love.run function. It presents all the results of your drawing operations on the screen. See the example in love.run for a typical use of this function.", link = "https://love2d.org/wiki/love.graphics.present", type = "function" }, print = { link = "https://love2d.org/wiki/love.graphics.print", type = "function", variants = { { args = { { name = "text" }, { name = "x" }, { name = "y" }, { displayName = "[r]", name = "r" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Draws text on screen. If no Font is set, one will be created and set (once) if needed.\n\nAs of LOVE 0.7.1, when using translation and scaling functions while drawing text, this function assumes the scale occurs first. If you don't script with this in mind, the text won't be in the right position, or possibly even on screen.\n\nlove.graphics.print and love.graphics.printf both suppport UTF-8 encoding. You'll also need a proper Font for special characters." }, { args = { { name = "coloredtext" }, { name = "x" }, { name = "y" }, { displayName = "[angle]", name = "angle" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Draws text on screen. If no Font is set, one will be created and set (once) if needed.\n\nAs of LOVE 0.7.1, when using translation and scaling functions while drawing text, this function assumes the scale occurs first. If you don't script with this in mind, the text won't be in the right position, or possibly even on screen.\n\nlove.graphics.print and love.graphics.printf both suppport UTF-8 encoding. You'll also need a proper Font for special characters." } } }, printf = { link = "https://love2d.org/wiki/love.graphics.printf", type = "function", variants = { { args = { { name = "text" }, { name = "x" }, { name = "y" }, { name = "limit" }, { displayName = "[align]", name = "align" }, { displayName = "[r]", name = "r" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Draws formatted text, with word wrap and alignment.\n\nSee additional notes in love.graphics.print.\n\nIn version 0.9.2 and earlier, wrapping was implemented by breaking up words by spaces and putting them back together to make sure things fit nicely within the limit provided. However, due to the way this is done, extra spaces between words would end up missing when printed on the screen, and some lines could overflow past the provided wrap limit. In version 0.10.0 and newer this is no longer the case." }, { args = { { name = "coloredtext" }, { name = "x" }, { name = "y" }, { name = "wraplimit" }, { name = "align" }, { displayName = "[angle]", name = "angle" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Draws formatted text, with word wrap and alignment.\n\nSee additional notes in love.graphics.print.\n\nIn version 0.9.2 and earlier, wrapping was implemented by breaking up words by spaces and putting them back together to make sure things fit nicely within the limit provided. However, due to the way this is done, extra spaces between words would end up missing when printed on the screen, and some lines could overflow past the provided wrap limit. In version 0.10.0 and newer this is no longer the case." } } }, push = { args = { { displayName = "[stack]", name = "stack" } }, description = "Copies and pushes the current coordinate transformation to the transformation stack.\n\nThis function is always used to prepare for a corresponding pop operation later. It stores the current coordinate transformation state into the transformation stack and keeps it active. Later changes to the transformation can be undone by using the pop operation, which returns the coordinate transform to the state it was in before calling push.", link = "https://love2d.org/wiki/love.graphics.push", type = "function" }, rectangle = { link = "https://love2d.org/wiki/love.graphics.rectangle", type = "function", variants = { { args = { { name = "mode" }, { name = "x" }, { name = "y" }, { name = "width" }, { name = "height" } }, description = "Draws a rectangle." }, { args = { { name = "mode" }, { name = "x" }, { name = "y" }, { name = "width" }, { name = "height" }, { name = "rx" }, { displayName = "[ry]", name = "ry" }, { displayName = "[segments]", name = "segments" } }, description = "Draws a rectangle with rounded corners." } } }, reset = { args = {}, description = "Resets the current graphics settings.\n\nCalling reset makes the current drawing color white, the current background color black, resets any active Canvas or Shader, and removes any scissor settings. It sets the BlendMode to alpha. It also sets both the point and line drawing modes to smooth and their sizes to 1.0.", link = "https://love2d.org/wiki/love.graphics.reset", type = "function" }, rotate = { args = { { name = "angle" } }, description = "Rotates the coordinate system in two dimensions.\n\nCalling this function affects all future drawing operations by rotating the coordinate system around the origin by the given amount of radians. This change lasts until love.draw exits.", link = "https://love2d.org/wiki/love.graphics.rotate", type = "function" }, scale = { args = { { name = "sx" }, { displayName = "[sy]", name = "sy" } }, description = "Scales the coordinate system in two dimensions.\n\nBy default the coordinate system in LÖVE corresponds to the display pixels in horizontal and vertical directions one-to-one, and the x-axis increases towards the right while the y-axis increases downwards. Scaling the coordinate system changes this relation.\n\nAfter scaling by sx and sy, all coordinates are treated as if they were multiplied by sx and sy. Every result of a drawing operation is also correspondingly scaled, so scaling by (2, 2) for example would mean making everything twice as large in both x- and y-directions. Scaling by a negative value flips the coordinate system in the corresponding direction, which also means everything will be drawn flipped or upside down, or both. Scaling by zero is not a useful operation.\n\nScale and translate are not commutative operations, therefore, calling them in different orders will change the outcome.\n\nScaling lasts until love.draw exits.", link = "https://love2d.org/wiki/love.graphics.scale", type = "function" }, setBackgroundColor = { link = "https://love2d.org/wiki/love.graphics.setBackgroundColor", type = "function", variants = { { args = { { name = "r" }, { name = "g" }, { name = "b" }, { displayName = "[a]", name = "a" } }, description = "Sets the background color." }, { args = { { name = "rgba" } }, description = "Sets the background color." } } }, setBlendMode = { link = "https://love2d.org/wiki/love.graphics.setBlendMode", type = "function", variants = { { args = { { name = "mode" } }, description = "Sets the blending mode." }, { args = { { name = "mode" }, { displayName = "[alphamode]", name = "alphamode" } }, description = "Sets the blending mode." } } }, setCanvas = { link = "https://love2d.org/wiki/love.graphics.setCanvas", type = "function", variants = { { args = { { name = "canvas" } }, description = "Sets the render target to a specified Canvas. All drawing operations until the next love.graphics.setCanvas call will be redirected to the Canvas and not shown on the screen." }, { args = {}, description = "Resets the render target to the screen, i.e. re-enables drawing to the screen." }, { args = { { name = "canvas1" }, { name = "canvas2" }, { name = "..." } }, description = "Sets the render target to multiple simultaneous Canvases. All drawing operations until the next love.graphics.setCanvas call will be redirected to the specified canvases and not shown on the screen." } } }, setColor = { link = "https://love2d.org/wiki/love.graphics.setColor", type = "function", variants = { { args = { { name = "red" }, { name = "green" }, { name = "blue" }, { name = "alpha" } }, description = "Sets the color used for drawing." }, { args = { { name = "rgba" } }, description = "Sets the color used for drawing." } } }, setColorMask = { link = "https://love2d.org/wiki/love.graphics.setColorMask", type = "function", variants = { { args = { { name = "red" }, { name = "green" }, { name = "blue" }, { name = "alpha" } }, description = "Enables color masking for the specified color components." }, { args = {}, description = "Disables color masking." } } }, setDefaultFilter = { args = { { name = "min" }, { displayName = "[mag]", name = "mag" }, { displayName = "[anisotropy]", name = "anisotropy" } }, description = "Sets the default scaling filters used with Images, Canvases, and Fonts.\n\nThis function does not apply retroactively to loaded images.", link = "https://love2d.org/wiki/love.graphics.setDefaultFilter", type = "function" }, setFont = { args = { { name = "font" } }, description = "Set an already-loaded Font as the current font or create and load a new one from the file and size.\n\nIt's recommended that Font objects are created with love.graphics.newFont in the loading stage and then passed to this function in the drawing stage.", link = "https://love2d.org/wiki/love.graphics.setFont", type = "function" }, setLineJoin = { args = { { name = "join" } }, description = "Sets the line join style.", link = "https://love2d.org/wiki/love.graphics.setLineJoin", type = "function" }, setLineStyle = { args = { { name = "style" } }, description = "Sets the line style.", link = "https://love2d.org/wiki/love.graphics.setLineStyle", type = "function" }, setLineWidth = { args = { { name = "width" } }, description = "Sets the line width.", link = "https://love2d.org/wiki/love.graphics.setLineWidth", type = "function" }, setNewFont = { link = "https://love2d.org/wiki/love.graphics.setNewFont", returnTypes = { { name = "Font", type = "ref" } }, type = "function", variants = { { args = { { name = "filename" }, { displayName = "[size]", name = "size" } }, description = "Creates and sets a new font." }, { args = { { name = "file" }, { displayName = "[size]", name = "size" } }, description = "Creates and sets a new font." }, { args = { { name = "data" }, { displayName = "[size]", name = "size" } }, description = "Creates and sets a new font." } } }, setPointSize = { args = { { name = "size" } }, description = "Sets the point size.", link = "https://love2d.org/wiki/love.graphics.setPointSize", type = "function" }, setScissor = { link = "https://love2d.org/wiki/love.graphics.setScissor", type = "function", variants = { { args = { { name = "x" }, { name = "y" }, { name = "width" }, { name = "height" } }, description = "Limits the drawing area to a specified rectangle." }, { args = {}, description = "Disables scissor." } } }, setShader = { link = "https://love2d.org/wiki/love.graphics.setShader", type = "function", variants = { { args = {}, description = "Sets or resets a Shader as the current pixel effect or vertex shaders. All drawing operations until the next love.graphics.setShader will be drawn using the Shader object specified.\n\nDisables the shaders when called without arguments." }, { args = { { name = "shader" } }, description = "Sets or resets a Shader as the current pixel effect or vertex shaders. All drawing operations until the next love.graphics.setShader will be drawn using the Shader object specified.\n\nDisables the shaders when called without arguments." } } }, setStencilTest = { link = "https://love2d.org/wiki/love.graphics.setStencilTest", type = "function", variants = { { args = { { name = "comparemode" }, { name = "comparevalue" } }, description = "Configures or disables stencil testing.\n\nWhen stencil testing is enabled, the geometry of everything that is drawn afterward will be clipped / stencilled out based on a comparison between the arguments of this function and the stencil value of each pixel that the geometry touches. The stencil values of pixels are affected via love.graphics.stencil.\n\nEach Canvas has its own per-pixel stencil values." }, { args = {}, description = "Disables stencil testing." } } }, setWireframe = { args = { { name = "enable" } }, description = "Sets whether wireframe lines will be used when drawing.\n\nWireframe mode should only be used for debugging. The lines drawn with it enabled do not behave like regular love.graphics lines: their widths don't scale with the coordinate transformations or with love.graphics.setLineWidth, and they don't use the smooth LineStyle.", link = "https://love2d.org/wiki/love.graphics.setWireframe", type = "function" }, shear = { args = { { name = "kx" }, { name = "ky" } }, description = "Shears the coordinate system.", link = "https://love2d.org/wiki/love.graphics.shear", type = "function" }, stencil = { args = { { name = "stencilfunction" }, { displayName = "[action]", name = "action" }, { displayName = "[value]", name = "value" }, { displayName = "[keepvalues]", name = "keepvalues" } }, description = "Draws geometry as a stencil.\n\nThe geometry drawn by the supplied function sets invisible stencil values of pixels, instead of setting pixel colors. The stencil values of pixels can act like a mask / stencil - love.graphics.setStencilTest can be used afterward to determine how further rendering is affected by the stencil values in each pixel.\n\nEach Canvas has its own per-pixel stencil values. Stencil values are within the range of [0, 255].", link = "https://love2d.org/wiki/love.graphics.stencil", type = "function" }, translate = { args = { { name = "dx" }, { name = "dy" } }, description = "Translates the coordinate system in two dimensions.\n\nWhen this function is called with two numbers, dx, and dy, all the following drawing operations take effect as if their x and y coordinates were x+dx and y+dy.\n\nScale and translate are not commutative operations, therefore, calling them in different orders will change the outcome.\n\nThis change lasts until love.graphics.clear is called (which is called automatically before love.draw in the default love.run function), or a love.graphics.pop reverts to a previous coordinate system state.\n\nTranslating using whole numbers will prevent tearing/blurring of images and fonts draw after translating.", link = "https://love2d.org/wiki/love.graphics.translate", type = "function" } }, link = "https://love2d.org/wiki/love.graphics", type = "table" }, image = { description = "Provides an interface to decode encoded image data.", fields = { isCompressed = { link = "https://love2d.org/wiki/love.image.isCompressed", returnTypes = { { type = "boolean" } }, type = "function", variants = { { args = { { name = "filename" } }, description = "Determines whether a file can be loaded as CompressedImageData." }, { args = { { name = "fileData" } }, description = "Determines whether a file can be loaded as CompressedImageData." } } }, newCompressedData = { link = "https://love2d.org/wiki/love.image.newCompressedData", returnTypes = { { name = "CompressedImageData", type = "ref" } }, type = "function", variants = { { args = { { name = "filename" } }, description = "Create a new CompressedImageData object from a compressed image file. LÖVE supports several compressed texture formats, enumerated in the CompressedImageFormat page." }, { args = { { name = "fileData" } }, description = "Create a new CompressedImageData object from a compressed image file. LÖVE supports several compressed texture formats, enumerated in the CompressedImageFormat page." } } }, newImageData = { link = "https://love2d.org/wiki/love.image.newImageData", returnTypes = { { name = "ImageData", type = "ref" } }, type = "function", variants = { { args = { { name = "width" }, { name = "height" } }, description = "Create a new ImageData object." }, { args = { { name = "width" }, { name = "height" }, { name = "data" } }, description = "Create a new ImageData object." }, { args = { { name = "filename" } }, description = "Create a new ImageData object." }, { args = { { name = "filedata" } }, description = "Create a new ImageData object." } } } }, link = "https://love2d.org/wiki/love.image", type = "table" }, joystick = { description = "Provides an interface to the user's joystick.", fields = { getJoystickCount = { args = {}, description = "Gets the number of connected joysticks.", link = "https://love2d.org/wiki/love.joystick.getJoystickCount", returnTypes = { { type = "number" } }, type = "function" }, getJoysticks = { args = {}, description = "Gets a list of connected Joysticks.", link = "https://love2d.org/wiki/love.joystick.getJoysticks", returnTypes = { { type = "table" } }, type = "function" }, loadGamepadMappings = { link = "https://love2d.org/wiki/love.joystick.loadGamepadMappings", type = "function", variants = { { args = { { name = "filename" } }, description = "Loads a gamepad mappings string or file created with love.joystick.saveGamepadMappings." }, { args = { { name = "mappings" } }, description = "Loads a gamepad mappings string or file created with love.joystick.saveGamepadMappings." } } }, saveGamepadMappings = { link = "https://love2d.org/wiki/love.joystick.saveGamepadMappings", returnTypes = { { type = "string" } }, type = "function", variants = { { args = { { name = "filename" } }, description = "Saves the virtual gamepad mappings of all Joysticks that are recognized as gamepads and have either been recently used or their gamepad bindings have been modified." }, { args = {}, description = "Saves the virtual gamepad mappings of all Joysticks that are recognized as gamepads and have either been recently used or their gamepad bindings have been modified." } } }, setGamepadMapping = { link = "https://love2d.org/wiki/love.joystick.setGamepadMapping", returnTypes = { { type = "boolean" } }, type = "function", variants = { { args = { { name = "guid" }, { name = "button" }, { name = "inputtype" }, { name = "inputindex" }, { name = "hatdirection" } }, description = "Binds a virtual gamepad input to a button, axis or hat for all Joysticks of a certain type. For example, if this function is used with a GUID returned by a Dualshock 3 controller in OS X, the binding will affect Joystick:getGamepadAxis and Joystick:isGamepadDown for all Dualshock 3 controllers used with the game when run in OS X.\n\nLÖVE includes built-in gamepad bindings for many common controllers. This function lets you change the bindings or add new ones for types of Joysticks which aren't recognized as gamepads by default.\n\nThe virtual gamepad buttons and axes are designed around the Xbox 360 controller layout." }, { args = { { name = "guid" }, { name = "axis" }, { name = "inputtype" }, { name = "inputindex" }, { name = "hatdirection" } }, description = "Binds a virtual gamepad input to a button, axis or hat for all Joysticks of a certain type. For example, if this function is used with a GUID returned by a Dualshock 3 controller in OS X, the binding will affect Joystick:getGamepadAxis and Joystick:isGamepadDown for all Dualshock 3 controllers used with the game when run in OS X.\n\nLÖVE includes built-in gamepad bindings for many common controllers. This function lets you change the bindings or add new ones for types of Joysticks which aren't recognized as gamepads by default.\n\nThe virtual gamepad buttons and axes are designed around the Xbox 360 controller layout." } } } }, link = "https://love2d.org/wiki/love.joystick", type = "table" }, joystickadded = { args = { { name = "joystick" } }, description = "Called when a Joystick is connected.\n\nThis callback is also triggered after love.load for every Joystick which was already connected when the game started up.", link = "https://love2d.org/wiki/love.joystickadded", type = "function" }, joystickaxis = { args = { { name = "joystick" }, { name = "axis" }, { name = "value" } }, description = "Called when a joystick axis moves.", link = "https://love2d.org/wiki/love.joystickaxis", type = "function" }, joystickhat = { args = { { name = "joystick" }, { name = "hat" }, { name = "direction" } }, description = "Called when a joystick hat direction changes.", link = "https://love2d.org/wiki/love.joystickhat", type = "function" }, joystickpressed = { args = { { name = "joystick" }, { name = "button" } }, description = "Called when a joystick button is pressed.", link = "https://love2d.org/wiki/love.joystickpressed", type = "function" }, joystickreleased = { args = { { name = "joystick" }, { name = "button" } }, description = "Called when a joystick button is released.", link = "https://love2d.org/wiki/love.joystickreleased", type = "function" }, joystickremoved = { args = { { name = "joystick" } }, description = "Called when a Joystick is disconnected.", link = "https://love2d.org/wiki/love.joystickremoved", type = "function" }, keyboard = { description = "Provides an interface to the user's keyboard.", fields = { getKeyFromScancode = { args = { { name = "scancode" } }, description = "Gets the key corresponding to the given hardware scancode.\n\nUnlike key constants, Scancodes are keyboard layout-independent. For example the scancode \"w\" will be generated if the key in the same place as the \"w\" key on an American keyboard is pressed, no matter what the key is labelled or what the user's operating system settings are.\n\nScancodes are useful for creating default controls that have the same physical locations on on all systems.", link = "https://love2d.org/wiki/love.keyboard.getKeyFromScancode", returnTypes = { { name = "KeyConstant", type = "ref" } }, type = "function" }, getScancodeFromKey = { args = { { name = "key" } }, description = "Gets the hardware scancode corresponding to the given key.\n\nUnlike key constants, Scancodes are keyboard layout-independent. For example the scancode \"w\" will be generated if the key in the same place as the \"w\" key on an American keyboard is pressed, no matter what the key is labelled or what the user's operating system settings are.\n\nScancodes are useful for creating default controls that have the same physical locations on on all systems.", link = "https://love2d.org/wiki/love.keyboard.getScancodeFromKey", returnTypes = { { name = "Scancode", type = "ref" } }, type = "function" }, hasKeyRepeat = { args = {}, description = "Gets whether key repeat is enabled.", link = "https://love2d.org/wiki/love.keyboard.hasKeyRepeat", returnTypes = { { type = "boolean" } }, type = "function" }, hasTextInput = { args = {}, description = "Gets whether text input events are enabled.", link = "https://love2d.org/wiki/love.keyboard.hasTextInput", returnTypes = { { type = "boolean" } }, type = "function" }, isDown = { link = "https://love2d.org/wiki/love.keyboard.isDown", returnTypes = { { type = "boolean" } }, type = "function", variants = { { args = { { name = "key" } }, description = "Checks whether a certain key is down. Not to be confused with love.keypressed or love.keyreleased." }, { args = { { name = "key" }, { name = "..." } }, description = "Checks whether a certain key is down. Not to be confused with love.keypressed or love.keyreleased." } } }, isScancodeDown = { args = { { name = "scancode" }, { name = "..." } }, description = "Checks whether the specified Scancodes are pressed. Not to be confused with love.keypressed or love.keyreleased.\n\nUnlike regular KeyConstants, Scancodes are keyboard layout-independent. The scancode \"w\" is used if the key in the same place as the \"w\" key on an American keyboard is pressed, no matter what the key is labelled or what the user's operating system settings are.", link = "https://love2d.org/wiki/love.keyboard.isScancodeDown", returnTypes = { { type = "boolean" } }, type = "function" }, setKeyRepeat = { args = { { name = "enable" } }, description = "Enables or disables key repeat. It is disabled by default.\n\nThe interval between repeats depends on the user's system settings.", link = "https://love2d.org/wiki/love.keyboard.setKeyRepeat", type = "function" }, setTextInput = { link = "https://love2d.org/wiki/love.keyboard.setTextInput", type = "function", variants = { { args = { { name = "enable" } }, description = "Enables or disables text input events. It is enabled by default on Windows, Mac, and Linux, and disabled by default on iOS and Android." }, { args = { { name = "enable" }, { name = "x" }, { name = "y" }, { name = "w" }, { name = "h" } }, description = "Enables or disables text input events. It is enabled by default on Windows, Mac, and Linux, and disabled by default on iOS and Android." } } } }, link = "https://love2d.org/wiki/love.keyboard", type = "table" }, keypressed = { args = { { name = "key" }, { name = "scancode" }, { name = "isrepeat" } }, description = "Callback function triggered when a key is pressed.", link = "https://love2d.org/wiki/love.keypressed", type = "function" }, keyreleased = { args = { { name = "key" }, { name = "scancode" } }, description = "Callback function triggered when a keyboard key is released.", link = "https://love2d.org/wiki/love.keyreleased", type = "function" }, load = { args = { { name = "arg" } }, description = "This function is called exactly once at the beginning of the game.", link = "https://love2d.org/wiki/love.load", type = "function" }, lowmemory = { args = {}, description = "Callback function triggered when the system is running out of memory on mobile devices.\n\n Mobile operating systems may forcefully kill the game if it uses too much memory, so any non-critical resource should be removed if possible (by setting all variables referencing the resources to nil, and calling collectgarbage()), when this event is triggered. Sounds and images in particular tend to use the most memory.", link = "https://love2d.org/wiki/love.lowmemory", type = "function" }, math = { description = "Provides system-independent mathematical functions.", fields = { compress = { link = "https://love2d.org/wiki/love.math.compress", returnTypes = { { name = "CompressedData", type = "ref" } }, type = "function", variants = { { args = { { name = "rawstring" }, { displayName = "[format]", name = "format" }, { displayName = "[level]", name = "level" } }, description = "Compresses a string or data using a specific compression algorithm." }, { args = { { name = "data" }, { displayName = "[format]", name = "format" }, { displayName = "[level]", name = "level" } }, description = "Compresses a string or data using a specific compression algorithm." } } }, decompress = { link = "https://love2d.org/wiki/love.math.decompress", returnTypes = { { type = "string" } }, type = "function", variants = { { args = { { name = "compressedData" } }, description = "Decompresses a CompressedData or previously compressed string or Data object." }, { args = { { name = "compressedString" }, { name = "format" } }, description = "Decompresses a CompressedData or previously compressed string or Data object." }, { args = { { name = "data" }, { name = "format" } }, description = "Decompresses a CompressedData or previously compressed string or Data object." } } }, gammaToLinear = { link = "https://love2d.org/wiki/love.math.gammaToLinear", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function", variants = { { args = { { name = "r" }, { name = "g" }, { name = "b" } }, description = "Converts a color from gamma-space (sRGB) to linear-space (RGB). This is useful when doing gamma-correct rendering and you need to do math in linear RGB in the few cases where LÖVE doesn't handle conversions automatically." }, { args = { { name = "color" } }, description = "Converts a color from gamma-space (sRGB) to linear-space (RGB). This is useful when doing gamma-correct rendering and you need to do math in linear RGB in the few cases where LÖVE doesn't handle conversions automatically." }, { args = { { name = "c" } }, description = "Converts a color from gamma-space (sRGB) to linear-space (RGB). This is useful when doing gamma-correct rendering and you need to do math in linear RGB in the few cases where LÖVE doesn't handle conversions automatically." } } }, getRandomSeed = { args = {}, description = "Gets the seed of the random number generator.\n\nThe state is split into two numbers due to Lua's use of doubles for all number values - doubles can't accurately represent integer values above 2^53.", link = "https://love2d.org/wiki/love.math.getRandomSeed", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getRandomState = { args = {}, description = "Gets the current state of the random number generator. This returns an opaque implementation-dependent string which is only useful for later use with RandomGenerator:setState.\n\nThis is different from RandomGenerator:getSeed in that getState gets the RandomGenerator's current state, whereas getSeed gets the previously set seed number.\n\nThe value of the state string does not depend on the current operating system.", link = "https://love2d.org/wiki/love.math.getRandomState", returnTypes = { { type = "string" } }, type = "function" }, isConvex = { link = "https://love2d.org/wiki/love.math.isConvex", returnTypes = { { type = "boolean" } }, type = "function", variants = { { args = { { name = "vertices" } }, description = "Checks whether a polygon is convex.\n\nPolygonShapes in love.physics, some forms of Mesh, and polygons drawn with love.graphics.polygon must be simple convex polygons." }, { args = { { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "x3" }, { name = "y3" }, { name = "..." } }, description = "Checks whether a polygon is convex.\n\nPolygonShapes in love.physics, some forms of Mesh, and polygons drawn with love.graphics.polygon must be simple convex polygons." } } }, linearToGamma = { link = "https://love2d.org/wiki/love.math.linearToGamma", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function", variants = { { args = { { name = "lr" }, { name = "lg" }, { name = "lb" } }, description = "Converts a color from linear-space (RGB) to gamma-space (sRGB). This is useful when storing linear RGB color values in an image, because the linear RGB color space has less precision than sRGB for dark colors, which can result in noticeable color banding when drawing.\n\nIn general, colors chosen based on what they look like on-screen are already in gamma-space and should not be double-converted. Colors calculated using math are often in the linear RGB space." }, { args = { { name = "color" } }, description = "Converts a color from linear-space (RGB) to gamma-space (sRGB). This is useful when storing linear RGB color values in an image, because the linear RGB color space has less precision than sRGB for dark colors, which can result in noticeable color banding when drawing.\n\nIn general, colors chosen based on what they look like on-screen are already in gamma-space and should not be double-converted. Colors calculated using math are often in the linear RGB space." }, { args = { { name = "lc" } }, description = "Converts a color from linear-space (RGB) to gamma-space (sRGB). This is useful when storing linear RGB color values in an image, because the linear RGB color space has less precision than sRGB for dark colors, which can result in noticeable color banding when drawing.\n\nIn general, colors chosen based on what they look like on-screen are already in gamma-space and should not be double-converted. Colors calculated using math are often in the linear RGB space." } } }, newBezierCurve = { link = "https://love2d.org/wiki/love.math.newBezierCurve", returnTypes = { { name = "BezierCurve", type = "ref" } }, type = "function", variants = { { args = { { name = "vertices" } }, description = "Creates a new BezierCurve object.\n\nThe number of vertices in the control polygon determines the degree of the curve, e.g. three vertices define a quadratic (degree 2) Bézier curve, four vertices define a cubic (degree 3) Bézier curve, etc." }, { args = { { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "x3" }, { name = "y3" }, { name = "..." } }, description = "Creates a new BezierCurve object.\n\nThe number of vertices in the control polygon determines the degree of the curve, e.g. three vertices define a quadratic (degree 2) Bézier curve, four vertices define a cubic (degree 3) Bézier curve, etc." } } }, newRandomGenerator = { link = "https://love2d.org/wiki/love.math.newRandomGenerator", returnTypes = { { name = "RandomGenerator", type = "ref" } }, type = "function", variants = { { args = {}, description = "Creates a new RandomGenerator object which is completely independent of other RandomGenerator objects and random functions." }, { args = { { name = "seed" } }, description = "Creates a new RandomGenerator object which is completely independent of other RandomGenerator objects and random functions." }, { args = { { name = "low" }, { name = "high" } }, description = "Creates a new RandomGenerator object which is completely independent of other RandomGenerator objects and random functions." } } }, noise = { link = "https://love2d.org/wiki/love.math.noise", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "x" } }, description = "Generates Simplex noise from 1 dimension." }, { args = { { name = "x" }, { name = "y" } }, description = "Generates Simplex noise from 2 dimensions." }, { args = { { name = "x" }, { name = "y" }, { name = "z" } }, description = "Generates Perlin noise (Simplex noise in version 0.9.2 and older) from 3 dimensions." }, { args = { { name = "x" }, { name = "y" }, { name = "z" }, { name = "w" } }, description = "Generates Perlin noise (Simplex noise in version 0.9.2 and older) from 4 dimensions." } } }, random = { link = "https://love2d.org/wiki/love.math.random", returnTypes = { { type = "number" } }, type = "function", variants = { { args = {}, description = "Get uniformly distributed pseudo-random real number within [0, 1]." }, { args = { { name = "max" } }, description = "Get a uniformly distributed pseudo-random integer within [1, max]." }, { args = { { name = "min" }, { name = "max" } }, description = "Get uniformly distributed pseudo-random integer within [min, max]." } } }, randomNormal = { args = { { displayName = "[stddev]", name = "stddev" }, { displayName = "[mean]", name = "mean" } }, description = "Get a normally distributed pseudo random number.", link = "https://love2d.org/wiki/love.math.randomNormal", returnTypes = { { type = "number" } }, type = "function" }, setRandomSeed = { link = "https://love2d.org/wiki/love.math.setRandomSeed", type = "function", variants = { { args = { { name = "seed" } }, description = "Sets the seed of the random number generator using the specified integer number." }, { args = { { name = "low" }, { name = "high" } }, description = "Sets the seed of the random number generator using the specified integer number." } } }, setRandomState = { args = { { name = "state" } }, description = "Gets the current state of the random number generator. This returns an opaque implementation-dependent string which is only useful for later use with RandomGenerator:setState.\n\nThis is different from RandomGenerator:getSeed in that getState gets the RandomGenerator's current state, whereas getSeed gets the previously set seed number.\n\nThe value of the state string does not depend on the current operating system.", link = "https://love2d.org/wiki/love.math.setRandomState", type = "function" }, triangulate = { link = "https://love2d.org/wiki/love.math.triangulate", returnTypes = { { type = "table" } }, type = "function", variants = { { args = { { name = "polygon" } }, description = "Triangulate a simple polygon." }, { args = { { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "x3" }, { name = "y3" }, { name = "..." } }, description = "Triangulate a simple polygon." } } } }, link = "https://love2d.org/wiki/love.math", type = "table" }, mouse = { description = "Provides an interface to the user's mouse.", fields = { getCursor = { args = {}, description = "Gets the current Cursor.", link = "https://love2d.org/wiki/love.mouse.getCursor", returnTypes = { { name = "Cursor", type = "ref" } }, type = "function" }, getPosition = { args = {}, description = "Returns the current position of the mouse.", link = "https://love2d.org/wiki/love.mouse.getPosition", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getRelativeMode = { args = {}, description = "Gets whether relative mode is enabled for the mouse.\n\nIf relative mode is enabled, the cursor is hidden and doesn't move when the mouse does, but relative mouse motion events are still generated via love.mousemoved. This lets the mouse move in any direction indefinitely without the cursor getting stuck at the edges of the screen.\n\nThe reported position of the mouse is not updated while relative mode is enabled, even when relative mouse motion events are generated.", link = "https://love2d.org/wiki/love.mouse.getRelativeMode", returnTypes = { { type = "boolean" } }, type = "function" }, getSystemCursor = { args = { { name = "ctype" } }, description = "Gets a Cursor object representing a system-native hardware cursor.\n\n Hardware cursors are framerate-independent and work the same way as normal operating system cursors. Unlike drawing an image at the mouse's current coordinates, hardware cursors never have visible lag between when the mouse is moved and when the cursor position updates, even at low framerates.", link = "https://love2d.org/wiki/love.mouse.getSystemCursor", returnTypes = { { name = "Cursor", type = "ref" } }, type = "function" }, getX = { args = {}, description = "Returns the current x position of the mouse.", link = "https://love2d.org/wiki/love.mouse.getX", returnTypes = { { type = "number" } }, type = "function" }, getY = { args = {}, description = "Returns the current y position of the mouse.", link = "https://love2d.org/wiki/love.mouse.getY", returnTypes = { { type = "number" } }, type = "function" }, hasCursor = { args = {}, description = "Gets whether cursor functionality is supported.\n\nIf it isn't supported, calling love.mouse.newCursor and love.mouse.getSystemCursor will cause an error. Mobile devices do not support cursors.", link = "https://love2d.org/wiki/love.mouse.hasCursor", returnTypes = { { type = "boolean" } }, type = "function" }, isDown = { args = { { name = "button" }, { name = "..." } }, description = "Checks whether a certain mouse button is down. This function does not detect mousewheel scrolling; you must use the love.wheelmoved (or love.mousepressed in version 0.9.2 and older) callback for that.", link = "https://love2d.org/wiki/love.mouse.isDown", returnTypes = { { type = "boolean" } }, type = "function" }, isGrabbed = { args = {}, description = "Checks if the mouse is grabbed.", link = "https://love2d.org/wiki/love.mouse.isGrabbed", returnTypes = { { type = "boolean" } }, type = "function" }, isVisible = { args = {}, description = "Checks if the cursor is visible.", link = "https://love2d.org/wiki/love.mouse.isVisible", returnTypes = { { type = "boolean" } }, type = "function" }, newCursor = { link = "https://love2d.org/wiki/love.mouse.newCursor", returnTypes = { { name = "Cursor", type = "ref" } }, type = "function", variants = { { args = { { name = "imageData" }, { displayName = "[hotx]", name = "hotx" }, { displayName = "[hoty]", name = "hoty" } }, description = "Creates a new hardware Cursor object from an image file or ImageData.\n\nHardware cursors are framerate-independent and work the same way as normal operating system cursors. Unlike drawing an image at the mouse's current coordinates, hardware cursors never have visible lag between when the mouse is moved and when the cursor position updates, even at low framerates.\n\nThe hot spot is the point the operating system uses to determine what was clicked and at what position the mouse cursor is. For example, the normal arrow pointer normally has its hot spot at the top left of the image, but a crosshair cursor might have it in the middle." }, { args = { { name = "filepath" }, { displayName = "[hotx]", name = "hotx" }, { displayName = "[hoty]", name = "hoty" } }, description = "Creates a new hardware Cursor object from an image file or ImageData.\n\nHardware cursors are framerate-independent and work the same way as normal operating system cursors. Unlike drawing an image at the mouse's current coordinates, hardware cursors never have visible lag between when the mouse is moved and when the cursor position updates, even at low framerates.\n\nThe hot spot is the point the operating system uses to determine what was clicked and at what position the mouse cursor is. For example, the normal arrow pointer normally has its hot spot at the top left of the image, but a crosshair cursor might have it in the middle." }, { args = { { name = "fileData" }, { displayName = "[hotx]", name = "hotx" }, { displayName = "[hoty]", name = "hoty" } }, description = "Creates a new hardware Cursor object from an image file or ImageData.\n\nHardware cursors are framerate-independent and work the same way as normal operating system cursors. Unlike drawing an image at the mouse's current coordinates, hardware cursors never have visible lag between when the mouse is moved and when the cursor position updates, even at low framerates.\n\nThe hot spot is the point the operating system uses to determine what was clicked and at what position the mouse cursor is. For example, the normal arrow pointer normally has its hot spot at the top left of the image, but a crosshair cursor might have it in the middle." } } }, setCursor = { link = "https://love2d.org/wiki/love.mouse.setCursor", type = "function", variants = { { args = {}, description = "Sets the current mouse cursor.\n\nResets the current mouse cursor to the default when called without arguments." }, { args = { { name = "cursor" } }, description = "Sets the current mouse cursor.\n\nResets the current mouse cursor to the default when called without arguments." } } }, setGrabbed = { args = { { name = "grab" } }, description = "Grabs the mouse and confines it to the window.", link = "https://love2d.org/wiki/love.mouse.setGrabbed", type = "function" }, setPosition = { args = { { name = "x" }, { name = "y" } }, description = "Sets the current position of the mouse. Non-integer values are floored.", link = "https://love2d.org/wiki/love.mouse.setPosition", type = "function" }, setRelativeMode = { args = { { name = "enable" } }, description = "Sets whether relative mode is enabled for the mouse.\n\nWhen relative mode is enabled, the cursor is hidden and doesn't move when the mouse does, but relative mouse motion events are still generated via love.mousemoved. This lets the mouse move in any direction indefinitely without the cursor getting stuck at the edges of the screen.\n\nThe reported position of the mouse is not updated while relative mode is enabled, even when relative mouse motion events are generated.", link = "https://love2d.org/wiki/love.mouse.setRelativeMode", type = "function" }, setVisible = { args = { { name = "visible" } }, description = "Sets the visibility of the cursor.", link = "https://love2d.org/wiki/love.mouse.setVisible", type = "function" }, setX = { args = { { name = "x" } }, description = "Sets the current X position of the mouse. Non-integer values are floored.", link = "https://love2d.org/wiki/love.mouse.setX", type = "function" }, setY = { args = { { name = "y" } }, description = "Sets the current Y position of the mouse. Non-integer values are floored.", link = "https://love2d.org/wiki/love.mouse.setY", type = "function" } }, link = "https://love2d.org/wiki/love.mouse", type = "table" }, mousefocus = { args = { { name = "focus" } }, description = "Callback function triggered when window receives or loses mouse focus.", link = "https://love2d.org/wiki/love.mousefocus", type = "function" }, mousemoved = { args = { { name = "x" }, { name = "y" }, { name = "dx" }, { name = "dy" }, { name = "istouch" } }, description = "Callback function triggered when the mouse is moved.", link = "https://love2d.org/wiki/love.mousemoved", type = "function" }, mousepressed = { args = { { name = "x" }, { name = "y" }, { name = "button" }, { name = "isTouch" } }, description = "Callback function triggered when a mouse button is pressed.", link = "https://love2d.org/wiki/love.mousepressed", type = "function" }, mousereleased = { args = { { name = "x" }, { name = "y" }, { name = "button" }, { name = "isTouch" } }, description = "Callback function triggered when a mouse button is released.", link = "https://love2d.org/wiki/love.mousereleased", type = "function" }, physics = { description = "Can simulate 2D rigid body physics in a realistic manner. This module is based on Box2D, and this API corresponds to the Box2D API as closely as possible.", fields = { getDistance = { args = { { name = "fixture1" }, { name = "fixture2" } }, description = "Returns the two closest points between two fixtures and their distance.", link = "https://love2d.org/wiki/love.physics.getDistance", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getMeter = { args = {}, description = "Get the scale of the world.\n\nThe world scale is the number of pixels per meter. Try to keep your shape sizes less than 10 times this scale.\n\nThis is important because the physics in Box2D is tuned to work well for objects of size 0.1m up to 10m. All physics coordinates are divided by this number for the physics calculations.", link = "https://love2d.org/wiki/love.physics.getMeter", returnTypes = { { type = "number" } }, type = "function" }, newBody = { args = { { name = "world" }, { displayName = "[x]", name = "x" }, { displayName = "[y]", name = "y" }, { displayName = "[type]", name = "type" } }, description = "Creates a new body.\n\nThere are three types of bodies. Static bodies do not move, have a infinite mass, and can be used for level boundaries. Dynamic bodies are the main actors in the simulation, they collide with everything. Kinematic bodies do not react to forces and only collide with dynamic bodies.\n\nThe mass of the body gets calculated when a Fixture is attached or removed, but can be changed at any time with Body:setMass or Body:resetMassData.", link = "https://love2d.org/wiki/love.physics.newBody", returnTypes = { { name = "Body", type = "ref" } }, type = "function" }, newChainShape = { link = "https://love2d.org/wiki/love.physics.newChainShape", returnTypes = { { name = "ChainShape", type = "ref" } }, type = "function", variants = { { args = { { name = "loop" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "..." } }, description = "Creates a new ChainShape." }, { args = { { name = "loop" }, { name = "points" } }, description = "Creates a new ChainShape." } } }, newCircleShape = { link = "https://love2d.org/wiki/love.physics.newCircleShape", returnTypes = { { name = "CircleShape", type = "ref" } }, type = "function", variants = { { args = { { name = "radius" } }, description = "Creates a new CircleShape." }, { args = { { name = "x" }, { name = "y" }, { name = "radius" } }, description = "Creates a new CircleShape." } } }, newDistanceJoint = { args = { { name = "body1" }, { name = "body2" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Create a distance joint between two bodies.\n\nThis joint constrains the distance between two points on two bodies to be constant. These two points are specified in world coordinates and the two bodies are assumed to be in place when this joint is created. The first anchor point is connected to the first body and the second to the second body, and the points define the length of the distance joint.", link = "https://love2d.org/wiki/love.physics.newDistanceJoint", returnTypes = { { name = "DistanceJoint", type = "ref" } }, type = "function" }, newEdgeShape = { args = { { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" } }, description = "Creates a edge shape.", link = "https://love2d.org/wiki/love.physics.newEdgeShape", returnTypes = { { name = "EdgeShape", type = "ref" } }, type = "function" }, newFixture = { args = { { name = "body" }, { name = "shape" }, { displayName = "[density]", name = "density" } }, description = "Creates and attaches a Fixture to a body.", link = "https://love2d.org/wiki/love.physics.newFixture", returnTypes = { { name = "Fixture", type = "ref" } }, type = "function" }, newFrictionJoint = { args = { { name = "body1" }, { name = "body2" }, { name = "x" }, { name = "y" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Create a friction joint between two bodies. A FrictionJoint applies friction to a body.", link = "https://love2d.org/wiki/love.physics.newFrictionJoint", returnTypes = { { name = "FrictionJoint", type = "ref" } }, type = "function" }, newGearJoint = { args = { { name = "joint1" }, { name = "joint2" }, { displayName = "[ratio]", name = "ratio" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Create a gear joint connecting two joints.\n\nThe gear joint connects two joints that must be either prismatic or revolute joints. Using this joint requires that the joints it uses connect their respective bodies to the ground and have the ground as the first body. When destroying the bodies and joints you must make sure you destroy the gear joint before the other joints.\n\nThe gear joint has a ratio the determines how the angular or distance values of the connected joints relate to each other. The formula coordinate1 + ratio * coordinate2 always has a constant value that is set when the gear joint is created.", link = "https://love2d.org/wiki/love.physics.newGearJoint", returnTypes = { { name = "GearJoint", type = "ref" } }, type = "function" }, newMotorJoint = { link = "https://love2d.org/wiki/love.physics.newMotorJoint", returnTypes = { { name = "MotorJoint", type = "ref" } }, type = "function", variants = { { args = { { name = "body1" }, { name = "body2" }, { displayName = "[correctionFactor]", name = "correctionFactor" } }, description = "Creates a joint between two bodies which controls the relative motion between them.\n\nPosition and rotation offsets can be specified once the MotorJoint has been created, as well as the maximum motor force and torque that will be be applied to reach the target offsets." }, { args = { { name = "body1" }, { name = "body2" }, { displayName = "[correctionFactor]", name = "correctionFactor" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Creates a joint between two bodies which controls the relative motion between them.\n\nPosition and rotation offsets can be specified once the MotorJoint has been created, as well as the maximum motor force and torque that will be be applied to reach the target offsets." } } }, newMouseJoint = { args = { { name = "body" }, { name = "x" }, { name = "y" } }, description = "Create a joint between a body and the mouse.\n\nThis joint actually connects the body to a fixed point in the world. To make it follow the mouse, the fixed point must be updated every timestep (example below).\n\nThe advantage of using a MouseJoint instead of just changing a body position directly is that collisions and reactions to other joints are handled by the physics engine.", link = "https://love2d.org/wiki/love.physics.newMouseJoint", returnTypes = { { name = "MouseJoint", type = "ref" } }, type = "function" }, newPolygonShape = { link = "https://love2d.org/wiki/love.physics.newPolygonShape", returnTypes = { { name = "PolygonShape", type = "ref" } }, type = "function", variants = { { args = { { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "..." } }, description = "Creates a new PolygonShape.\n\nThis shape can have 8 vertices at most, and must form a convex shape." }, { args = { { name = "vertices" } }, description = "Creates a new PolygonShape.\n\nThis shape can have 8 vertices at most, and must form a convex shape." } } }, newPrismaticJoint = { link = "https://love2d.org/wiki/love.physics.newPrismaticJoint", returnTypes = { { name = "PrismaticJoint", type = "ref" } }, type = "function", variants = { { args = { { name = "body1" }, { name = "body2" }, { name = "x" }, { name = "y" }, { name = "ax" }, { name = "ay" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Create a prismatic joints between two bodies.\n\nA prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a revolute joint, but with translation and force substituted for angle and torque." }, { args = { { name = "body1" }, { name = "body2" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "ax" }, { name = "ay" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Create a prismatic joints between two bodies.\n\nA prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a revolute joint, but with translation and force substituted for angle and torque." }, { args = { { name = "body1" }, { name = "body2" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "ax" }, { name = "ay" }, { displayName = "[collideConnected]", name = "collideConnected" }, { displayName = "[referenceAngle]", name = "referenceAngle" } }, description = "Create a prismatic joints between two bodies.\n\nA prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a revolute joint, but with translation and force substituted for angle and torque." } } }, newPulleyJoint = { args = { { name = "body1" }, { name = "body2" }, { name = "gx1" }, { name = "gy1" }, { name = "gx2" }, { name = "gy2" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { displayName = "[ratio]", name = "ratio" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Create a pulley joint to join two bodies to each other and the ground.\n\nThe pulley joint simulates a pulley with an optional block and tackle. If the ratio parameter has a value different from one, then the simulated rope extends faster on one side than the other. In a pulley joint the total length of the simulated rope is the constant length1 + ratio * length2, which is set when the pulley joint is created.\n\nPulley joints can behave unpredictably if one side is fully extended. It is recommended that the method setMaxLengths be used to constrain the maximum lengths each side can attain.", link = "https://love2d.org/wiki/love.physics.newPulleyJoint", returnTypes = { { name = "PulleyJoint", type = "ref" } }, type = "function" }, newRectangleShape = { link = "https://love2d.org/wiki/love.physics.newRectangleShape", returnTypes = { { name = "PolygonShape", type = "ref" } }, type = "function", variants = { { args = { { name = "width" }, { name = "height" } }, description = "Shorthand for creating rectangular PolygonShapes.\n\nBy default, the local origin is located at the center of the rectangle as opposed to the top left for graphics." }, { args = { { name = "x" }, { name = "y" }, { name = "width" }, { name = "height" }, { displayName = "[angle]", name = "angle" } }, description = "Shorthand for creating rectangular PolygonShapes.\n\nBy default, the local origin is located at the center of the rectangle as opposed to the top left for graphics." } } }, newRevoluteJoint = { link = "https://love2d.org/wiki/love.physics.newRevoluteJoint", returnTypes = { { name = "RevoluteJoint", type = "ref" } }, type = "function", variants = { { args = { { name = "body1" }, { name = "body2" }, { name = "x" }, { name = "y" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Creates a pivot joint between two bodies.\n\nThis joint connects two bodies to a point around which they can pivot." }, { args = { { name = "body1" }, { name = "body2" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { displayName = "[collideConnected]", name = "collideConnected" }, { displayName = "[referenceAngle]", name = "referenceAngle" } }, description = "Creates a pivot joint between two bodies.\n\nThis joint connects two bodies to a point around which they can pivot." } } }, newRopeJoint = { args = { { name = "body1" }, { name = "body2" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "maxLength" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Create a joint between two bodies. Its only function is enforcing a max distance between these bodies.", link = "https://love2d.org/wiki/love.physics.newRopeJoint", returnTypes = { { name = "RopeJoint", type = "ref" } }, type = "function" }, newWeldJoint = { link = "https://love2d.org/wiki/love.physics.newWeldJoint", returnTypes = { { name = "WeldJoint", type = "ref" } }, type = "function", variants = { { args = { { name = "body1" }, { name = "body2" }, { name = "x" }, { name = "y" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Creates a constraint joint between two bodies. A WeldJoint essentially glues two bodies together. The constraint is a bit soft, however, due to Box2D's iterative solver." }, { args = { { name = "body1" }, { name = "body2" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Creates a constraint joint between two bodies. A WeldJoint essentially glues two bodies together. The constraint is a bit soft, however, due to Box2D's iterative solver." }, { args = { { name = "body1" }, { name = "body2" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { displayName = "[collideConnected]", name = "collideConnected" }, { displayName = "[referenceAngle]", name = "referenceAngle" } }, description = "Creates a constraint joint between two bodies. A WeldJoint essentially glues two bodies together. The constraint is a bit soft, however, due to Box2D's iterative solver." } } }, newWheelJoint = { args = { { name = "body1" }, { name = "body2" }, { name = "x" }, { name = "y" }, { name = "ax" }, { name = "ay" }, { displayName = "[collideConnected]", name = "collideConnected" } }, description = "Creates a wheel joint.", link = "https://love2d.org/wiki/love.physics.newWheelJoint", returnTypes = { { name = "WheelJoint", type = "ref" } }, type = "function" }, newWorld = { args = { { displayName = "[xg]", name = "xg" }, { displayName = "[yg]", name = "yg" }, { displayName = "[sleep]", name = "sleep" } }, description = "Creates a new World.", link = "https://love2d.org/wiki/love.physics.newWorld", returnTypes = { { name = "World", type = "ref" } }, type = "function" }, setMeter = { args = { { name = "scale" } }, description = "Sets the pixels to meter scale factor.\n\nAll coordinates in the physics module are divided by this number and converted to meters, and it creates a convenient way to draw the objects directly to the screen without the need for graphics transformations.\n\nIt is recommended to create shapes no larger than 10 times the scale. This is important because Box2D is tuned to work well with shape sizes from 0.1 to 10 meters. The default meter scale is 30.\n\nlove.physics.setMeter does not apply retroactively to created objects. Created objects retain their meter coordinates but the scale factor will affect their pixel coordinates.", link = "https://love2d.org/wiki/love.physics.setMeter", type = "function" } }, link = "https://love2d.org/wiki/love.physics", type = "table" }, quit = { args = {}, description = "Callback function triggered when the game is closed.", link = "https://love2d.org/wiki/love.quit", returnTypes = { { type = "boolean" } }, type = "function" }, resize = { args = { { name = "w" }, { name = "h" } }, description = "Called when the window is resized, for example if the user resizes the window, or if love.window.setMode is called with an unsupported width or height in fullscreen and the window chooses the closest appropriate size.\n\nCalls to love.window.setMode will only trigger this event if the width or height of the window after the call doesn't match the requested width and height. This can happen if a fullscreen mode is requested which doesn't match any supported mode, or if the fullscreen type is 'desktop' and the requested width or height don't match the desktop resolution.", link = "https://love2d.org/wiki/love.resize", type = "function" }, run = { args = {}, description = "The main function, containing the main loop. A sensible default is used when left out.", link = "https://love2d.org/wiki/love.run", type = "function" }, sound = { description = "This module is responsible for decoding sound files. It can't play the sounds, see love.audio for that.", fields = { newDecoder = { link = "https://love2d.org/wiki/love.sound.newDecoder", returnTypes = { { name = "Decoder", type = "ref" } }, type = "function", variants = { { args = { { name = "file" }, { displayName = "[buffer]", name = "buffer" } }, description = "Attempts to find a decoder for the encoded sound data in the specified file." }, { args = { { name = "filename" }, { displayName = "[buffer]", name = "buffer" } }, description = "Attempts to find a decoder for the encoded sound data in the specified file." } } }, newSoundData = { link = "https://love2d.org/wiki/love.sound.newSoundData", returnTypes = { { name = "SoundData", type = "ref" } }, type = "function", variants = { { args = { { name = "filename" } }, description = "Creates new SoundData from a file. It's also possible to create SoundData with a custom sample rate, channel and bit depth.\n\nThe sound data will be decoded to the memory in a raw format. It is recommended to create only short sounds like effects, as a 3 minute song uses 30 MB of memory this way." }, { args = { { name = "file" } }, description = "Creates new SoundData from a file. It's also possible to create SoundData with a custom sample rate, channel and bit depth.\n\nThe sound data will be decoded to the memory in a raw format. It is recommended to create only short sounds like effects, as a 3 minute song uses 30 MB of memory this way." }, { args = { { name = "data" } }, description = "Creates new SoundData from a file. It's also possible to create SoundData with a custom sample rate, channel and bit depth.\n\nThe sound data will be decoded to the memory in a raw format. It is recommended to create only short sounds like effects, as a 3 minute song uses 30 MB of memory this way." }, { args = { { name = "samples" }, { displayName = "[rate]", name = "rate" }, { displayName = "[bits]", name = "bits" }, { displayName = "[channels]", name = "channels" } }, description = "Creates new SoundData from a file. It's also possible to create SoundData with a custom sample rate, channel and bit depth.\n\nThe sound data will be decoded to the memory in a raw format. It is recommended to create only short sounds like effects, as a 3 minute song uses 30 MB of memory this way." } } } }, link = "https://love2d.org/wiki/love.sound", type = "table" }, system = { description = "Provides access to information about the user's system.", fields = { getClipboardText = { args = {}, description = "Gets text from the clipboard.", link = "https://love2d.org/wiki/love.system.getClipboardText", returnTypes = { { type = "string" } }, type = "function" }, getOS = { args = {}, description = "Gets the current operating system. In general, LÖVE abstracts away the need to know the current operating system, but there are a few cases where it can be useful (especially in combination with os.execute.)", link = "https://love2d.org/wiki/love.system.getOS", returnTypes = { { type = "string" } }, type = "function" }, getPowerInfo = { args = {}, description = "Gets information about the system's power supply.", link = "https://love2d.org/wiki/love.system.getPowerInfo", returnTypes = { { name = "PowerState", type = "ref" }, { type = "number" }, { type = "number" } }, type = "function" }, getProcessorCount = { args = {}, description = "Gets the number of CPU cores in the system.\n\nThe number includes the threads reported if technologies such as Intel's Hyper-threading are enabled. For example, on a 4-core CPU with Hyper-threading, this function will return 8.", link = "https://love2d.org/wiki/love.system.getProcessorCount", returnTypes = { { type = "number" } }, type = "function" }, openURL = { args = { { name = "url" } }, description = "Opens a URL with the user's web or file browser.", link = "https://love2d.org/wiki/love.system.openURL", returnTypes = { { type = "boolean" } }, type = "function" }, setClipboardText = { args = { { name = "text" } }, description = "Puts text in the clipboard.", link = "https://love2d.org/wiki/love.system.setClipboardText", type = "function" }, vibrate = { args = { { displayName = "[seconds]", name = "seconds" } }, description = "Causes the device to vibrate, if possible. Currently this will only work on Android and iOS devices that have a built-in vibration motor.", link = "https://love2d.org/wiki/love.system.vibrate", type = "function" } }, link = "https://love2d.org/wiki/love.system", type = "table" }, textedited = { args = { { name = "text" }, { name = "start" }, { name = "length" } }, description = "Called when the candidate text for an IME (Input Method Editor) has changed.\n\nThe candidate text is not the final text that the user will eventually choose. Use love.textinput for that.", link = "https://love2d.org/wiki/love.textedited", type = "function" }, textinput = { args = { { name = "text" } }, description = "Called when text has been entered by the user. For example if shift-2 is pressed on an American keyboard layout, the text \"@\" will be generated.", link = "https://love2d.org/wiki/love.textinput", type = "function" }, thread = { description = "Allows you to work with threads.\n\nThreads are separate Lua environments, running in parallel to the main code. As their code runs separately, they can be used to compute complex operations without adversely affecting the frame rate of the main thread. However, as they are separate environments, they cannot access the variables and functions of the main thread, and communication between threads is limited.\n\nAll LOVE objects (userdata) are shared among threads so you'll only have to send their references across threads. You may run into concurrency issues if you manipulate an object on multiple threads at the same time.\n\nWhen a Thread is started, it only loads the love.thread module. Every other module has to be loaded with require.", fields = { getChannel = { args = { { name = "name" } }, description = "Creates or retrieves a named thread channel.", link = "https://love2d.org/wiki/love.thread.getChannel", returnTypes = { { name = "Channel", type = "ref" } }, type = "function" }, newChannel = { args = {}, description = "Create a new unnamed thread channel.\n\nOne use for them is to pass new unnamed channels to other threads via Channel:push", link = "https://love2d.org/wiki/love.thread.newChannel", returnTypes = { { name = "Channel", type = "ref" } }, type = "function" }, newThread = { link = "https://love2d.org/wiki/love.thread.newThread", returnTypes = { { name = "Thread", type = "ref" } }, type = "function", variants = { { args = { { name = "filename" } }, description = "Creates a new Thread from a File or Data object." }, { args = { { name = "fileData" } }, description = "Creates a new Thread from a File or Data object." }, { args = { { name = "codestring" } }, description = "Creates a new Thread from a File or Data object." } } } }, link = "https://love2d.org/wiki/love.thread", type = "table" }, threaderror = { args = { { name = "thread" }, { name = "errorstr" } }, description = "Callback function triggered when a Thread encounters an error.", link = "https://love2d.org/wiki/love.threaderror", type = "function" }, timer = { description = "Provides an interface to the user's clock.", fields = { getAverageDelta = { args = {}, description = "Returns the average delta time (seconds per frame) over the last second.", link = "https://love2d.org/wiki/love.timer.getAverageDelta", returnTypes = { { type = "number" } }, type = "function" }, getDelta = { args = {}, description = "Returns the time between the last two frames.", link = "https://love2d.org/wiki/love.timer.getDelta", returnTypes = { { type = "number" } }, type = "function" }, getFPS = { args = {}, description = "Returns the current frames per second.", link = "https://love2d.org/wiki/love.timer.getFPS", returnTypes = { { type = "number" } }, type = "function" }, getTime = { args = {}, description = "Returns the value of a timer with an unspecified starting time. This function should only be used to calculate differences between points in time, as the starting time of the timer is unknown.", link = "https://love2d.org/wiki/love.timer.getTime", returnTypes = { { type = "number" } }, type = "function" }, sleep = { args = { { name = "s" } }, description = "Sleeps the program for the specified amount of time.", link = "https://love2d.org/wiki/love.timer.sleep", type = "function" }, step = { args = {}, description = "Measures the time between two frames. Calling this changes the return value of love.timer.getDelta.", link = "https://love2d.org/wiki/love.timer.step", type = "function" } }, link = "https://love2d.org/wiki/love.timer", type = "table" }, touch = { description = "Provides an interface to touch-screen presses.", fields = { getPosition = { args = { { name = "id" } }, description = "Gets the current position of the specified touch-press, in pixels.", link = "https://love2d.org/wiki/love.touch.getPosition", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getPressure = { args = { { name = "id" } }, description = "Gets the current pressure of the specified touch-press.", link = "https://love2d.org/wiki/love.touch.getPressure", returnTypes = { { type = "number" } }, type = "function" }, getTouches = { args = {}, description = "Gets a list of all active touch-presses.", link = "https://love2d.org/wiki/love.touch.getTouches", returnTypes = { { type = "table" } }, type = "function" } }, link = "https://love2d.org/wiki/love.touch", type = "table" }, touchmoved = { args = { { name = "id" }, { name = "x" }, { name = "y" }, { name = "dx" }, { name = "dy" }, { name = "pressure" } }, description = "Callback function triggered when a touch press moves inside the touch screen.", link = "https://love2d.org/wiki/love.touchmoved", type = "function" }, touchpressed = { args = { { name = "id" }, { name = "x" }, { name = "y" }, { name = "dx" }, { name = "dy" }, { name = "pressure" } }, description = "Callback function triggered when the touch screen is touched.", link = "https://love2d.org/wiki/love.touchpressed", type = "function" }, touchreleased = { args = { { name = "id" }, { name = "x" }, { name = "y" }, { name = "dx" }, { name = "dy" }, { name = "pressure" } }, description = "Callback function triggered when the touch screen stops being touched.", link = "https://love2d.org/wiki/love.touchreleased", type = "function" }, update = { args = { { name = "dt" } }, description = "Callback function used to update the state of the game every frame.", link = "https://love2d.org/wiki/love.update", type = "function" }, video = { description = "This module is responsible for decoding, controlling, and streaming video files.\n\nIt can't draw the videos, see love.graphics.newVideo and Video objects for that.", fields = { newVideoStream = { link = "https://love2d.org/wiki/love.video.newVideoStream", returnTypes = { { name = "VideoStream", type = "ref" } }, type = "function", variants = { { args = { { name = "filename" } }, description = "Creates a new VideoStream. Currently only Ogg Theora video files are supported. VideoStreams can't draw videos, see love.graphics.newVideo for that." }, { args = { { name = "file" } }, description = "Creates a new VideoStream. Currently only Ogg Theora video files are supported. VideoStreams can't draw videos, see love.graphics.newVideo for that." } } } }, link = "https://love2d.org/wiki/love.video", type = "table" }, visible = { args = { { name = "visible" } }, description = "Callback function triggered when window is minimized/hidden or unminimized by the user.", link = "https://love2d.org/wiki/love.visible", type = "function" }, wheelmoved = { args = { { name = "x" }, { name = "y" } }, description = "Callback function triggered when the mouse wheel is moved.", link = "https://love2d.org/wiki/love.wheelmoved", type = "function" }, window = { description = "Provides an interface for modifying and retrieving information about the program's window.", fields = { close = { args = {}, description = "Closes the window. It can be reopened with love.window.setMode.", link = "https://love2d.org/wiki/love.window.close", type = "function" }, fromPixels = { link = "https://love2d.org/wiki/love.window.fromPixels", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "pixelvalue" } }, description = "Converts a number from pixels to density-independent units.\n\nThe pixel density inside the window might be greater (or smaller) than the \"size\" of the window. For example on a retina screen in Mac OS X with the highdpi window flag enabled, the window may take up the same physical size as an 800x600 window, but the area inside the window uses 1600x1200 pixels. love.window.fromPixels(1600) would return 800 in that case.\n\nThis function converts coordinates from pixels to the size users are expecting them to display at onscreen. love.window.toPixels does the opposite. The highdpi window flag must be enabled to use the full pixel density of a Retina screen on Mac OS X and iOS. The flag currently does nothing on Windows and Linux, and on Android it is effectively always enabled.\n\nMost LÖVE functions return values and expect arguments in terms of pixels rather than density-independent units." }, { args = { { name = "px" }, { name = "py" } }, description = "Converts a number from pixels to density-independent units.\n\nThe pixel density inside the window might be greater (or smaller) than the \"size\" of the window. For example on a retina screen in Mac OS X with the highdpi window flag enabled, the window may take up the same physical size as an 800x600 window, but the area inside the window uses 1600x1200 pixels. love.window.fromPixels(1600) would return 800 in that case.\n\nThis function converts coordinates from pixels to the size users are expecting them to display at onscreen. love.window.toPixels does the opposite. The highdpi window flag must be enabled to use the full pixel density of a Retina screen on Mac OS X and iOS. The flag currently does nothing on Windows and Linux, and on Android it is effectively always enabled.\n\nMost LÖVE functions return values and expect arguments in terms of pixels rather than density-independent units." } } }, getDisplayName = { args = { { name = "displayindex" } }, description = "Gets the name of a display.", link = "https://love2d.org/wiki/love.window.getDisplayName", returnTypes = { { type = "string" } }, type = "function" }, getFullscreen = { args = {}, description = "Gets whether the window is fullscreen.", link = "https://love2d.org/wiki/love.window.getFullscreen", returnTypes = { { type = "boolean" }, { name = "FullscreenType", type = "ref" } }, type = "function" }, getFullscreenModes = { args = { { displayName = "[display]", name = "display" } }, description = "Gets a list of supported fullscreen modes.", link = "https://love2d.org/wiki/love.window.getFullscreenModes", returnTypes = { { type = "table" } }, type = "function" }, getIcon = { args = {}, description = "Gets the window icon.", link = "https://love2d.org/wiki/love.window.getIcon", returnTypes = { { name = "ImageData", type = "ref" } }, type = "function" }, getMode = { args = {}, description = "Returns the current display mode.", link = "https://love2d.org/wiki/love.window.getMode", returnTypes = { { type = "number" }, { type = "number" }, { type = "table" } }, type = "function" }, getPixelScale = { args = {}, description = "Gets the DPI scale factor associated with the window.\n\nThe pixel density inside the window might be greater (or smaller) than the \"size\" of the window. For example on a retina screen in Mac OS X with the highdpi window flag enabled, the window may take up the same physical size as an 800x600 window, but the area inside the window uses 1600x1200 pixels. love.window.getPixelScale() would return 2.0 in that case.\n\nThe love.window.fromPixels and love.window.toPixels functions can also be used to convert between units.\n\nThe highdpi window flag must be enabled to use the full pixel density of a Retina screen on Mac OS X and iOS. The flag currently does nothing on Windows and Linux, and on Android it is effectively always enabled.", link = "https://love2d.org/wiki/love.window.getPixelScale", returnTypes = { { type = "number" } }, type = "function" }, getPosition = { args = {}, description = "Gets the position of the window on the screen.\n\nThe window position is in the coordinate space of the display it is currently in.", link = "https://love2d.org/wiki/love.window.getPosition", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getTitle = { args = {}, description = "Gets the window title.", link = "https://love2d.org/wiki/love.window.getTitle", returnTypes = { { type = "string" } }, type = "function" }, hasFocus = { args = {}, description = "Checks if the game window has keyboard focus.", link = "https://love2d.org/wiki/love.window.hasFocus", returnTypes = { { type = "boolean" } }, type = "function" }, hasMouseFocus = { args = {}, description = "Checks if the game window has mouse focus.", link = "https://love2d.org/wiki/love.window.hasMouseFocus", returnTypes = { { type = "boolean" } }, type = "function" }, isDisplaySleepEnabled = { args = {}, description = "Gets whether the display is allowed to sleep while the program is running.\n\nDisplay sleep is disabled by default. Some types of input (e.g. joystick button presses) might not prevent the display from sleeping, if display sleep is allowed.", link = "https://love2d.org/wiki/love.window.isDisplaySleepEnabled", returnTypes = { { type = "boolean" } }, type = "function" }, isMaximized = { args = {}, description = "Gets whether the Window is currently maximized.\n\nThe window can be maximized if it is not fullscreen and is resizable, and either the user has pressed the window's Maximize button or love.window.maximize has been called.", link = "https://love2d.org/wiki/love.window.isMaximized", returnTypes = { { type = "boolean" } }, type = "function" }, isOpen = { args = {}, description = "Checks if the window is open.", link = "https://love2d.org/wiki/love.window.isOpen", returnTypes = { { type = "boolean" } }, type = "function" }, isVisible = { args = {}, description = "Checks if the game window is visible.\n\nThe window is considered visible if it's not minimized and the program isn't hidden.", link = "https://love2d.org/wiki/love.window.isVisible", returnTypes = { { type = "boolean" } }, type = "function" }, maximize = { args = {}, description = "Makes the window as large as possible.\n\nThis function has no effect if the window isn't resizable, since it essentially programmatically presses the window's \"maximize\" button.", link = "https://love2d.org/wiki/love.window.maximize", type = "function" }, minimize = { args = {}, description = "Minimizes the window to the system's task bar / dock.", link = "https://love2d.org/wiki/love.window.minimize", type = "function" }, requestAttention = { args = { { displayName = "[continuous]", name = "continuous" } }, description = "Causes the window to request the attention of the user if it is not in the foreground.\n\nIn Windows the taskbar icon will flash, and in OS X the dock icon will bounce.", link = "https://love2d.org/wiki/love.window.requestAttention", type = "function" }, setDisplaySleepEnabled = { args = { { name = "enable" } }, description = "Sets whether the display is allowed to sleep while the program is running.\n\nDisplay sleep is disabled by default. Some types of input (e.g. joystick button presses) might not prevent the display from sleeping, if display sleep is allowed.", link = "https://love2d.org/wiki/love.window.setDisplaySleepEnabled", type = "function" }, setFullscreen = { link = "https://love2d.org/wiki/love.window.setFullscreen", returnTypes = { { type = "boolean" } }, type = "function", variants = { { args = { { name = "fullscreen" } }, description = "Enters or exits fullscreen. The display to use when entering fullscreen is chosen based on which display the window is currently in, if multiple monitors are connected.\n\nIf fullscreen mode is entered and the window size doesn't match one of the monitor's display modes (in normal fullscreen mode) or the window size doesn't match the desktop size (in 'desktop' fullscreen mode), the window will be resized appropriately. The window will revert back to its original size again when fullscreen mode is exited using this function." }, { args = { { name = "fullscreen" }, { name = "fstype" } }, description = "Enters or exits fullscreen. The display to use when entering fullscreen is chosen based on which display the window is currently in, if multiple monitors are connected.\n\nIf fullscreen mode is entered and the window size doesn't match one of the monitor's display modes (in normal fullscreen mode) or the window size doesn't match the desktop size (in 'desktop' fullscreen mode), the window will be resized appropriately. The window will revert back to its original size again when fullscreen mode is exited using this function." } } }, setIcon = { args = { { name = "imagedata" } }, description = "Sets the window icon until the game is quit. Not all operating systems support very large icon images.", link = "https://love2d.org/wiki/love.window.setIcon", returnTypes = { { type = "boolean" } }, type = "function" }, setMode = { args = { { name = "width" }, { name = "height" }, { name = "flags" } }, description = "Sets the display mode and properties of the window.\n\nIf width or height is 0, setMode will use the width and height of the desktop.\n\nChanging the display mode may have side effects: for example, canvases will be cleared and values sent to shaders with Shader:send will be erased. Make sure to save the contents of canvases beforehand or re-draw to them afterward if you need to.", link = "https://love2d.org/wiki/love.window.setMode", returnTypes = { { type = "boolean" } }, type = "function" }, setPosition = { args = { { name = "x" }, { name = "y" }, { name = "display" } }, description = "Sets the position of the window on the screen.\n\nThe window position is in the coordinate space of the specified display.", link = "https://love2d.org/wiki/love.window.setPosition", type = "function" }, setTitle = { args = { { name = "title" } }, description = "Sets the window title.", link = "https://love2d.org/wiki/love.window.setTitle", type = "function" }, showMessageBox = { link = "https://love2d.org/wiki/love.window.showMessageBox", returnTypes = { { type = "boolean" } }, type = "function", variants = { { args = { { name = "title" }, { name = "message" }, { displayName = "[type]", name = "type" }, { displayName = "[attachtowindow]", name = "attachtowindow" } }, description = "Displays a message box dialog above the love window. The message box contains a title, optional text, and buttons." }, { args = { { name = "title" }, { name = "message" }, { name = "buttonlist" }, { displayName = "[type]", name = "type" }, { displayName = "[attachtowindow]", name = "attachtowindow" } }, description = "Displays a message box dialog above the love window. The message box contains a title, optional text, and buttons." } } }, toPixels = { link = "https://love2d.org/wiki/love.window.toPixels", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "value" } }, description = "Converts a number from density-independent units to pixels.\n\nThe pixel density inside the window might be greater (or smaller) than the \"size\" of the window. For example on a retina screen in Mac OS X with the highdpi window flag enabled, the window may take up the same physical size as an 800x600 window, but the area inside the window uses 1600x1200 pixels. love.window.toPixels(800) would return 1600 in that case.\n\nThis is used to convert coordinates from the size users are expecting them to display at onscreen to pixels. love.window.fromPixels does the opposite. The highdpi window flag must be enabled to use the full pixel density of a Retina screen on Mac OS X and iOS. The flag currently does nothing on Windows and Linux, and on Android it is effectively always enabled.\n\nMost LÖVE functions return values and expect arguments in terms of pixels rather than density-independent units." }, { args = { { name = "x" }, { name = "y" } }, description = "Converts a number from density-independent units to pixels.\n\nThe pixel density inside the window might be greater (or smaller) than the \"size\" of the window. For example on a retina screen in Mac OS X with the highdpi window flag enabled, the window may take up the same physical size as an 800x600 window, but the area inside the window uses 1600x1200 pixels. love.window.toPixels(800) would return 1600 in that case.\n\nThis is used to convert coordinates from the size users are expecting them to display at onscreen to pixels. love.window.fromPixels does the opposite. The highdpi window flag must be enabled to use the full pixel density of a Retina screen on Mac OS X and iOS. The flag currently does nothing on Windows and Linux, and on Android it is effectively always enabled.\n\nMost LÖVE functions return values and expect arguments in terms of pixels rather than density-independent units." } } } }, link = "https://love2d.org/wiki/love.window", type = "table" } }, type = "table" } }, type = "table" }, namedTypes = { BezierCurve = { fields = { evaluate = { args = { { name = "self" }, { name = "t" } }, description = "Evaluate Bézier curve at parameter t. The parameter must be between 0 and 1 (inclusive).\n\nThis function can be used to move objects along paths or tween parameters. However it should not be used to render the curve, see BezierCurve:render for that purpose.", link = "https://love2d.org/wiki/BezierCurve:evaluate", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getControlPoint = { args = { { name = "self" }, { name = "i" } }, description = "Get coordinates of the i-th control point. Indices start with 1.", link = "https://love2d.org/wiki/BezierCurve:getControlPoint", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getControlPointCount = { args = { { name = "self" } }, description = "Get the number of control points in the Bézier curve.", link = "https://love2d.org/wiki/BezierCurve:getControlPointCount", returnTypes = { { type = "number" } }, type = "function" }, getDegree = { args = { { name = "self" } }, description = "Get degree of the Bézier curve. The degree is equal to number-of-control-points - 1.", link = "https://love2d.org/wiki/BezierCurve:getDegree", returnTypes = { { type = "number" } }, type = "function" }, getDerivative = { args = { { name = "self" } }, description = "Get the derivative of the Bézier curve.\n\nThis function can be used to rotate sprites moving along a curve in the direction of the movement and compute the direction perpendicular to the curve at some parameter t.", link = "https://love2d.org/wiki/BezierCurve:getDerivative", returnTypes = { { name = "BezierCurve", type = "ref" } }, type = "function" }, getSegment = { args = { { name = "self" }, { name = "startpoint" }, { name = "endpoint" } }, description = "Gets a BezierCurve that corresponds to the specified segment of this BezierCurve.", link = "https://love2d.org/wiki/BezierCurve:getSegment", returnTypes = { { name = "BezierCurve", type = "ref" } }, type = "function" }, insertControlPoint = { args = { { name = "self" }, { name = "x" }, { name = "y" }, { displayName = "[i]", name = "i" } }, description = "Insert control point as the new i-th control point. Existing control points from i onwards are pushed back by 1. Indices start with 1. Negative indices wrap around: -1 is the last control point, -2 the one before the last, etc.", link = "https://love2d.org/wiki/BezierCurve:insertControlPoint", type = "function" }, removeControlPoint = { args = { { name = "self" }, { name = "index" } }, description = "Removes the specified control point.", link = "https://love2d.org/wiki/BezierCurve:removeControlPoint", type = "function" }, render = { args = { { name = "self" }, { displayName = "[depth]", name = "depth" } }, description = "Get a list of coordinates to be used with love.graphics.line.\n\nThis function samples the Bézier curve using recursive subdivision. You can control the recursion depth using the depth parameter.\n\nIf you are just interested to know the position on the curve given a parameter, use BezierCurve:evaluate.", link = "https://love2d.org/wiki/BezierCurve:render", returnTypes = { { type = "table" } }, type = "function" }, renderSegment = { args = { { name = "self" }, { name = "startpoint" }, { name = "endpoint" }, { displayName = "[depth]", name = "depth" } }, description = "Get a list of coordinates on a specific part of the curve, to be used with love.graphics.line.\n\nThis function samples the Bézier curve using recursive subdivision. You can control the recursion depth using the depth parameter.\n\nIf you are just need to know the position on the curve given a parameter, use BezierCurve:evaluate.", link = "https://love2d.org/wiki/BezierCurve:renderSegment", returnTypes = { { type = "table" } }, type = "function" }, rotate = { args = { { name = "self" }, { name = "angle" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" } }, description = "Rotate the Bézier curve by an angle.", link = "https://love2d.org/wiki/BezierCurve:rotate", type = "function" }, scale = { args = { { name = "self" }, { name = "s" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" } }, description = "Scale the Bézier curve by a factor.", link = "https://love2d.org/wiki/BezierCurve:scale", type = "function" }, setControlPoint = { args = { { name = "self" }, { name = "i" }, { name = "ox" }, { name = "oy" } }, description = "Set coordinates of the i-th control point. Indices start with 1.", link = "https://love2d.org/wiki/BezierCurve:setControlPoint", type = "function" }, translate = { args = { { name = "self" }, { name = "dx" }, { name = "dy" } }, description = "Move the Bézier curve by an offset.", link = "https://love2d.org/wiki/BezierCurve:translate", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, Body = { fields = { applyAngularImpulse = { args = { { name = "self" }, { name = "impulse" } }, description = "Applies an angular impulse to a body. This makes a single, instantaneous addition to the body momentum.\n\nA body with with a larger mass will react less. The reaction does not depend on the timestep, and is equivalent to applying a force continuously for 1 second. Impulses are best used to give a single push to a body. For a continuous push to a body it is better to use Body:applyForce.", link = "https://love2d.org/wiki/Body:applyAngularImpulse", type = "function" }, applyForce = { link = "https://love2d.org/wiki/Body:applyForce", type = "function", variants = { { args = { { name = "self" }, { name = "fx" }, { name = "fy" } }, description = "Apply force to a Body.\n\nA force pushes a body in a direction. A body with with a larger mass will react less. The reaction also depends on how long a force is applied: since the force acts continuously over the entire timestep, a short timestep will only push the body for a short time. Thus forces are best used for many timesteps to give a continuous push to a body (like gravity). For a single push that is independent of timestep, it is better to use Body:applyLinearImpulse.\n\nIf the position to apply the force is not given, it will act on the center of mass of the body. The part of the force not directed towards the center of mass will cause the body to spin (and depends on the rotational inertia).\n\nNote that the force components and position must be given in world coordinates." }, { args = { { name = "self" }, { name = "fx" }, { name = "fy" }, { name = "x" }, { name = "y" } }, description = "Apply force to a Body.\n\nA force pushes a body in a direction. A body with with a larger mass will react less. The reaction also depends on how long a force is applied: since the force acts continuously over the entire timestep, a short timestep will only push the body for a short time. Thus forces are best used for many timesteps to give a continuous push to a body (like gravity). For a single push that is independent of timestep, it is better to use Body:applyLinearImpulse.\n\nIf the position to apply the force is not given, it will act on the center of mass of the body. The part of the force not directed towards the center of mass will cause the body to spin (and depends on the rotational inertia).\n\nNote that the force components and position must be given in world coordinates." } } }, applyLinearImpulse = { link = "https://love2d.org/wiki/Body:applyLinearImpulse", type = "function", variants = { { args = { { name = "self" }, { name = "ix" }, { name = "iy" } }, description = "Applies an impulse to a body. This makes a single, instantaneous addition to the body momentum.\n\nAn impulse pushes a body in a direction. A body with with a larger mass will react less. The reaction does not depend on the timestep, and is equivalent to applying a force continuously for 1 second. Impulses are best used to give a single push to a body. For a continuous push to a body it is better to use Body:applyForce.\n\nIf the position to apply the impulse is not given, it will act on the center of mass of the body. The part of the impulse not directed towards the center of mass will cause the body to spin (and depends on the rotational inertia).\n\nNote that the impulse components and position must be given in world coordinates." }, { args = { { name = "self" }, { name = "ix" }, { name = "iy" }, { name = "x" }, { name = "y" } }, description = "Applies an impulse to a body. This makes a single, instantaneous addition to the body momentum.\n\nAn impulse pushes a body in a direction. A body with with a larger mass will react less. The reaction does not depend on the timestep, and is equivalent to applying a force continuously for 1 second. Impulses are best used to give a single push to a body. For a continuous push to a body it is better to use Body:applyForce.\n\nIf the position to apply the impulse is not given, it will act on the center of mass of the body. The part of the impulse not directed towards the center of mass will cause the body to spin (and depends on the rotational inertia).\n\nNote that the impulse components and position must be given in world coordinates." } } }, applyTorque = { args = { { name = "self" }, { name = "torque" } }, description = "Apply torque to a body.\n\nTorque is like a force that will change the angular velocity (spin) of a body. The effect will depend on the rotational inertia a body has.", link = "https://love2d.org/wiki/Body:applyTorque", type = "function" }, destroy = { args = { { name = "self" } }, description = "Explicitly destroys the Body. When you don't have time to wait for garbage collection, this function may be used to free the object immediately, but note that an error will occur if you attempt to use the object after calling this function.", link = "https://love2d.org/wiki/Body:destroy", type = "function" }, getAngle = { args = { { name = "self" } }, description = "Get the angle of the body.\n\nThe angle is measured in radians. If you need to transform it to degrees, use math.deg.\n\nA value of 0 radians will mean \"looking to the right\". Although radians increase counter-clockwise, the y-axis points down so it becomes clockwise from our point of view.", link = "https://love2d.org/wiki/Body:getAngle", returnTypes = { { type = "number" } }, type = "function" }, getAngularDamping = { args = { { name = "self" } }, description = "Gets the Angular damping of the Body\n\nThe angular damping is the rate of decrease of the angular velocity over time: A spinning body with no damping and no external forces will continue spinning indefinitely. A spinning body with damping will gradually stop spinning.\n\nDamping is not the same as friction - they can be modelled together. However, only damping is provided by Box2D (and LÖVE).\n\nDamping parameters should be between 0 and infinity, with 0 meaning no damping, and infinity meaning full damping. Normally you will use a damping value between 0 and 0.1.", link = "https://love2d.org/wiki/Body:getAngularDamping", returnTypes = { { type = "number" } }, type = "function" }, getAngularVelocity = { args = { { name = "self" } }, description = "Get the angular velocity of the Body.\n\nThe angular velocity is the rate of change of angle over time.\n\nIt is changed in World:update by applying torques, off centre forces/impulses, and angular damping. It can be set directly with Body:setAngularVelocity.\n\nIf you need the rate of change of position over time, use Body:getLinearVelocity.", link = "https://love2d.org/wiki/Body:getAngularVelocity", returnTypes = { { type = "number" } }, type = "function" }, getContactList = { args = { { name = "self" } }, description = "Gets a list of all Contacts attached to the Body.", link = "https://love2d.org/wiki/Body:getContactList", returnTypes = { { type = "table" } }, type = "function" }, getFixtureList = { args = { { name = "self" } }, description = "Returns a table with all fixtures.", link = "https://love2d.org/wiki/Body:getFixtureList", returnTypes = { { type = "table" } }, type = "function" }, getGravityScale = { args = { { name = "self" } }, description = "Returns the gravity scale factor.", link = "https://love2d.org/wiki/Body:getGravityScale", returnTypes = { { type = "number" } }, type = "function" }, getInertia = { args = { { name = "self" } }, description = "Gets the rotational inertia of the body.\n\nThe rotational inertia is how hard is it to make the body spin.", link = "https://love2d.org/wiki/Body:getInertia", returnTypes = { { type = "number" } }, type = "function" }, getJointList = { args = { { name = "self" } }, description = "Returns a table containing the Joints attached to this Body.", link = "https://love2d.org/wiki/Body:getJointList", returnTypes = { { type = "table" } }, type = "function" }, getLinearDamping = { args = { { name = "self" } }, description = "Gets the linear damping of the Body.\n\nThe linear damping is the rate of decrease of the linear velocity over time. A moving body with no damping and no external forces will continue moving indefinitely, as is the case in space. A moving body with damping will gradually stop moving.\n\nDamping is not the same as friction - they can be modelled together. However, only damping is provided by Box2D (and LÖVE).", link = "https://love2d.org/wiki/Body:getLinearDamping", returnTypes = { { type = "number" } }, type = "function" }, getLinearVelocity = { args = { { name = "self" } }, description = "Gets the linear velocity of the Body from its center of mass.\n\nThe linear velocity is the rate of change of position over time.\n\nIf you need the rate of change of angle over time, use Body:getAngularVelocity. If you need to get the linear velocity of a point different from the center of mass:\n\nBody:getLinearVelocityFromLocalPoint allows you to specify the point in local coordinates.\n\nBody:getLinearVelocityFromWorldPoint allows you to specify the point in world coordinates.", link = "https://love2d.org/wiki/Body:getLinearVelocity", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getLinearVelocityFromLocalPoint = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Get the linear velocity of a point on the body.\n\nThe linear velocity for a point on the body is the velocity of the body center of mass plus the velocity at that point from the body spinning.\n\nThe point on the body must given in local coordinates. Use Body:getLinearVelocityFromWorldPoint to specify this with world coordinates.", link = "https://love2d.org/wiki/Body:getLinearVelocityFromLocalPoint", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getLinearVelocityFromWorldPoint = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Get the linear velocity of a point on the body.\n\nThe linear velocity for a point on the body is the velocity of the body center of mass plus the velocity at that point from the body spinning.\n\nThe point on the body must given in world coordinates. Use Body:getLinearVelocityFromLocalPoint to specify this with local coordinates.", link = "https://love2d.org/wiki/Body:getLinearVelocityFromWorldPoint", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getLocalCenter = { args = { { name = "self" } }, description = "Get the center of mass position in local coordinates.\n\nUse Body:getWorldCenter to get the center of mass in world coordinates.", link = "https://love2d.org/wiki/Body:getLocalCenter", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getLocalPoint = { args = { { name = "self" }, { name = "worldX" }, { name = "worldY" } }, description = "Transform a point from world coordinates to local coordinates.", link = "https://love2d.org/wiki/Body:getLocalPoint", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getLocalVector = { args = { { name = "self" }, { name = "worldX" }, { name = "worldY" } }, description = "Transform a vector from world coordinates to local coordinates.", link = "https://love2d.org/wiki/Body:getLocalVector", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getMass = { args = { { name = "self" } }, description = "Get the mass of the body.", link = "https://love2d.org/wiki/Body:getMass", returnTypes = { { type = "number" } }, type = "function" }, getMassData = { args = { { name = "self" } }, description = "Returns the mass, its center, and the rotational inertia.", link = "https://love2d.org/wiki/Body:getMassData", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getPosition = { args = { { name = "self" } }, description = "Get the position of the body.\n\nNote that this may not be the center of mass of the body.", link = "https://love2d.org/wiki/Body:getPosition", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getType = { args = { { name = "self" } }, description = "Returns the type of the body.", link = "https://love2d.org/wiki/Body:getType", returnTypes = { { name = "BodyType", type = "ref" } }, type = "function" }, getUserData = { args = { { name = "self" } }, description = "Returns the Lua value associated with this Body.", link = "https://love2d.org/wiki/Body:getUserData", returnTypes = { { name = "any", type = "ref" } }, type = "function" }, getWorld = { args = { { name = "self" } }, description = "Gets the World the body lives in.", link = "https://love2d.org/wiki/Body:getWorld", returnTypes = { { name = "World", type = "ref" } }, type = "function" }, getWorldCenter = { args = { { name = "self" } }, description = "Get the center of mass position in world coordinates.\n\nUse Body:getLocalCenter to get the center of mass in local coordinates.", link = "https://love2d.org/wiki/Body:getWorldCenter", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getWorldPoint = { args = { { name = "self" }, { name = "localX" }, { name = "localY" } }, description = "Transform a point from local coordinates to world coordinates.", link = "https://love2d.org/wiki/Body:getWorldPoint", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getWorldPoints = { args = { { name = "self" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "..." } }, description = "Transforms multiple points from local coordinates to world coordinates.", link = "https://love2d.org/wiki/Body:getWorldPoints", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getWorldVector = { args = { { name = "self" }, { name = "localX" }, { name = "localY" } }, description = "Transform a vector from local coordinates to world coordinates.", link = "https://love2d.org/wiki/Body:getWorldVector", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getX = { args = { { name = "self" } }, description = "Get the x position of the body in world coordinates.", link = "https://love2d.org/wiki/Body:getX", returnTypes = { { type = "number" } }, type = "function" }, getY = { args = { { name = "self" } }, description = "Get the y position of the body in world coordinates.", link = "https://love2d.org/wiki/Body:getY", returnTypes = { { type = "number" } }, type = "function" }, isActive = { args = { { name = "self" } }, description = "Returns whether the body is actively used in the simulation.", link = "https://love2d.org/wiki/Body:isActive", returnTypes = { { type = "boolean" } }, type = "function" }, isAwake = { args = { { name = "self" } }, description = "Returns the sleep status of the body.", link = "https://love2d.org/wiki/Body:isAwake", returnTypes = { { type = "boolean" } }, type = "function" }, isBullet = { args = { { name = "self" } }, description = "Get the bullet status of a body.\n\nThere are two methods to check for body collisions:\n\nat their location when the world is updated (default)\n\nusing continuous collision detection (CCD)\n\nThe default method is efficient, but a body moving very quickly may sometimes jump over another body without producing a collision. A body that is set as a bullet will use CCD. This is less efficient, but is guaranteed not to jump when moving quickly.\n\nNote that static bodies (with zero mass) always use CCD, so your walls will not let a fast moving body pass through even if it is not a bullet.", link = "https://love2d.org/wiki/Body:isBullet", returnTypes = { { type = "boolean" } }, type = "function" }, isDestroyed = { args = { { name = "self" } }, description = "Gets whether the Body is destroyed. Destroyed bodies cannot be used.", link = "https://love2d.org/wiki/Body:isDestroyed", returnTypes = { { type = "boolean" } }, type = "function" }, isFixedRotation = { args = { { name = "self" } }, description = "Returns whether the body rotation is locked.", link = "https://love2d.org/wiki/Body:isFixedRotation", returnTypes = { { type = "boolean" } }, type = "function" }, isSleepingAllowed = { args = { { name = "self" } }, description = "Returns the sleeping behaviour of the body.", link = "https://love2d.org/wiki/Body:isSleepingAllowed", returnTypes = { { type = "boolean" } }, type = "function" }, resetMassData = { args = { { name = "self" } }, description = "Resets the mass of the body by recalculating it from the mass properties of the fixtures.", link = "https://love2d.org/wiki/Body:resetMassData", type = "function" }, setActive = { args = { { name = "self" }, { name = "active" } }, description = "Sets whether the body is active in the world.\n\nAn inactive body does not take part in the simulation. It will not move or cause any collisions.", link = "https://love2d.org/wiki/Body:setActive", type = "function" }, setAngle = { args = { { name = "self" }, { name = "angle" } }, description = "Set the angle of the body.\n\nThe angle is measured in radians. If you need to transform it from degrees, use math.rad.\n\nA value of 0 radians will mean \"looking to the right\". Although radians increase counter-clockwise, the y-axis points down so it becomes clockwise from our point of view.\n\nIt is possible to cause a collision with another body by changing its angle.", link = "https://love2d.org/wiki/Body:setAngle", type = "function" }, setAngularDamping = { args = { { name = "self" }, { name = "damping" } }, description = "Sets the angular damping of a Body.\n\nSee Body:getAngularDamping for a definition of angular damping.\n\nAngular damping can take any value from 0 to infinity. It is recommended to stay between 0 and 0.1, though. Other values will look unrealistic.", link = "https://love2d.org/wiki/Body:setAngularDamping", type = "function" }, setAngularVelocity = { args = { { name = "self" }, { name = "w" } }, description = "Sets the angular velocity of a Body.\n\nThe angular velocity is the rate of change of angle over time.\n\nThis function will not accumulate anything; any impulses previously applied since the last call to World:update will be lost.", link = "https://love2d.org/wiki/Body:setAngularVelocity", type = "function" }, setAwake = { args = { { name = "self" }, { name = "awake" } }, description = "Wakes the body up or puts it to sleep.", link = "https://love2d.org/wiki/Body:setAwake", type = "function" }, setBullet = { args = { { name = "self" }, { name = "status" } }, description = "Set the bullet status of a body.\n\nThere are two methods to check for body collisions:\n\nat their location when the world is updated (default)\n\nusing continuous collision detection (CCD)\n\nThe default method is efficient, but a body moving very quickly may sometimes jump over another body without producing a collision. A body that is set as a bullet will use CCD. This is less efficient, but is guaranteed not to jump when moving quickly.\n\nNote that static bodies (with zero mass) always use CCD, so your walls will not let a fast moving body pass through even if it is not a bullet.", link = "https://love2d.org/wiki/Body:setBullet", type = "function" }, setFixedRotation = { args = { { name = "self" }, { name = "fixed" } }, description = "Set whether a body has fixed rotation.\n\nBodies with fixed rotation don't vary the speed at which they rotate.", link = "https://love2d.org/wiki/Body:setFixedRotation", type = "function" }, setGravityScale = { args = { { name = "self" }, { name = "scale" } }, description = "Sets a new gravity scale factor for the body.", link = "https://love2d.org/wiki/Body:setGravityScale", type = "function" }, setInertia = { args = { { name = "self" }, { name = "inertia" } }, description = "Set the inertia of a body.", link = "https://love2d.org/wiki/Body:setInertia", type = "function" }, setLinearDamping = { args = { { name = "self" }, { name = "ld" } }, description = "Sets the linear damping of a Body\n\nSee Body:getLinearDamping for a definition of linear damping.\n\nLinear damping can take any value from 0 to infinity. It is recommended to stay between 0 and 0.1, though. Other values will make the objects look \"floaty\".", link = "https://love2d.org/wiki/Body:setLinearDamping", type = "function" }, setLinearVelocity = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Sets a new linear velocity for the Body.\n\nThis function will not accumulate anything; any impulses previously applied since the last call to World:update will be lost.", link = "https://love2d.org/wiki/Body:setLinearVelocity", type = "function" }, setMass = { args = { { name = "self" }, { name = "mass" } }, description = "Sets the mass in kilograms.", link = "https://love2d.org/wiki/Body:setMass", type = "function" }, setMassData = { args = { { name = "self" }, { name = "x" }, { name = "y" }, { name = "mass" }, { name = "inertia" } }, description = "Overrides the calculated mass data.", link = "https://love2d.org/wiki/Body:setMassData", type = "function" }, setPosition = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Set the position of the body.\n\nNote that this may not be the center of mass of the body.", link = "https://love2d.org/wiki/Body:setPosition", type = "function" }, setSleepingAllowed = { args = { { name = "self" }, { name = "allowed" } }, description = "Sets the sleeping behaviour of the body.", link = "https://love2d.org/wiki/Body:setSleepingAllowed", type = "function" }, setType = { args = { { name = "self" }, { name = "type" } }, description = "Sets a new body type.", link = "https://love2d.org/wiki/Body:setType", type = "function" }, setUserData = { args = { { name = "self" }, { name = "value" } }, description = "Associates a Lua value with the Body.\n\nTo delete the reference, explicitly pass nil.", link = "https://love2d.org/wiki/Body:setUserData", type = "function" }, setX = { args = { { name = "self" }, { name = "x" } }, description = "Set the x position of the body.", link = "https://love2d.org/wiki/Body:setX", type = "function" }, setY = { args = { { name = "self" }, { name = "y" } }, description = "Set the y position of the body.", link = "https://love2d.org/wiki/Body:setY", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, Canvas = { fields = { getDimensions = { args = { { name = "self" } }, description = "Gets the width and height of the Canvas.", link = "https://love2d.org/wiki/Canvas:getDimensions", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getFilter = { args = { { name = "self" } }, description = "Gets the filter mode of the Canvas.", link = "https://love2d.org/wiki/Canvas:getFilter", returnTypes = { { name = "FilterMode", type = "ref" }, { name = "FilterMode", type = "ref" }, { type = "number" } }, type = "function" }, getFormat = { args = { { name = "self" } }, description = "Gets the texture format of the Canvas.", link = "https://love2d.org/wiki/Canvas:getFormat", returnTypes = { { name = "CanvasFormat", type = "ref" } }, type = "function" }, getHeight = { args = { { name = "self" } }, description = "Gets the height of the Canvas.", link = "https://love2d.org/wiki/Canvas:getHeight", returnTypes = { { type = "number" } }, type = "function" }, getMSAA = { args = { { name = "self" } }, description = "Gets the number of multisample antialiasing (MSAA) samples used when drawing to the Canvas.\n\nThis may be different than the number used as an argument to love.graphics.newCanvas if the system running LÖVE doesn't support that number.", link = "https://love2d.org/wiki/Canvas:getMSAA", returnTypes = { { type = "number" } }, type = "function" }, getWidth = { args = { { name = "self" } }, description = "Gets the width of the Canvas.", link = "https://love2d.org/wiki/Canvas:getWidth", returnTypes = { { type = "number" } }, type = "function" }, getWrap = { args = { { name = "self" } }, description = "Gets the wrapping properties of a Canvas.\n\nThis function returns the currently set horizontal and vertical wrapping modes for the Canvas.", link = "https://love2d.org/wiki/Canvas:getWrap", returnTypes = { { name = "WrapMode", type = "ref" }, { name = "WrapMode", type = "ref" } }, type = "function" }, newImageData = { link = "https://love2d.org/wiki/Canvas:newImageData", returnTypes = { { name = "ImageData", type = "ref" } }, type = "function", variants = { { args = { { name = "self" } }, description = "Generates ImageData from the contents of the Canvas." }, { args = { { name = "self" }, { name = "x" }, { name = "y" }, { name = "width" }, { name = "height" } }, description = "Generates ImageData from the contents of the Canvas." } } }, renderTo = { args = { { name = "self" }, { name = "func" } }, description = "Render to the Canvas using a function.", link = "https://love2d.org/wiki/Canvas:renderTo", type = "function" }, setFilter = { args = { { name = "self" }, { name = "min" }, { displayName = "[mag]", name = "mag" }, { displayName = "[anisotropy]", name = "anisotropy" } }, description = "Sets the filter of the Canvas.", link = "https://love2d.org/wiki/Canvas:setFilter", type = "function" }, setWrap = { args = { { name = "self" }, { name = "horizontal" }, { displayName = "[vertical]", name = "vertical" } }, description = "Sets the wrapping properties of a Canvas.\n\nThis function sets the way the edges of a Canvas are treated if it is scaled or rotated. If the WrapMode is set to \"clamp\", the edge will not be interpolated. If set to \"repeat\", the edge will be interpolated with the pixels on the opposing side of the framebuffer.", link = "https://love2d.org/wiki/Canvas:setWrap", type = "function" } }, metatable = { fields = { __index = { name = "Texture", type = "ref" } }, type = "table" }, type = "table" }, ChainShape = { fields = { getChildEdge = { args = { { name = "self" }, { name = "index" } }, description = "Returns a child of the shape as an EdgeShape.", link = "https://love2d.org/wiki/ChainShape:getChildEdge", returnTypes = { { type = "number" } }, type = "function" }, getNextVertex = { args = { { name = "self" }, { displayName = "[x]", name = "x" }, { displayName = "[y]", name = "y" } }, description = "Gets the vertex that establishes a connection to the next shape.\n\nSetting next and previous ChainShape vertices can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.", link = "https://love2d.org/wiki/ChainShape:getNextVertex", type = "function" }, getPoint = { args = { { name = "self" }, { name = "index" } }, description = "Returns a point of the shape.", link = "https://love2d.org/wiki/ChainShape:getPoint", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getPoints = { args = { { name = "self" } }, description = "Returns all points of the shape.", link = "https://love2d.org/wiki/ChainShape:getPoints", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getPreviousVertex = { args = { { name = "self" } }, description = "Gets the vertex that establishes a connection to the previous shape.\n\nSetting next and previous ChainShape vertices can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.", link = "https://love2d.org/wiki/ChainShape:getPreviousVertex", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getVertexCount = { args = { { name = "self" } }, description = "Returns the number of vertices the shape has.", link = "https://love2d.org/wiki/ChainShape:getVertexCount", returnTypes = { { type = "number" } }, type = "function" }, setNextVertex = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Sets a vertex that establishes a connection to the next shape.\n\nThis can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.", link = "https://love2d.org/wiki/ChainShape:setNextVertex", type = "function" }, setPreviousVertex = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Sets a vertex that establishes a connection to the previous shape.\n\nThis can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.", link = "https://love2d.org/wiki/ChainShape:setPreviousVertex", type = "function" } }, metatable = { fields = { __index = { name = "Shape", type = "ref" } }, type = "table" }, type = "table" }, Channel = { fields = { clear = { args = { { name = "self" } }, description = "Clears all the messages in the Channel queue.", link = "https://love2d.org/wiki/Channel:clear", type = "function" }, demand = { args = { { name = "self" } }, description = "Retrieves the value of a Channel message and removes it from the message queue.\n\nIt waits until a message is in the queue then returns the message value.", link = "https://love2d.org/wiki/Channel:demand", returnTypes = { { name = "Variant", type = "ref" } }, type = "function" }, getCount = { args = { { name = "self" } }, description = "Retrieves the number of messages in the thread Channel queue.", link = "https://love2d.org/wiki/Channel:getCount", returnTypes = { { type = "number" } }, type = "function" }, peek = { args = { { name = "self" } }, description = "Retrieves the value of a Channel message, but leaves it in the queue.\n\nIt returns nil if there's no message in the queue.", link = "https://love2d.org/wiki/Channel:peek", returnTypes = { { name = "Variant", type = "ref" } }, type = "function" }, performAtomic = { args = { { name = "self" }, { name = "func" }, { name = "arg1" }, { name = "..." } }, description = "Executes the specified function atomically with respect to this Channel.\n\nCalling multiple methods in a row on the same Channel is often useful. However if multiple Threads are calling this Channel's methods at the same time, the different calls on each Thread might end up interleaved (e.g. one or more of the second thread's calls may happen in between the first thread's calls.)\n\nThis method avoids that issue by making sure the Thread calling the method has exclusive access to the Channel until the specified function has returned.", link = "https://love2d.org/wiki/Channel:performAtomic", returnTypes = { { name = "any", type = "ref" }, { name = "any", type = "ref" } }, type = "function" }, pop = { args = { { name = "self" } }, description = "Retrieves the value of a Channel message and removes it from the message queue.\n\nIt returns nil if there are no messages in the queue.", link = "https://love2d.org/wiki/Channel:pop", returnTypes = { { name = "Variant", type = "ref" } }, type = "function" }, push = { args = { { name = "self" }, { name = "value" } }, description = "Send a message to the thread Channel.\n\nSee Variant for the list of supported types.", link = "https://love2d.org/wiki/Channel:push", type = "function" }, supply = { args = { { name = "self" }, { name = "value" } }, description = "Send a message to the thread Channel and wait for a thread to accept it.\n\nSee Variant for the list of supported types.", link = "https://love2d.org/wiki/Channel:supply", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, CircleShape = { fields = { getPoint = { args = { { name = "self" } }, description = "Gets the center point of the circle shape.", link = "https://love2d.org/wiki/CircleShape:getPoint", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getRadius = { args = { { name = "self" } }, description = "Gets the radius of the circle shape.", link = "https://love2d.org/wiki/CircleShape:getRadius", returnTypes = { { type = "number" } }, type = "function" }, setPoint = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Sets the location of the center of the circle shape.", link = "https://love2d.org/wiki/CircleShape:setPoint", type = "function" }, setRadius = { args = { { name = "self" }, { name = "radius" } }, description = "Sets the radius of the circle.", link = "https://love2d.org/wiki/CircleShape:setRadius", type = "function" } }, metatable = { fields = { __index = { name = "Shape", type = "ref" } }, type = "table" }, type = "table" }, CompressedData = { fields = { getFormat = { args = { { name = "self" } }, description = "Gets the compression format of the CompressedData.", link = "https://love2d.org/wiki/CompressedData:getFormat", returnTypes = { { name = "CompressedDataFormat", type = "ref" } }, type = "function" } }, metatable = { fields = { __index = { name = "Data", type = "ref" } }, type = "table" }, type = "table" }, CompressedImageData = { fields = { getDimensions = { link = "https://love2d.org/wiki/CompressedImageData:getDimensions", returnTypes = { { type = "number" }, { type = "number" } }, type = "function", variants = { { args = { { name = "self" } }, description = "Gets the width and height of the CompressedImageData." }, { args = { { name = "self" }, { name = "level" } }, description = "Gets the width and height of the CompressedImageData." } } }, getFormat = { args = { { name = "self" } }, description = "Gets the format of the CompressedImageData.", link = "https://love2d.org/wiki/CompressedImageData:getFormat", returnTypes = { { name = "CompressedImageFormat", type = "ref" } }, type = "function" }, getHeight = { link = "https://love2d.org/wiki/CompressedImageData:getHeight", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "self" } }, description = "Gets the height of the CompressedImageData." }, { args = { { name = "self" }, { name = "level" } }, description = "Gets the height of the CompressedImageData." } } }, getMipmapCount = { args = { { name = "self" } }, description = "Gets the number of mipmap levels in the CompressedImageData. The base mipmap level (original image) is included in the count.", link = "https://love2d.org/wiki/CompressedImageData:getMipmapCount", returnTypes = { { type = "number" } }, type = "function" }, getWidth = { link = "https://love2d.org/wiki/CompressedImageData:getWidth", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "self" } }, description = "Gets the width of the CompressedImageData." }, { args = { { name = "self" }, { name = "level" } }, description = "Gets the width of the CompressedImageData." } } } }, metatable = { fields = { __index = { name = "Data", type = "ref" } }, type = "table" }, type = "table" }, Contact = { fields = { getFixtures = { args = { { name = "self" } }, description = "Gets the two Fixtures that hold the shapes that are in contact.", link = "https://love2d.org/wiki/Contact:getFixtures", returnTypes = { { name = "Fixture", type = "ref" }, { name = "Fixture", type = "ref" } }, type = "function" }, getFriction = { args = { { name = "self" } }, description = "Get the friction between two shapes that are in contact.", link = "https://love2d.org/wiki/Contact:getFriction", returnTypes = { { type = "number" } }, type = "function" }, getNormal = { args = { { name = "self" } }, description = "Get the normal vector between two shapes that are in contact.\n\nThis function returns the coordinates of a unit vector that points from the first shape to the second.", link = "https://love2d.org/wiki/Contact:getNormal", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getPositions = { args = { { name = "self" } }, description = "Returns the contact points of the two colliding fixtures. There can be one or two points.", link = "https://love2d.org/wiki/Contact:getPositions", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getRestitution = { args = { { name = "self" } }, description = "Get the restitution between two shapes that are in contact.", link = "https://love2d.org/wiki/Contact:getRestitution", returnTypes = { { type = "number" } }, type = "function" }, isEnabled = { args = { { name = "self" } }, description = "Returns whether the contact is enabled. The collision will be ignored if a contact gets disabled in the preSolve callback.", link = "https://love2d.org/wiki/Contact:isEnabled", returnTypes = { { type = "boolean" } }, type = "function" }, isTouching = { args = { { name = "self" } }, description = "Returns whether the two colliding fixtures are touching each other.", link = "https://love2d.org/wiki/Contact:isTouching", returnTypes = { { type = "boolean" } }, type = "function" }, resetFriction = { args = { { name = "self" } }, description = "Resets the contact friction to the mixture value of both fixtures.", link = "https://love2d.org/wiki/Contact:resetFriction", type = "function" }, resetRestitution = { args = { { name = "self" } }, description = "Resets the contact restitution to the mixture value of both fixtures.", link = "https://love2d.org/wiki/Contact:resetRestitution", type = "function" }, setEnabled = { args = { { name = "self" }, { name = "enabled" } }, description = "Enables or disables the contact.", link = "https://love2d.org/wiki/Contact:setEnabled", type = "function" }, setFriction = { args = { { name = "self" }, { name = "friction" } }, description = "Sets the contact friction.", link = "https://love2d.org/wiki/Contact:setFriction", type = "function" }, setRestitution = { args = { { name = "self" }, { name = "restitution" } }, description = "Sets the contact restitution.", link = "https://love2d.org/wiki/Contact:setRestitution", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, Cursor = { fields = { getType = { args = { { name = "self" } }, description = "Gets the type of the Cursor.", link = "https://love2d.org/wiki/Cursor:getType", returnTypes = { { name = "CursorType", type = "ref" } }, type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, Data = { fields = { getPointer = { args = { { name = "self" } }, description = "Gets a pointer to the Data.", link = "https://love2d.org/wiki/Data:getPointer", returnTypes = { { name = "light userdata", type = "ref" } }, type = "function" }, getSize = { args = { { name = "self" } }, description = "Gets the size of the Data.", link = "https://love2d.org/wiki/Data:getSize", returnTypes = { { type = "number" } }, type = "function" }, getString = { args = { { name = "self" } }, description = "Gets the full Data as a string.", link = "https://love2d.org/wiki/Data:getString", returnTypes = { { type = "string" } }, type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, Decoder = { fields = { getBitDepth = { args = { { name = "self" } }, description = "Returns the number of bits per sample.", link = "https://love2d.org/wiki/Decoder:getBitDepth", returnTypes = { { type = "number" } }, type = "function" }, getChannels = { args = { { name = "self" } }, description = "Returns the number of channels in the stream.", link = "https://love2d.org/wiki/Decoder:getChannels", returnTypes = { { type = "number" } }, type = "function" }, getDuration = { args = { { name = "self" } }, description = "Gets the duration of the sound file. It may not always be sample-accurate, and it may return -1 if the duration cannot be determined at all.", link = "https://love2d.org/wiki/Decoder:getDuration", returnTypes = { { type = "number" } }, type = "function" }, getSampleRate = { args = { { name = "self" } }, description = "Returns the sample rate of the Decoder.", link = "https://love2d.org/wiki/Decoder:getSampleRate", returnTypes = { { type = "number" } }, type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, DistanceJoint = { fields = { getDampingRatio = { args = { { name = "self" } }, description = "Gets the damping ratio.", link = "https://love2d.org/wiki/DistanceJoint:getDampingRatio", returnTypes = { { type = "number" } }, type = "function" }, getFrequency = { args = { { name = "self" } }, description = "Gets the response speed.", link = "https://love2d.org/wiki/DistanceJoint:getFrequency", returnTypes = { { type = "number" } }, type = "function" }, getLength = { args = { { name = "self" } }, description = "Gets the equilibrium distance between the two Bodies.", link = "https://love2d.org/wiki/DistanceJoint:getLength", returnTypes = { { type = "number" } }, type = "function" }, setDampingRatio = { args = { { name = "self" }, { name = "ratio" } }, description = "Sets the damping ratio.", link = "https://love2d.org/wiki/DistanceJoint:setDampingRatio", type = "function" }, setFrequency = { args = { { name = "self" }, { name = "Hz" } }, description = "Sets the response speed.", link = "https://love2d.org/wiki/DistanceJoint:setFrequency", type = "function" }, setLength = { args = { { name = "self" }, { name = "l" } }, description = "Sets the equilibrium distance between the two Bodies.", link = "https://love2d.org/wiki/DistanceJoint:setLength", type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, Drawable = { fields = {}, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, EdgeShape = { fields = { getNextVertex = { args = { { name = "self" } }, description = "Gets the vertex that establishes a connection to the next shape.\n\nSetting next and previous EdgeShape vertices can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.", link = "https://love2d.org/wiki/EdgeShape:getNextVertex", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getPoints = { args = { { name = "self" } }, description = "Returns the local coordinates of the edge points.", link = "https://love2d.org/wiki/EdgeShape:getPoints", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getPreviousVertex = { args = { { name = "self" } }, description = "Gets the vertex that establishes a connection to the previous shape.\n\nSetting next and previous EdgeShape vertices can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.", link = "https://love2d.org/wiki/EdgeShape:getPreviousVertex", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, setNextVertex = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Sets a vertex that establishes a connection to the next shape.\n\nThis can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.", link = "https://love2d.org/wiki/EdgeShape:setNextVertex", type = "function" }, setPreviousVertex = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Sets a vertex that establishes a connection to the previous shape.\n\nThis can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.", link = "https://love2d.org/wiki/EdgeShape:setPreviousVertex", type = "function" } }, metatable = { fields = { __index = { name = "Shape", type = "ref" } }, type = "table" }, type = "table" }, File = { fields = { close = { args = { { name = "self" } }, description = "Closes a file.", link = "https://love2d.org/wiki/File:close", returnTypes = { { type = "boolean" } }, type = "function" }, flush = { args = { { name = "self" } }, description = "Flushes any buffered written data in the file to the disk.", link = "https://love2d.org/wiki/File:flush", returnTypes = { { type = "boolean" }, { type = "string" } }, type = "function" }, getBuffer = { args = { { name = "self" } }, description = "Gets the buffer mode of a file.", link = "https://love2d.org/wiki/File:getBuffer", returnTypes = { { name = "BufferMode", type = "ref" }, { type = "number" } }, type = "function" }, getFilename = { args = { { name = "self" } }, description = "Gets the filename that the File object was created with. If the file object originated from the love.filedropped callback, the filename will be the full platform-dependent file path.", link = "https://love2d.org/wiki/File:getFilename", returnTypes = { { type = "string" } }, type = "function" }, getMode = { args = { { name = "self" } }, description = "Gets the FileMode the file has been opened with.", link = "https://love2d.org/wiki/File:getMode", returnTypes = { { name = "FileMode", type = "ref" } }, type = "function" }, getSize = { args = { { name = "self" } }, description = "Returns the file size.", link = "https://love2d.org/wiki/File:getSize", returnTypes = { { type = "number" } }, type = "function" }, isEOF = { args = { { name = "self" } }, description = "Gets whether end-of-file has been reached.", link = "https://love2d.org/wiki/File:isEOF", returnTypes = { { type = "boolean" } }, type = "function" }, isOpen = { args = { { name = "self" } }, description = "Gets whether the file is open.", link = "https://love2d.org/wiki/File:isOpen", returnTypes = { { type = "boolean" } }, type = "function" }, lines = { args = { { name = "self" } }, description = "Iterate over all the lines in a file", link = "https://love2d.org/wiki/File:lines", returnTypes = { { type = "function" } }, type = "function" }, open = { args = { { name = "self" }, { name = "mode" } }, description = "Open the file for write, read or append.\n\nIf you are getting the error message \"Could not set write directory\", try setting the save directory. This is done either with love.filesystem.setIdentity or by setting the identity field in love.conf.", link = "https://love2d.org/wiki/File:open", returnTypes = { { type = "boolean" } }, type = "function" }, read = { args = { { name = "self" }, { displayName = "[bytes]", name = "bytes" } }, description = "Read a number of bytes from a file.", link = "https://love2d.org/wiki/File:read", returnTypes = { { type = "string" }, { type = "number" } }, type = "function" }, seek = { args = { { name = "self" }, { name = "position" } }, description = "Seek to a position in a file.", link = "https://love2d.org/wiki/File:seek", returnTypes = { { type = "boolean" } }, type = "function" }, setBuffer = { args = { { name = "self" }, { name = "mode" }, { displayName = "[size]", name = "size" } }, description = "Sets the buffer mode for a file opened for writing or appending. Files with buffering enabled will not write data to the disk until the buffer size limit is reached, depending on the buffer mode.", link = "https://love2d.org/wiki/File:setBuffer", returnTypes = { { type = "boolean" }, { type = "string" } }, type = "function" }, tell = { args = { { name = "self" } }, description = "Returns the position in the file.", link = "https://love2d.org/wiki/File:tell", returnTypes = { { type = "number" } }, type = "function" }, write = { args = { { name = "self" }, { name = "data" }, { displayName = "[size]", name = "size" } }, description = "Write data to a file.", link = "https://love2d.org/wiki/File:write", returnTypes = { { type = "boolean" } }, type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, FileData = { fields = { getExtension = { args = { { name = "self" } }, description = "Gets the extension of the FileData.", link = "https://love2d.org/wiki/FileData:getExtension", returnTypes = { { type = "string" } }, type = "function" }, getFilename = { args = { { name = "self" } }, description = "Gets the filename of the FileData.", link = "https://love2d.org/wiki/FileData:getFilename", returnTypes = { { type = "string" } }, type = "function" } }, metatable = { fields = { __index = { name = "Data", type = "ref" } }, type = "table" }, type = "table" }, Fixture = { fields = { destroy = { args = { { name = "self" } }, description = "Destroys the fixture", link = "https://love2d.org/wiki/Fixture:destroy", type = "function" }, getBody = { args = { { name = "self" } }, description = "Returns the body to which the fixture is attached.", link = "https://love2d.org/wiki/Fixture:getBody", returnTypes = { { name = "Body", type = "ref" } }, type = "function" }, getBoundingBox = { args = { { name = "self" }, { displayName = "[index]", name = "index" } }, description = "Returns the points of the fixture bounding box. In case the fixture has multiple children a 1-based index can be specified. For example, a fixture will have multiple children with a chain shape.", link = "https://love2d.org/wiki/Fixture:getBoundingBox", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getCategory = { args = { { name = "self" } }, description = "Returns the categories the fixture belongs to.", link = "https://love2d.org/wiki/Fixture:getCategory", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getDensity = { args = { { name = "self" } }, description = "Returns the density of the fixture.", link = "https://love2d.org/wiki/Fixture:getDensity", returnTypes = { { type = "number" } }, type = "function" }, getFilterData = { args = { { name = "self" } }, description = "Returns the filter data of the fixture. Categories and masks are encoded as the bits of a 16-bit integer.", link = "https://love2d.org/wiki/Fixture:getFilterData", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getFriction = { args = { { name = "self" } }, description = "Returns the friction of the fixture.", link = "https://love2d.org/wiki/Fixture:getFriction", returnTypes = { { type = "number" } }, type = "function" }, getGroupIndex = { args = { { name = "self" } }, description = "Returns the group the fixture belongs to. Fixtures with the same group will always collide if the group is positive or never collide if it's negative. The group zero means no group.\n\nThe groups range from -32768 to 32767.", link = "https://love2d.org/wiki/Fixture:getGroupIndex", returnTypes = { { type = "number" } }, type = "function" }, getMask = { args = { { name = "self" } }, description = "Returns the category mask of the fixture.", link = "https://love2d.org/wiki/Fixture:getMask", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getMassData = { args = { { name = "self" } }, description = "Returns the mass, its center and the rotational inertia.", link = "https://love2d.org/wiki/Fixture:getMassData", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getRestitution = { args = { { name = "self" } }, description = "Returns the restitution of the fixture.", link = "https://love2d.org/wiki/Fixture:getRestitution", returnTypes = { { type = "number" } }, type = "function" }, getShape = { args = { { name = "self" } }, description = "Returns the shape of the fixture. This shape is a reference to the actual data used in the simulation. It's possible to change its values between timesteps.\n\nDo not call any functions on this shape after the parent fixture has been destroyed. This shape will point to an invalid memory address and likely cause crashes if you interact further with it.", link = "https://love2d.org/wiki/Fixture:getShape", returnTypes = { { name = "Shape", type = "ref" } }, type = "function" }, getUserData = { args = { { name = "self" } }, description = "Returns the Lua value associated with this fixture.\n\nUse this function in one thread only.", link = "https://love2d.org/wiki/Fixture:getUserData", returnTypes = { { name = "any", type = "ref" } }, type = "function" }, isDestroyed = { args = { { name = "self" } }, description = "Gets whether the Fixture is destroyed. Destroyed fixtures cannot be used.", link = "https://love2d.org/wiki/Fixture:isDestroyed", returnTypes = { { type = "boolean" } }, type = "function" }, isSensor = { args = { { name = "self" } }, description = "Returns whether the fixture is a sensor.", link = "https://love2d.org/wiki/Fixture:isSensor", returnTypes = { { type = "boolean" } }, type = "function" }, rayCast = { args = { { name = "self" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y1" }, { name = "maxFraction" }, { displayName = "[childIndex]", name = "childIndex" } }, description = "Casts a ray against the shape of the fixture and returns the surface normal vector and the line position where the ray hit. If the ray missed the shape, nil will be returned.\n\nThe ray starts on the first point of the input line and goes towards the second point of the line. The fourth argument is the maximum distance the ray is going to travel as a scale factor of the input line length.\n\nThe childIndex parameter is used to specify which child of a parent shape, such as a ChainShape, will be ray casted. For ChainShapes, the index of 1 is the first edge on the chain. Ray casting a parent shape will only test the child specified so if you want to test every shape of the parent, you must loop through all of its children.\n\nThe world position of the impact can be calculated by multiplying the line vector with the third return value and adding it to the line starting point.\n\nhitx, hity = x1 + (x2 - x1) * fraction, y1 + (y2 - y1) * fraction", link = "https://love2d.org/wiki/Fixture:rayCast", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, setCategory = { args = { { name = "self" }, { name = "category1" }, { name = "category2" }, { name = "..." } }, description = "Sets the categories the fixture belongs to. There can be up to 16 categories represented as a number from 1 to 16.", link = "https://love2d.org/wiki/Fixture:setCategory", type = "function" }, setDensity = { args = { { name = "self" }, { name = "density" } }, description = "Sets the density of the fixture. Call Body:resetMassData if this needs to take effect immediately.", link = "https://love2d.org/wiki/Fixture:setDensity", type = "function" }, setFilterData = { args = { { name = "self" }, { name = "categories" }, { name = "mask" }, { name = "group" } }, description = "Sets the filter data of the fixture.\n\nGroups, categories, and mask can be used to define the collision behaviour of the fixture.\n\nIf two fixtures are in the same group they either always collide if the group is positive, or never collide if it's negative. If the group is zero or they do not match, then the contact filter checks if the fixtures select a category of the other fixture with their masks. The fixtures do not collide if that's not the case. If they do have each other's categories selected, the return value of the custom contact filter will be used. They always collide if none was set.\n\nThere can be up to 16 categories. Categories and masks are encoded as the bits of a 16-bit integer.", link = "https://love2d.org/wiki/Fixture:setFilterData", type = "function" }, setFriction = { args = { { name = "self" }, { name = "friction" } }, description = "Sets the friction of the fixture.", link = "https://love2d.org/wiki/Fixture:setFriction", type = "function" }, setGroupIndex = { args = { { name = "self" }, { name = "group" } }, description = "Sets the group the fixture belongs to. Fixtures with the same group will always collide if the group is positive or never collide if it's negative. The group zero means no group.\n\nThe groups range from -32768 to 32767.", link = "https://love2d.org/wiki/Fixture:setGroupIndex", type = "function" }, setMask = { args = { { name = "self" }, { name = "mask1" }, { name = "mask2" }, { name = "..." } }, description = "Sets the category mask of the fixture. There can be up to 16 categories represented as a number from 1 to 16.\n\nThis fixture will collide with the fixtures that are in the selected categories if the other fixture also has a category of this fixture selected.", link = "https://love2d.org/wiki/Fixture:setMask", type = "function" }, setRestitution = { args = { { name = "self" }, { name = "restitution" } }, description = "Sets the restitution of the fixture.", link = "https://love2d.org/wiki/Fixture:setRestitution", type = "function" }, setSensor = { args = { { name = "self" }, { name = "sensor" } }, description = "Sets whether the fixture should act as a sensor.\n\nSensor do not produce collisions responses, but the begin and end callbacks will still be called for this fixture.", link = "https://love2d.org/wiki/Fixture:setSensor", type = "function" }, setUserData = { args = { { name = "self" }, { name = "value" } }, description = "Associates a Lua value with the fixture.\n\nUse this function in one thread only.", link = "https://love2d.org/wiki/Fixture:setUserData", type = "function" }, testPoint = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Checks if a point is inside the shape of the fixture.", link = "https://love2d.org/wiki/Fixture:testPoint", returnTypes = { { type = "boolean" } }, type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, Font = { fields = { getAscent = { args = { { name = "self" } }, description = "Gets the ascent of the Font. The ascent spans the distance between the baseline and the top of the glyph that reaches farthest from the baseline.", link = "https://love2d.org/wiki/Font:getAscent", returnTypes = { { type = "number" } }, type = "function" }, getBaseline = { args = { { name = "self" } }, description = "Gets the baseline of the Font. Most scripts share the notion of a baseline: an imaginary horizontal line on which characters rest. In some scripts, parts of glyphs lie below the baseline.", link = "https://love2d.org/wiki/Font:getBaseline", returnTypes = { { type = "number" } }, type = "function" }, getDescent = { args = { { name = "self" } }, description = "Gets the descent of the Font. The descent spans the distance between the baseline and the lowest descending glyph in a typeface.", link = "https://love2d.org/wiki/Font:getDescent", returnTypes = { { type = "number" } }, type = "function" }, getFilter = { args = { { name = "self" } }, description = "Gets the filter mode for a font.", link = "https://love2d.org/wiki/Font:getFilter", returnTypes = { { name = "FilterMode", type = "ref" }, { name = "FilterMode", type = "ref" }, { type = "number" } }, type = "function" }, getHeight = { args = { { name = "self" } }, description = "Gets the height of the Font. The height of the font is the size including any spacing; the height which it will need.", link = "https://love2d.org/wiki/Font:getHeight", returnTypes = { { type = "number" } }, type = "function" }, getLineHeight = { args = { { name = "self" } }, description = "Gets the line height. This will be the value previously set by Font:setLineHeight, or 1.0 by default.", link = "https://love2d.org/wiki/Font:getLineHeight", returnTypes = { { type = "number" } }, type = "function" }, getWidth = { args = { { name = "self" }, { name = "line" } }, description = "Determines the horizontal size a line of text needs. Does not support line-breaks.", link = "https://love2d.org/wiki/Font:getWidth", returnTypes = { { type = "number" } }, type = "function" }, getWrap = { args = { { name = "self" }, { name = "text" }, { name = "wraplimit" } }, description = "Gets formatting information for text, given a wrap limit.\n\nThis function accounts for newlines correctly (i.e. '\\n').", link = "https://love2d.org/wiki/Font:getWrap", returnTypes = { { type = "number" }, { type = "table" } }, type = "function" }, hasGlyphs = { link = "https://love2d.org/wiki/Font:hasGlyphs", returnTypes = { { type = "boolean" } }, type = "function", variants = { { args = { { name = "self" }, { name = "character" } }, description = "Gets whether the font can render a particular character." }, { args = { { name = "self" }, { name = "codepoint" } }, description = "Gets whether the font can render a particular character." } } }, setFallbacks = { args = { { name = "self" }, { name = "fallbackfont1" }, { name = "..." } }, description = "Sets the fallback fonts. When the Font doesn't contain a glyph, it will substitute the glyph from the next subsequent fallback Fonts. This is akin to setting a \"font stack\" in Cascading Style Sheets (CSS).", link = "https://love2d.org/wiki/Font:setFallbacks", type = "function" }, setFilter = { args = { { name = "self" }, { name = "min" }, { displayName = "[mag]", name = "mag" }, { displayName = "[anisotropy]", name = "anisotropy" } }, description = "Sets the filter mode for a font.", link = "https://love2d.org/wiki/Font:setFilter", type = "function" }, setLineHeight = { args = { { name = "self" }, { name = "height" } }, description = "Sets the line height. When rendering the font in lines the actual height will be determined by the line height multiplied by the height of the font. The default is 1.0.", link = "https://love2d.org/wiki/Font:setLineHeight", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, FrictionJoint = { fields = { getMaxForce = { args = { { name = "self" } }, description = "Gets the maximum friction force in Newtons.", link = "https://love2d.org/wiki/FrictionJoint:getMaxForce", returnTypes = { { type = "number" } }, type = "function" }, getMaxTorque = { args = { { name = "self" } }, description = "Gets the maximum friction torque in Newton-meters.", link = "https://love2d.org/wiki/FrictionJoint:getMaxTorque", returnTypes = { { type = "number" } }, type = "function" }, setMaxForce = { args = { { name = "self" }, { name = "maxForce" } }, description = "Sets the maximum friction force in Newtons.", link = "https://love2d.org/wiki/FrictionJoint:setMaxForce", type = "function" }, setMaxTorque = { args = { { name = "self" }, { name = "torque" } }, description = "Sets the maximum friction torque in Newton-meters.", link = "https://love2d.org/wiki/FrictionJoint:setMaxTorque", type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, GearJoint = { fields = { getJoints = { args = { { name = "self" } }, description = "Get the Joints connected by this GearJoint.", link = "https://love2d.org/wiki/GearJoint:getJoints", returnTypes = { { name = "Joint", type = "ref" }, { name = "Joint", type = "ref" } }, type = "function" }, getRatio = { args = { { name = "self" } }, description = "Get the ratio of a gear joint.", link = "https://love2d.org/wiki/GearJoint:getRatio", returnTypes = { { type = "number" } }, type = "function" }, setRatio = { args = { { name = "self" }, { name = "ratio" } }, description = "Set the ratio of a gear joint.", link = "https://love2d.org/wiki/GearJoint:setRatio", type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, Image = { fields = { getData = { link = "https://love2d.org/wiki/Image:getData", returnTypes = { { name = "ImageData", type = "ref" } }, type = "function", variants = { { args = { { name = "self" } }, description = "Gets the original ImageData or CompressedImageData used to create the Image.\n\nAll Images keep a reference to the Data that was used to create the Image. The Data is used to refresh the Image when love.window.setMode or Image:refresh is called." }, { args = { { name = "self" } }, description = "Gets the original ImageData or CompressedImageData used to create the Image.\n\nAll Images keep a reference to the Data that was used to create the Image. The Data is used to refresh the Image when love.window.setMode or Image:refresh is called." } } }, getDimensions = { args = { { name = "self" } }, description = "Gets the width and height of the Image.", link = "https://love2d.org/wiki/Image:getDimensions", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getFilter = { args = { { name = "self" } }, description = "Gets the filter mode for an image.", link = "https://love2d.org/wiki/Image:getFilter", returnTypes = { { name = "FilterMode", type = "ref" }, { name = "FilterMode", type = "ref" } }, type = "function" }, getFlags = { args = { { name = "self" } }, description = "Gets the flags used when the image was created.", link = "https://love2d.org/wiki/Image:getFlags", returnTypes = { { type = "table" } }, type = "function" }, getHeight = { args = { { name = "self" } }, description = "Gets the height of the Image.", link = "https://love2d.org/wiki/Image:getHeight", returnTypes = { { type = "number" } }, type = "function" }, getMipmapFilter = { args = { { name = "self" } }, description = "Gets the mipmap filter mode for an Image.", link = "https://love2d.org/wiki/Image:getMipmapFilter", returnTypes = { { name = "FilterMode", type = "ref" }, { type = "number" } }, type = "function" }, getWidth = { args = { { name = "self" } }, description = "Gets the width of the Image.", link = "https://love2d.org/wiki/Image:getWidth", returnTypes = { { type = "number" } }, type = "function" }, getWrap = { args = { { name = "self" } }, description = "Gets the wrapping properties of an Image.\n\nThis function returns the currently set horizontal and vertical wrapping modes for the image.", link = "https://love2d.org/wiki/Image:getWrap", returnTypes = { { name = "WrapMode", type = "ref" }, { name = "WrapMode", type = "ref" } }, type = "function" }, refresh = { link = "https://love2d.org/wiki/Image:refresh", type = "function", variants = { { args = { { name = "self" } }, description = "Reloads the Image's contents from the ImageData or CompressedImageData used to create the image." }, { args = { { name = "self" }, { name = "x" }, { name = "y" }, { name = "width" }, { name = "height" } }, description = "Reloads the Image's contents from the ImageData or CompressedImageData used to create the image." } } }, setFilter = { args = { { name = "self" }, { name = "min" }, { displayName = "[mag]", name = "mag" } }, description = "Sets the filter mode for an image.", link = "https://love2d.org/wiki/Image:setFilter", type = "function" }, setMipmapFilter = { link = "https://love2d.org/wiki/Image:setMipmapFilter", type = "function", variants = { { args = { { name = "self" }, { name = "filtermode" }, { displayName = "[sharpness]", name = "sharpness" } }, description = "Sets the mipmap filter mode for an Image.\n\nMipmapping is useful when drawing an image at a reduced scale. It can improve performance and reduce aliasing issues.\n\nIn 0.10.0 and newer, the Image must be created with the mipmaps flag enabled for the mipmap filter to have any effect." }, { args = { { name = "self" } }, description = "Disables mipmap filtering." } } }, setWrap = { args = { { name = "self" }, { name = "horizontal" }, { displayName = "[vertical]", name = "vertical" } }, description = "Sets the wrapping properties of an Image.\n\nThis function sets the way an Image is repeated when it is drawn with a Quad that is larger than the image's extent. An image may be clamped or set to repeat in both horizontal and vertical directions. Clamped images appear only once, but repeated ones repeat as many times as there is room in the Quad.\n\nIf you use a Quad that is larger than the image extent and do not use repeated tiling, there may be an unwanted visual effect of the image stretching all the way to fill the Quad. If this is the case, setting Image:getWrap(\"repeat\", \"repeat\") for all the images to be repeated, and using Quad of appropriate size will result in the best visual appearance.", link = "https://love2d.org/wiki/Image:setWrap", type = "function" } }, metatable = { fields = { __index = { name = "Texture", type = "ref" } }, type = "table" }, type = "table" }, ImageData = { fields = { encode = { args = { { name = "self" }, { name = "format" }, { displayName = "[filename]", name = "filename" } }, description = "Encodes the ImageData and optionally writes it to the save directory.", link = "https://love2d.org/wiki/ImageData:encode", returnTypes = { { name = "FileData", type = "ref" } }, type = "function" }, getDimensions = { args = { { name = "self" } }, description = "Gets the width and height of the ImageData in pixels.", link = "https://love2d.org/wiki/ImageData:getDimensions", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getHeight = { args = { { name = "self" } }, description = "Gets the height of the ImageData in pixels.", link = "https://love2d.org/wiki/ImageData:getHeight", returnTypes = { { type = "number" } }, type = "function" }, getPixel = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Gets the color of a pixel at a specific position in the image.\n\nValid x and y values start at 0 and go up to image width and height minus 1. Non-integer values are floored.", link = "https://love2d.org/wiki/ImageData:getPixel", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getWidth = { args = { { name = "self" } }, description = "Gets the width of the ImageData in pixels.", link = "https://love2d.org/wiki/ImageData:getWidth", returnTypes = { { type = "number" } }, type = "function" }, mapPixel = { args = { { name = "self" }, { name = "pixelFunction" } }, description = "Transform an image by applying a function to every pixel.\n\nThis function is a higher order function. It takes another function as a parameter, and calls it once for each pixel in the ImageData.\n\nThe function parameter is called with six parameters for each pixel in turn. The parameters are numbers that represent the x and y coordinates of the pixel and its red, green, blue and alpha values. The function parameter can return up to four number values, which become the new r, g, b and a values of the pixel. If the function returns fewer values, the remaining components are set to 0.", link = "https://love2d.org/wiki/ImageData:mapPixel", type = "function" }, paste = { args = { { name = "self" }, { name = "source" }, { name = "dx" }, { name = "dy" }, { name = "sx" }, { name = "sy" }, { name = "sw" }, { name = "sh" } }, description = "Paste into ImageData from another source ImageData.", link = "https://love2d.org/wiki/ImageData:paste", type = "function" }, setPixel = { args = { { name = "self" }, { name = "x" }, { name = "y" }, { name = "r" }, { name = "g" }, { name = "b" }, { name = "a" } }, description = "Sets the color of a pixel at a specific position in the image.\n\nValid x and y values start at 0 and go up to image width and height minus 1.", link = "https://love2d.org/wiki/ImageData:setPixel", type = "function" } }, metatable = { fields = { __index = { name = "Data", type = "ref" } }, type = "table" }, type = "table" }, Joint = { fields = { destroy = { args = { { name = "self" } }, description = "Explicitly destroys the Joint. When you don't have time to wait for garbage collection, this function may be used to free the object immediately, but note that an error will occur if you attempt to use the object after calling this function.", link = "https://love2d.org/wiki/Joint:destroy", type = "function" }, getAnchors = { args = { { name = "self" } }, description = "Get the anchor points of the joint.", link = "https://love2d.org/wiki/Joint:getAnchors", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getBodies = { args = { { name = "self" } }, description = "Gets the bodies that the Joint is attached to.", link = "https://love2d.org/wiki/Joint:getBodies", returnTypes = { { name = "Body", type = "ref" }, { name = "Body", type = "ref" } }, type = "function" }, getCollideConnected = { args = { { name = "self" } }, description = "Gets whether the connected Bodies collide.", link = "https://love2d.org/wiki/Joint:getCollideConnected", returnTypes = { { type = "boolean" } }, type = "function" }, getReactionForce = { args = { { name = "self" } }, description = "Gets the reaction force on Body 2 at the joint anchor.", link = "https://love2d.org/wiki/Joint:getReactionForce", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getReactionTorque = { args = { { name = "self" }, { name = "invdt" } }, description = "Returns the reaction torque on the second body.", link = "https://love2d.org/wiki/Joint:getReactionTorque", returnTypes = { { type = "number" } }, type = "function" }, getType = { args = { { name = "self" } }, description = "Gets a string representing the type.", link = "https://love2d.org/wiki/Joint:getType", returnTypes = { { name = "JointType", type = "ref" } }, type = "function" }, getUserData = { args = { { name = "self" } }, description = "Returns the Lua value associated with this Joint.", link = "https://love2d.org/wiki/Joint:getUserData", returnTypes = { { name = "any", type = "ref" } }, type = "function" }, isDestroyed = { args = { { name = "self" } }, description = "Gets whether the Joint is destroyed. Destroyed joints cannot be used.", link = "https://love2d.org/wiki/Joint:isDestroyed", returnTypes = { { type = "boolean" } }, type = "function" }, setUserData = { args = { { name = "self" }, { name = "value" } }, description = "Associates a Lua value with the Joint.\n\nTo delete the reference, explicitly pass nil.", link = "https://love2d.org/wiki/Joint:setUserData", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, Joystick = { fields = { getAxes = { args = { { name = "self" } }, description = "Gets the direction of each axis.", link = "https://love2d.org/wiki/Joystick:getAxes", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getAxis = { args = { { name = "self" }, { name = "axis" } }, description = "Gets the direction of an axis.", link = "https://love2d.org/wiki/Joystick:getAxis", returnTypes = { { type = "number" } }, type = "function" }, getAxisCount = { args = { { name = "self" } }, description = "Gets the number of axes on the joystick.", link = "https://love2d.org/wiki/Joystick:getAxisCount", returnTypes = { { type = "number" } }, type = "function" }, getButtonCount = { args = { { name = "self" } }, description = "Gets the number of buttons on the joystick.", link = "https://love2d.org/wiki/Joystick:getButtonCount", returnTypes = { { type = "number" } }, type = "function" }, getGUID = { args = { { name = "self" } }, description = "Gets a stable GUID unique to the type of the physical joystick which does not change over time. For example, all Sony Dualshock 3 controllers in OS X have the same GUID. The value is platform-dependent.", link = "https://love2d.org/wiki/Joystick:getGUID", returnTypes = { { type = "string" } }, type = "function" }, getGamepadAxis = { args = { { name = "self" }, { name = "axis" } }, description = "Gets the direction of a virtual gamepad axis. If the Joystick isn't recognized as a gamepad or isn't connected, this function will always return 0.", link = "https://love2d.org/wiki/Joystick:getGamepadAxis", returnTypes = { { type = "number" } }, type = "function" }, getGamepadMapping = { link = "https://love2d.org/wiki/Joystick:getGamepadMapping", returnTypes = { { name = "JoystickInputType", type = "ref" }, { type = "number" }, { name = "JoystickHat", type = "ref" } }, type = "function", variants = { { args = { { name = "self" }, { name = "axis" } }, description = "Gets the button, axis or hat that a virtual gamepad input is bound to." }, { args = { { name = "self" }, { name = "button" } }, description = "Gets the button, axis or hat that a virtual gamepad input is bound to." } } }, getHat = { args = { { name = "self" }, { name = "hat" } }, description = "Gets the direction of the Joystick's hat.", link = "https://love2d.org/wiki/Joystick:getHat", returnTypes = { { name = "JoystickHat", type = "ref" } }, type = "function" }, getHatCount = { args = { { name = "self" } }, description = "Gets the number of hats on the joystick.", link = "https://love2d.org/wiki/Joystick:getHatCount", returnTypes = { { type = "number" } }, type = "function" }, getID = { args = { { name = "self" } }, description = "Gets the joystick's unique identifier. The identifier will remain the same for the life of the game, even when the Joystick is disconnected and reconnected, but it will change when the game is re-launched.", link = "https://love2d.org/wiki/Joystick:getID", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getName = { args = { { name = "self" } }, description = "Gets the name of the joystick.", link = "https://love2d.org/wiki/Joystick:getName", returnTypes = { { type = "string" } }, type = "function" }, getVibration = { args = { { name = "self" } }, description = "Gets the current vibration motor strengths on a Joystick with rumble support.", link = "https://love2d.org/wiki/Joystick:getVibration", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, isConnected = { args = { { name = "self" } }, description = "Gets whether the Joystick is connected.", link = "https://love2d.org/wiki/Joystick:isConnected", returnTypes = { { type = "boolean" } }, type = "function" }, isDown = { args = { { name = "self" }, { name = "..." } }, description = "Checks if a button on the Joystick is pressed.\n\nLÖVE 0.9.0 had a bug which required the button indices passed to Joystick:isDown to be 0-based instead of 1-based, for example button 1 would be 0 for this function. It was fixed in 0.9.1.", link = "https://love2d.org/wiki/Joystick:isDown", returnTypes = { { type = "boolean" } }, type = "function" }, isGamepad = { args = { { name = "self" } }, description = "Gets whether the Joystick is recognized as a gamepad. If this is the case, the Joystick's buttons and axes can be used in a standardized manner across different operating systems and joystick models via Joystick:getGamepadAxis and related functions.\n\nLÖVE automatically recognizes most popular controllers with a similar layout to the Xbox 360 controller as gamepads, but you can add more with love.joystick.setGamepadMapping.", link = "https://love2d.org/wiki/Joystick:isGamepad", returnTypes = { { type = "boolean" } }, type = "function" }, isGamepadDown = { args = { { name = "self" }, { name = "..." } }, description = "Checks if a virtual gamepad button on the Joystick is pressed. If the Joystick is not recognized as a Gamepad or isn't connected, then this function will always return false.", link = "https://love2d.org/wiki/Joystick:isGamepadDown", returnTypes = { { type = "boolean" } }, type = "function" }, isVibrationSupported = { args = { { name = "self" } }, description = "Gets whether the Joystick supports vibration.", link = "https://love2d.org/wiki/Joystick:isVibrationSupported", returnTypes = { { type = "boolean" } }, type = "function" }, setVibration = { link = "https://love2d.org/wiki/Joystick:setVibration", returnTypes = { { type = "boolean" } }, type = "function", variants = { { args = { { name = "self" }, { name = "left" }, { name = "right" } }, description = "Sets the vibration motor speeds on a Joystick with rumble support." }, { args = { { name = "self" } }, description = "Sets the vibration motor speeds on a Joystick with rumble support." }, { args = { { name = "self" }, { name = "left" }, { name = "right" }, { name = "duration" } }, description = "Sets the vibration motor speeds on a Joystick with rumble support." } } } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, Mesh = { fields = { attachAttribute = { args = { { name = "self" }, { name = "name" }, { name = "mesh" } }, description = "Attaches a vertex attribute from a different Mesh onto this Mesh, for use when drawing. This can be used to share vertex attribute data between several different Meshes.", link = "https://love2d.org/wiki/Mesh:attachAttribute", type = "function" }, getDrawMode = { args = { { name = "self" } }, description = "Gets the mode used when drawing the Mesh.", link = "https://love2d.org/wiki/Mesh:getDrawMode", returnTypes = { { name = "MeshDrawMode", type = "ref" } }, type = "function" }, getDrawRange = { args = { { name = "self" } }, description = "Gets the range of vertices used when drawing the Mesh.\n\nIf the Mesh's draw range has not been set previously with Mesh:setDrawRange, this function will return nil.", link = "https://love2d.org/wiki/Mesh:getDrawRange", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getTexture = { args = { { name = "self" } }, description = "Gets the texture (Image or Canvas) used when drawing the Mesh.", link = "https://love2d.org/wiki/Mesh:getTexture", returnTypes = { { name = "Texture", type = "ref" } }, type = "function" }, getVertex = { link = "https://love2d.org/wiki/Mesh:getVertex", returnTypes = { { type = "number" }, { type = "number" } }, type = "function", variants = { { args = { { name = "self" }, { name = "index" } }, description = "Gets the properties of a vertex in the Mesh." }, { args = { { name = "self" }, { name = "index" } }, description = "Gets the properties of a vertex in the Mesh." } } }, getVertexAttribute = { args = { { name = "self" }, { name = "vertexindex" }, { name = "attributeindex" } }, description = "Gets the properties of a specific attribute within a vertex in the Mesh.\n\nMeshes without a custom vertex format specified in love.graphics.newMesh have position as their first attribute, texture coordinates as their second attribute, and color as their third attribute.", link = "https://love2d.org/wiki/Mesh:getVertexAttribute", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getVertexCount = { args = { { name = "self" } }, description = "Returns the total number of vertices in the Mesh.", link = "https://love2d.org/wiki/Mesh:getVertexCount", returnTypes = { { type = "number" } }, type = "function" }, getVertexFormat = { args = { { name = "self" } }, description = "Gets the vertex format that the Mesh was created with.", link = "https://love2d.org/wiki/Mesh:getVertexFormat", returnTypes = { { type = "table" } }, type = "function" }, getVertexMap = { args = { { name = "self" } }, description = "Gets the vertex map for the Mesh. The vertex map describes the order in which the vertices are used when the Mesh is drawn. The vertices, vertex map, and mesh draw mode work together to determine what exactly is displayed on the screen.\n\nIf no vertex map has been set previously via Mesh:setVertexMap, then this function will return nil in LÖVE 0.10.0+, or an empty table in 0.9.2 and older.", link = "https://love2d.org/wiki/Mesh:getVertexMap", returnTypes = { { type = "table" } }, type = "function" }, isAttributeEnabled = { args = { { name = "self" }, { name = "name" } }, description = "Gets whether a specific vertex attribute in the Mesh is enabled. Vertex data from disabled attributes is not used when drawing the Mesh.", link = "https://love2d.org/wiki/Mesh:isAttributeEnabled", returnTypes = { { type = "boolean" } }, type = "function" }, setAttributeEnabled = { args = { { name = "self" }, { name = "name" }, { name = "enable" } }, description = "Enables or disables a specific vertex attribute in the Mesh. Vertex data from disabled attributes is not used when drawing the Mesh.", link = "https://love2d.org/wiki/Mesh:setAttributeEnabled", type = "function" }, setDrawMode = { args = { { name = "self" }, { name = "mode" } }, description = "Sets the mode used when drawing the Mesh.", link = "https://love2d.org/wiki/Mesh:setDrawMode", type = "function" }, setDrawRange = { link = "https://love2d.org/wiki/Mesh:setDrawRange", type = "function", variants = { { args = { { name = "self" }, { name = "min" }, { name = "max" } }, description = "Restricts the drawn vertices of the Mesh to a subset of the total.\n\nIf a vertex map is used with the Mesh, this method will set a subset of the values in the vertex map array to use, instead of a subset of the total vertices in the Mesh.\n\nFor example, if Mesh:setVertexMap(1, 2, 3, 1, 3, 4) and Mesh:setDrawRange(4, 6) are called, vertices 1, 3, and 4 will be drawn." }, { args = { { name = "self" } }, description = "Allows all vertices in the Mesh to be drawn." } } }, setTexture = { link = "https://love2d.org/wiki/Mesh:setTexture", type = "function", variants = { { args = { { name = "self" } }, description = "Sets the texture (Image or Canvas) used when drawing the Mesh.\n\nWhen called without an argument disables the texture. Untextured meshes have a white color by default." }, { args = { { name = "self" }, { name = "texture" } }, description = "Sets the texture (Image or Canvas) used when drawing the Mesh.\n\nWhen called without an argument disables the texture. Untextured meshes have a white color by default." } } }, setVertex = { link = "https://love2d.org/wiki/Mesh:setVertex", type = "function", variants = { { args = { { name = "self" }, { name = "index" }, { name = "attributecomponent" }, { name = "..." } }, description = "Sets the properties of a vertex in the Mesh." }, { args = { { name = "self" }, { name = "index" }, { name = "vertex" } }, description = "Sets the properties of a vertex in the Mesh." }, { args = { { name = "self" }, { name = "index" }, { name = "x" }, { name = "y" }, { name = "u" }, { name = "v" }, { displayName = "[r]", name = "r" }, { displayName = "[g]", name = "g" }, { displayName = "[b]", name = "b" }, { displayName = "[a]", name = "a" } }, description = "Sets the vertex components of a Mesh that wasn't created with a custom vertex format." }, { args = { { name = "self" }, { name = "index" }, { name = "vertex" } }, description = "Sets the vertex components of a Mesh that wasn't created with a custom vertex format." } } }, setVertexAttribute = { args = { { name = "self" }, { name = "vertexindex" }, { name = "attributeindex" }, { name = "value1" }, { name = "value2" }, { name = "..." } }, description = "Sets the properties of a specific attribute within a vertex in the Mesh.\n\nMeshes without a custom vertex format specified in love.graphics.newMesh have position as their first attribute, texture coordinates as their second attribute, and color as their third attribute.", link = "https://love2d.org/wiki/Mesh:setVertexAttribute", type = "function" }, setVertexMap = { link = "https://love2d.org/wiki/Mesh:setVertexMap", type = "function", variants = { { args = { { name = "self" }, { name = "map" } }, description = "Sets the vertex map for the Mesh. The vertex map describes the order in which the vertices are used when the Mesh is drawn. The vertices, vertex map, and mesh draw mode work together to determine what exactly is displayed on the screen.\n\nThe vertex map allows you to re-order or reuse vertices when drawing without changing the actual vertex parameters or duplicating vertices. It is especially useful when combined with different Mesh Draw Modes." }, { args = { { name = "self" }, { name = "vi1" }, { name = "vi2" }, { name = "vi3" } }, description = "Sets the vertex map for the Mesh. The vertex map describes the order in which the vertices are used when the Mesh is drawn. The vertices, vertex map, and mesh draw mode work together to determine what exactly is displayed on the screen.\n\nThe vertex map allows you to re-order or reuse vertices when drawing without changing the actual vertex parameters or duplicating vertices. It is especially useful when combined with different Mesh Draw Modes." } } }, setVertices = { link = "https://love2d.org/wiki/Mesh:setVertices", type = "function", variants = { { args = { { name = "self" }, { name = "vertices" } }, description = "Replaces a range of vertices in the Mesh with new ones. The total number of vertices in a Mesh cannot be changed after it has been created." }, { args = { { name = "self" }, { name = "vertices" } }, description = "Sets the vertex components of a Mesh that wasn't created with a custom vertex format." } } } }, metatable = { fields = { __index = { name = "Drawable", type = "ref" } }, type = "table" }, type = "table" }, MotorJoint = { fields = { getAngularOffset = { args = { { name = "self" } }, description = "Gets the target angular offset between the two Bodies the Joint is attached to.", link = "https://love2d.org/wiki/MotorJoint:getAngularOffset", returnTypes = { { type = "number" } }, type = "function" }, getLinearOffset = { args = { { name = "self" } }, description = "Gets the target linear offset between the two Bodies the Joint is attached to.", link = "https://love2d.org/wiki/MotorJoint:getLinearOffset", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, setAngularOffset = { args = { { name = "self" }, { name = "angularoffset" } }, description = "Sets the target angluar offset between the two Bodies the Joint is attached to.", link = "https://love2d.org/wiki/MotorJoint:setAngularOffset", type = "function" }, setLinearOffset = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Sets the target linear offset between the two Bodies the Joint is attached to.", link = "https://love2d.org/wiki/MotorJoint:setLinearOffset", type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, MouseJoint = { fields = { getDampingRatio = { args = { { name = "self" } }, description = "Returns the damping ratio.", link = "https://love2d.org/wiki/MouseJoint:getDampingRatio", returnTypes = { { type = "number" } }, type = "function" }, getFrequency = { args = { { name = "self" } }, description = "Returns the frequency.", link = "https://love2d.org/wiki/MouseJoint:getFrequency", returnTypes = { { type = "number" } }, type = "function" }, getMaxForce = { args = { { name = "self" } }, description = "Gets the highest allowed force.", link = "https://love2d.org/wiki/MouseJoint:getMaxForce", returnTypes = { { type = "number" } }, type = "function" }, getTarget = { args = { { name = "self" } }, description = "Gets the target point.", link = "https://love2d.org/wiki/MouseJoint:getTarget", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, setDampingRatio = { args = { { name = "self" }, { name = "ratio" } }, description = "Sets a new damping ratio.", link = "https://love2d.org/wiki/MouseJoint:setDampingRatio", type = "function" }, setFrequency = { args = { { name = "self" }, { name = "freq" } }, description = "Sets a new frequency.", link = "https://love2d.org/wiki/MouseJoint:setFrequency", type = "function" }, setMaxForce = { args = { { name = "self" }, { name = "f" } }, description = "Sets the highest allowed force.", link = "https://love2d.org/wiki/MouseJoint:setMaxForce", type = "function" }, setTarget = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Sets the target point.", link = "https://love2d.org/wiki/MouseJoint:setTarget", type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, Object = { fields = { type = { args = { { name = "self" } }, description = "Gets the type of the object as a string.", link = "https://love2d.org/wiki/Object:type", returnTypes = { { type = "string" } }, type = "function" }, typeOf = { args = { { name = "self" }, { name = "name" } }, description = "Checks whether an object is of a certain type. If the object has the type with the specified name in its hierarchy, this function will return true.", link = "https://love2d.org/wiki/Object:typeOf", returnTypes = { { type = "boolean" } }, type = "function" } }, type = "table" }, ParticleSystem = { fields = { clone = { args = { { name = "self" } }, description = "Creates an identical copy of the ParticleSystem in the stopped state.\n\nCloned ParticleSystem inherit all the set-able state of the original ParticleSystem, but they are initialized stopped.", link = "https://love2d.org/wiki/ParticleSystem:clone", returnTypes = { { name = "ParticleSystem", type = "ref" } }, type = "function" }, emit = { args = { { name = "self" }, { name = "numparticles" } }, description = "Emits a burst of particles from the particle emitter.", link = "https://love2d.org/wiki/ParticleSystem:emit", type = "function" }, getAreaSpread = { args = { { name = "self" } }, description = "Gets the area-based spawn parameters for the particles.", link = "https://love2d.org/wiki/ParticleSystem:getAreaSpread", returnTypes = { { name = "AreaSpreadDistribution", type = "ref" }, { type = "number" }, { type = "number" } }, type = "function" }, getBufferSize = { args = { { name = "self" } }, description = "Gets the size of the buffer (the max allowed amount of particles in the system).", link = "https://love2d.org/wiki/ParticleSystem:getBufferSize", returnTypes = { { type = "number" } }, type = "function" }, getColors = { args = { { name = "self" } }, description = "Gets a series of colors to apply to the particle sprite. The particle system will interpolate between each color evenly over the particle's lifetime. Color modulation needs to be activated for this function to have any effect.\n\nArguments are passed in groups of four, representing the components of the desired RGBA value. At least one color must be specified. A maximum of eight may be used.", link = "https://love2d.org/wiki/ParticleSystem:getColors", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getCount = { args = { { name = "self" } }, description = "Gets the amount of particles that are currently in the system.", link = "https://love2d.org/wiki/ParticleSystem:getCount", returnTypes = { { type = "number" } }, type = "function" }, getDirection = { args = { { name = "self" } }, description = "Gets the direction the particles will be emitted in.", link = "https://love2d.org/wiki/ParticleSystem:getDirection", returnTypes = { { type = "number" } }, type = "function" }, getEmissionRate = { args = { { name = "self" } }, description = "Gets the amount of particles emitted per second.", link = "https://love2d.org/wiki/ParticleSystem:getEmissionRate", returnTypes = { { type = "number" } }, type = "function" }, getEmitterLifetime = { args = { { name = "self" } }, description = "Gets how long the particle system should emit particles (if -1 then it emits particles forever).", link = "https://love2d.org/wiki/ParticleSystem:getEmitterLifetime", returnTypes = { { type = "number" } }, type = "function" }, getInsertMode = { args = { { name = "self" } }, description = "Gets the mode to use when the ParticleSystem adds new particles.", link = "https://love2d.org/wiki/ParticleSystem:getInsertMode", returnTypes = { { name = "ParticleInsertMode", type = "ref" } }, type = "function" }, getLinearAcceleration = { args = { { name = "self" } }, description = "Gets the linear acceleration (acceleration along the x and y axes) for particles.\n\nEvery particle created will accelerate along the x and y axes between xmin,ymin and xmax,ymax.", link = "https://love2d.org/wiki/ParticleSystem:getLinearAcceleration", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getLinearDamping = { args = { { name = "self" } }, description = "Gets the amount of linear damping (constant deceleration) for particles.", link = "https://love2d.org/wiki/ParticleSystem:getLinearDamping", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getOffset = { args = { { name = "self" } }, description = "Get the offget position which the particle sprite is rotated around. If this function is not used, the particles rotate around their center.", link = "https://love2d.org/wiki/ParticleSystem:getOffset", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getParticleLifetime = { args = { { name = "self" } }, description = "Gets the life of the particles.", link = "https://love2d.org/wiki/ParticleSystem:getParticleLifetime", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getPosition = { args = { { name = "self" } }, description = "Gets the position of the emitter.", link = "https://love2d.org/wiki/ParticleSystem:getPosition", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getQuads = { args = { { name = "self" } }, description = "Gets the series of Quads used for the particle sprites.", link = "https://love2d.org/wiki/ParticleSystem:getQuads", returnTypes = { { type = "table" } }, type = "function" }, getRadialAcceleration = { args = { { name = "self" } }, description = "Get the radial acceleration (away from the emitter).", link = "https://love2d.org/wiki/ParticleSystem:getRadialAcceleration", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getRotation = { args = { { name = "self" } }, description = "Gets the rotation of the image upon particle creation (in radians).", link = "https://love2d.org/wiki/ParticleSystem:getRotation", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getSizeVariation = { args = { { name = "self" } }, description = "Gets the degree of variation (0 meaning no variation and 1 meaning full variation between start and end).", link = "https://love2d.org/wiki/ParticleSystem:getSizeVariation", returnTypes = { { type = "number" } }, type = "function" }, getSizes = { args = { { name = "self" } }, description = "Gets a series of sizes by which to scale a particle sprite. 1.0 is normal size. The particle system will interpolate between each size evenly over the particle's lifetime.\n\nAt least one size must be specified. A maximum of eight may be used.", link = "https://love2d.org/wiki/ParticleSystem:getSizes", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getSpeed = { args = { { name = "self" } }, description = "Gets the speed of the particles.", link = "https://love2d.org/wiki/ParticleSystem:getSpeed", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getSpin = { args = { { name = "self" } }, description = "Gets the spin of the sprite.", link = "https://love2d.org/wiki/ParticleSystem:getSpin", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getSpinVariation = { args = { { name = "self" } }, description = "Gets the degree of variation (0 meaning no variation and 1 meaning full variation between start and end).", link = "https://love2d.org/wiki/ParticleSystem:getSpinVariation", returnTypes = { { type = "number" } }, type = "function" }, getSpread = { args = { { name = "self" } }, description = "Gets the amount of spread for the system.", link = "https://love2d.org/wiki/ParticleSystem:getSpread", returnTypes = { { type = "number" } }, type = "function" }, getTangentialAcceleration = { args = { { name = "self" } }, description = "Gets the tangential acceleration (acceleration perpendicular to the particle's direction).", link = "https://love2d.org/wiki/ParticleSystem:getTangentialAcceleration", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getTexture = { args = { { name = "self" } }, description = "Gets the Image or Canvas which is to be emitted.", link = "https://love2d.org/wiki/ParticleSystem:getTexture", returnTypes = { { name = "Texture", type = "ref" } }, type = "function" }, hasRelativeRotation = { args = { { name = "self" } }, description = "Gets whether particle angles and rotations are relative to their velocities. If enabled, particles are aligned to the angle of their velocities and rotate relative to that angle.", link = "https://love2d.org/wiki/ParticleSystem:hasRelativeRotation", returnTypes = { { type = "boolean" } }, type = "function" }, isActive = { args = { { name = "self" } }, description = "Checks whether the particle system is actively emitting particles.", link = "https://love2d.org/wiki/ParticleSystem:isActive", returnTypes = { { type = "boolean" } }, type = "function" }, isPaused = { args = { { name = "self" } }, description = "Checks whether the particle system is paused.", link = "https://love2d.org/wiki/ParticleSystem:isPaused", returnTypes = { { type = "boolean" } }, type = "function" }, isStopped = { args = { { name = "self" } }, description = "Checks whether the particle system is stopped.", link = "https://love2d.org/wiki/ParticleSystem:isStopped", returnTypes = { { type = "boolean" } }, type = "function" }, moveTo = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Moves the position of the emitter. This results in smoother particle spawning behaviour than if ParticleSystem:setPosition is used every frame.", link = "https://love2d.org/wiki/ParticleSystem:moveTo", type = "function" }, pause = { args = { { name = "self" } }, description = "Pauses the particle emitter.", link = "https://love2d.org/wiki/ParticleSystem:pause", type = "function" }, reset = { args = { { name = "self" } }, description = "Resets the particle emitter, removing any existing particles and resetting the lifetime counter.", link = "https://love2d.org/wiki/ParticleSystem:reset", type = "function" }, setAreaSpread = { args = { { name = "self" }, { name = "distribution" }, { name = "dx" }, { name = "dy" } }, description = "Sets area-based spawn parameters for the particles. Newly created particles will spawn in an area around the emitter based on the parameters to this function.", link = "https://love2d.org/wiki/ParticleSystem:setAreaSpread", type = "function" }, setBufferSize = { args = { { name = "self" }, { name = "buffer" } }, description = "Sets the size of the buffer (the max allowed amount of particles in the system).", link = "https://love2d.org/wiki/ParticleSystem:setBufferSize", type = "function" }, setColors = { args = { { name = "self" }, { name = "r1" }, { name = "g1" }, { name = "b1" }, { name = "a1" }, { name = "r2" }, { name = "g2" }, { name = "b2" }, { name = "a2" }, { name = "..." } }, description = "Sets a series of colors to apply to the particle sprite. The particle system will interpolate between each color evenly over the particle's lifetime. Color modulation needs to be activated for this function to have any effect.\n\nArguments are passed in groups of four, representing the components of the desired RGBA value. At least one color must be specified. A maximum of eight may be used.", link = "https://love2d.org/wiki/ParticleSystem:setColors", type = "function" }, setDirection = { args = { { name = "self" }, { name = "direction" } }, description = "Sets the direction the particles will be emitted in.", link = "https://love2d.org/wiki/ParticleSystem:setDirection", type = "function" }, setEmissionRate = { args = { { name = "self" }, { name = "rate" } }, description = "Sets the amount of particles emitted per second.", link = "https://love2d.org/wiki/ParticleSystem:setEmissionRate", type = "function" }, setEmitterLifetime = { args = { { name = "self" }, { name = "life" } }, description = "Sets how long the particle system should emit particles (if -1 then it emits particles forever).", link = "https://love2d.org/wiki/ParticleSystem:setEmitterLifetime", type = "function" }, setInsertMode = { args = { { name = "self" }, { name = "mode" } }, description = "Sets the mode to use when the ParticleSystem adds new particles.", link = "https://love2d.org/wiki/ParticleSystem:setInsertMode", type = "function" }, setLinearAcceleration = { args = { { name = "self" }, { name = "xmin" }, { displayName = "[ymin]", name = "ymin" }, { displayName = "[xmax]", name = "xmax" }, { displayName = "[ymax]", name = "ymax" } }, description = "Sets the linear acceleration (acceleration along the x and y axes) for particles.\n\nEvery particle created will accelerate along the x and y axes between xmin,ymin and xmax,ymax.", link = "https://love2d.org/wiki/ParticleSystem:setLinearAcceleration", type = "function" }, setLinearDamping = { args = { { name = "self" }, { name = "min" }, { name = "max" } }, description = "Sets the amount of linear damping (constant deceleration) for particles.", link = "https://love2d.org/wiki/ParticleSystem:setLinearDamping", type = "function" }, setOffset = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Set the offset position which the particle sprite is rotated around. If this function is not used, the particles rotate around their center.", link = "https://love2d.org/wiki/ParticleSystem:setOffset", type = "function" }, setParticleLifetime = { args = { { name = "self" }, { name = "min" }, { displayName = "[max]", name = "max" } }, description = "Sets the life of the particles.", link = "https://love2d.org/wiki/ParticleSystem:setParticleLifetime", type = "function" }, setPosition = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Sets the position of the emitter.", link = "https://love2d.org/wiki/ParticleSystem:setPosition", type = "function" }, setQuads = { link = "https://love2d.org/wiki/ParticleSystem:setQuads", type = "function", variants = { { args = { { name = "self" }, { name = "quad1" }, { name = "quad2" } }, description = "Sets a series of Quads to use for the particle sprites. Particles will choose a Quad from the list based on the particle's current lifetime, allowing for the use of animated sprite sheets with ParticleSystems." }, { args = { { name = "self" }, { name = "quads" } }, description = "Sets a series of Quads to use for the particle sprites. Particles will choose a Quad from the list based on the particle's current lifetime, allowing for the use of animated sprite sheets with ParticleSystems." } } }, setRadialAcceleration = { args = { { name = "self" }, { name = "min" }, { displayName = "[max]", name = "max" } }, description = "Set the radial acceleration (away from the emitter).", link = "https://love2d.org/wiki/ParticleSystem:setRadialAcceleration", type = "function" }, setRelativeRotation = { args = { { name = "self" }, { name = "enable" } }, description = "Sets whether particle angles and rotations are relative to their velocities. If enabled, particles are aligned to the angle of their velocities and rotate relative to that angle.", link = "https://love2d.org/wiki/ParticleSystem:setRelativeRotation", type = "function" }, setRotation = { args = { { name = "self" }, { name = "min" }, { displayName = "[max]", name = "max" } }, description = "Sets the rotation of the image upon particle creation (in radians).", link = "https://love2d.org/wiki/ParticleSystem:setRotation", type = "function" }, setSizeVariation = { args = { { name = "self" }, { name = "variation" } }, description = "Sets the degree of variation (0 meaning no variation and 1 meaning full variation between start and end).", link = "https://love2d.org/wiki/ParticleSystem:setSizeVariation", type = "function" }, setSizes = { args = { { name = "self" }, { name = "size1" }, { name = "size2" }, { name = "..." } }, description = "Sets a series of sizes by which to scale a particle sprite. 1.0 is normal size. The particle system will interpolate between each size evenly over the particle's lifetime.\n\nAt least one size must be specified. A maximum of eight may be used.", link = "https://love2d.org/wiki/ParticleSystem:setSizes", type = "function" }, setSpeed = { args = { { name = "self" }, { name = "min" }, { displayName = "[max]", name = "max" } }, description = "Sets the speed of the particles.", link = "https://love2d.org/wiki/ParticleSystem:setSpeed", type = "function" }, setSpin = { args = { { name = "self" }, { name = "min" }, { displayName = "[max]", name = "max" } }, description = "Sets the spin of the sprite.", link = "https://love2d.org/wiki/ParticleSystem:setSpin", type = "function" }, setSpinVariation = { args = { { name = "self" }, { name = "variation" } }, description = "Sets the degree of variation (0 meaning no variation and 1 meaning full variation between start and end).", link = "https://love2d.org/wiki/ParticleSystem:setSpinVariation", type = "function" }, setSpread = { args = { { name = "self" }, { name = "spread" } }, description = "Sets the amount of spread for the system.", link = "https://love2d.org/wiki/ParticleSystem:setSpread", type = "function" }, setTangentialAcceleration = { args = { { name = "self" }, { name = "min" }, { displayName = "[max]", name = "max" } }, description = "Sets the tangential acceleration (acceleration perpendicular to the particle's direction).", link = "https://love2d.org/wiki/ParticleSystem:setTangentialAcceleration", type = "function" }, setTexture = { args = { { name = "self" }, { name = "texture" } }, description = "Sets the Image or Canvas which is to be emitted.", link = "https://love2d.org/wiki/ParticleSystem:setTexture", type = "function" }, start = { args = { { name = "self" } }, description = "Starts the particle emitter.", link = "https://love2d.org/wiki/ParticleSystem:start", type = "function" }, stop = { args = { { name = "self" } }, description = "Stops the particle emitter, resetting the lifetime counter.", link = "https://love2d.org/wiki/ParticleSystem:stop", type = "function" }, update = { args = { { name = "self" }, { name = "dt" } }, description = "Updates the particle system; moving, creating and killing particles.", link = "https://love2d.org/wiki/ParticleSystem:update", type = "function" } }, metatable = { fields = { __index = { name = "Drawable", type = "ref" } }, type = "table" }, type = "table" }, PolygonShape = { fields = { getPoints = { args = { { name = "self" } }, description = "Get the local coordinates of the polygon's vertices.\n\nThis function has a variable number of return values. It can be used in a nested fashion with love.graphics.polygon.\n\nThis function may have up to 16 return values, since it returns two values for each vertex in the polygon. In other words, it can return the coordinates of up to 8 points.", link = "https://love2d.org/wiki/PolygonShape:getPoints", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" } }, metatable = { fields = { __index = { name = "Shape", type = "ref" } }, type = "table" }, type = "table" }, PrismaticJoint = { fields = { getAxis = { args = { { name = "self" } }, description = "Gets the world-space axis vector of the Prismatic Joint.", link = "https://love2d.org/wiki/PrismaticJoint:getAxis", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getJointSpeed = { args = { { name = "self" } }, description = "Get the current joint angle speed.", link = "https://love2d.org/wiki/PrismaticJoint:getJointSpeed", returnTypes = { { type = "number" } }, type = "function" }, getJointTranslation = { args = { { name = "self" } }, description = "Get the current joint translation.", link = "https://love2d.org/wiki/PrismaticJoint:getJointTranslation", returnTypes = { { type = "number" } }, type = "function" }, getLimits = { args = { { name = "self" } }, description = "Gets the joint limits.", link = "https://love2d.org/wiki/PrismaticJoint:getLimits", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getLowerLimit = { args = { { name = "self" } }, description = "Gets the lower limit.", link = "https://love2d.org/wiki/PrismaticJoint:getLowerLimit", returnTypes = { { type = "number" } }, type = "function" }, getMaxMotorForce = { args = { { name = "self" } }, description = "Gets the maximum motor force.", link = "https://love2d.org/wiki/PrismaticJoint:getMaxMotorForce", returnTypes = { { type = "number" } }, type = "function" }, getMotorForce = { args = { { name = "self" } }, description = "Get the current motor force.", link = "https://love2d.org/wiki/PrismaticJoint:getMotorForce", returnTypes = { { type = "number" } }, type = "function" }, getMotorSpeed = { args = { { name = "self" } }, description = "Gets the motor speed.", link = "https://love2d.org/wiki/PrismaticJoint:getMotorSpeed", returnTypes = { { type = "number" } }, type = "function" }, getUpperLimit = { args = { { name = "self" } }, description = "Gets the upper limit.", link = "https://love2d.org/wiki/PrismaticJoint:getUpperLimit", returnTypes = { { type = "number" } }, type = "function" }, hasLimitsEnabled = { args = { { name = "self" } }, description = "Checks whether the limits are enabled.", link = "https://love2d.org/wiki/PrismaticJoint:hasLimitsEnabled", returnTypes = { { type = "boolean" } }, type = "function" }, isMotorEnabled = { args = { { name = "self" } }, description = "Checks whether the motor is enabled.", link = "https://love2d.org/wiki/PrismaticJoint:isMotorEnabled", returnTypes = { { type = "boolean" } }, type = "function" }, setLimits = { args = { { name = "self" }, { name = "lower" }, { name = "upper" } }, description = "Sets the limits.", link = "https://love2d.org/wiki/PrismaticJoint:setLimits", type = "function" }, setLimitsEnabled = { args = { { name = "self" }, { name = "enable" } }, description = "Enables or disables the limits of the joint.", link = "https://love2d.org/wiki/PrismaticJoint:setLimitsEnabled", type = "function" }, setLowerLimit = { args = { { name = "self" }, { name = "lower" } }, description = "Sets the lower limit.", link = "https://love2d.org/wiki/PrismaticJoint:setLowerLimit", type = "function" }, setMaxMotorForce = { args = { { name = "self" }, { name = "f" } }, description = "Set the maximum motor force.", link = "https://love2d.org/wiki/PrismaticJoint:setMaxMotorForce", type = "function" }, setMotorEnabled = { args = { { name = "self" }, { name = "enable" } }, description = "Starts or stops the joint motor.", link = "https://love2d.org/wiki/PrismaticJoint:setMotorEnabled", type = "function" }, setMotorSpeed = { args = { { name = "self" }, { name = "s" } }, description = "Sets the motor speed.", link = "https://love2d.org/wiki/PrismaticJoint:setMotorSpeed", type = "function" }, setUpperLimit = { args = { { name = "self" }, { name = "upper" } }, description = "Sets the upper limit.", link = "https://love2d.org/wiki/PrismaticJoint:setUpperLimit", type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, PulleyJoint = { fields = { getConstant = { args = { { name = "self" } }, description = "Get the total length of the rope.", link = "https://love2d.org/wiki/PulleyJoint:getConstant", returnTypes = { { type = "number" } }, type = "function" }, getGroundAnchors = { args = { { name = "self" } }, description = "Get the ground anchor positions in world coordinates.", link = "https://love2d.org/wiki/PulleyJoint:getGroundAnchors", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getLengthA = { args = { { name = "self" } }, description = "Get the current length of the rope segment attached to the first body.", link = "https://love2d.org/wiki/PulleyJoint:getLengthA", returnTypes = { { type = "number" } }, type = "function" }, getLengthB = { args = { { name = "self" } }, description = "Get the current length of the rope segment attached to the second body.", link = "https://love2d.org/wiki/PulleyJoint:getLengthB", returnTypes = { { type = "number" } }, type = "function" }, getMaxLengths = { args = { { name = "self" } }, description = "Get the maximum lengths of the rope segments.", link = "https://love2d.org/wiki/PulleyJoint:getMaxLengths", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getRatio = { args = { { name = "self" } }, description = "Get the pulley ratio.", link = "https://love2d.org/wiki/PulleyJoint:getRatio", returnTypes = { { type = "number" } }, type = "function" }, setConstant = { args = { { name = "self" }, { name = "length" } }, description = "Set the total length of the rope.\n\nSetting a new length for the rope updates the maximum length values of the joint.", link = "https://love2d.org/wiki/PulleyJoint:setConstant", type = "function" }, setMaxLengths = { args = { { name = "self" }, { name = "max1" }, { name = "max2" } }, description = "Set the maximum lengths of the rope segments.\n\nThe physics module also imposes maximum values for the rope segments. If the parameters exceed these values, the maximum values are set instead of the requested values.", link = "https://love2d.org/wiki/PulleyJoint:setMaxLengths", type = "function" }, setRatio = { args = { { name = "self" }, { name = "ratio" } }, description = "Set the pulley ratio.", link = "https://love2d.org/wiki/PulleyJoint:setRatio", type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, Quad = { fields = { getTextureDimensions = { args = { { name = "self" } }, description = "Gets reference texture dimensions initially specified in love.graphics.newQuad.", link = "https://love2d.org/wiki/Quad:getTextureDimensions", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getViewport = { args = { { name = "self" } }, description = "Gets the current viewport of this Quad.", link = "https://love2d.org/wiki/Quad:getViewport", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, setViewport = { args = { { name = "self" }, { name = "x" }, { name = "y" }, { name = "w" }, { name = "h" } }, description = "Sets the texture coordinates according to a viewport.", link = "https://love2d.org/wiki/Quad:setViewport", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, RandomGenerator = { fields = { getSeed = { args = { { name = "self" } }, description = "Gets the state of the random number generator.\n\nThe state is split into two numbers due to Lua's use of doubles for all number values - doubles can't accurately represent integer values above 2^53.", link = "https://love2d.org/wiki/RandomGenerator:getSeed", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getState = { args = { { name = "self" } }, description = "Gets the current state of the random number generator. This returns an opaque implementation-dependent string which is only useful for later use with RandomGenerator:setState.\n\nThis is different from RandomGenerator:getSeed in that getState gets the RandomGenerator's current state, whereas getSeed gets the previously set seed number.\n\nThe value of the state string does not depend on the current operating system.", link = "https://love2d.org/wiki/RandomGenerator:getState", returnTypes = { { type = "string" } }, type = "function" }, random = { link = "https://love2d.org/wiki/RandomGenerator:random", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "self" } }, description = "Get uniformly distributed pseudo-random number within [0, 1]." }, { args = { { name = "self" }, { name = "max" } }, description = "Get uniformly distributed pseudo-random integer number within [1, max]." }, { args = { { name = "self" }, { name = "min" }, { name = "max" } }, description = "Get uniformly distributed pseudo-random integer number within [min, max]." } } }, randomNormal = { args = { { name = "self" }, { displayName = "[stddev]", name = "stddev" }, { displayName = "[mean]", name = "mean" } }, description = "Get a normally distributed pseudo random number.", link = "https://love2d.org/wiki/RandomGenerator:randomNormal", returnTypes = { { type = "number" } }, type = "function" }, setSeed = { link = "https://love2d.org/wiki/RandomGenerator:setSeed", type = "function", variants = { { args = { { name = "self" }, { name = "seed" } }, description = "Sets the seed of the random number generator using the specified integer number." }, { args = { { name = "self" }, { name = "low" }, { displayName = "[high]", name = "high" } }, description = "Sets the seed of the random number generator using the specified integer number." } } }, setState = { args = { { name = "self" }, { name = "state" } }, description = "Sets the current state of the random number generator. The value used as an argument for this function is an opaque implementation-dependent string and should only originate from a previous call to RandomGenerator:getState.\n\nThis is different from RandomGenerator:setSeed in that setState directly sets the RandomGenerator's current implementation-dependent state, whereas setSeed gives it a new seed value.\n\nThe effect of the state string does not depend on the current operating system.", link = "https://love2d.org/wiki/RandomGenerator:setState", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, RevoluteJoint = { fields = { getJointAngle = { args = { { name = "self" } }, description = "Get the current joint angle.", link = "https://love2d.org/wiki/RevoluteJoint:getJointAngle", returnTypes = { { type = "number" } }, type = "function" }, getJointSpeed = { args = { { name = "self" } }, description = "Get the current joint angle speed.", link = "https://love2d.org/wiki/RevoluteJoint:getJointSpeed", returnTypes = { { type = "number" } }, type = "function" }, getLimits = { args = { { name = "self" } }, description = "Gets the joint limits.", link = "https://love2d.org/wiki/RevoluteJoint:getLimits", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getLowerLimit = { args = { { name = "self" } }, description = "Gets the lower limit.", link = "https://love2d.org/wiki/RevoluteJoint:getLowerLimit", returnTypes = { { type = "number" } }, type = "function" }, getMaxMotorTorque = { args = { { name = "self" } }, description = "Gets the maximum motor force.", link = "https://love2d.org/wiki/RevoluteJoint:getMaxMotorTorque", returnTypes = { { type = "number" } }, type = "function" }, getMotorSpeed = { args = { { name = "self" } }, description = "Gets the motor speed.", link = "https://love2d.org/wiki/RevoluteJoint:getMotorSpeed", returnTypes = { { type = "number" } }, type = "function" }, getMotorTorque = { args = { { name = "self" } }, description = "Get the current motor force.", link = "https://love2d.org/wiki/RevoluteJoint:getMotorTorque", returnTypes = { { type = "number" } }, type = "function" }, getUpperLimit = { args = { { name = "self" } }, description = "Gets the upper limit.", link = "https://love2d.org/wiki/RevoluteJoint:getUpperLimit", returnTypes = { { type = "number" } }, type = "function" }, hasLimitsEnabled = { args = { { name = "self" } }, description = "Checks whether limits are enabled.", link = "https://love2d.org/wiki/RevoluteJoint:hasLimitsEnabled", returnTypes = { { type = "boolean" } }, type = "function" }, isMotorEnabled = { args = { { name = "self" } }, description = "Checks whether the motor is enabled.", link = "https://love2d.org/wiki/RevoluteJoint:isMotorEnabled", returnTypes = { { type = "boolean" } }, type = "function" }, setLimits = { args = { { name = "self" }, { name = "lower" }, { name = "upper" } }, description = "Sets the limits.", link = "https://love2d.org/wiki/RevoluteJoint:setLimits", type = "function" }, setLimitsEnabled = { args = { { name = "self" }, { name = "enable" } }, description = "Enables or disables the joint limits.", link = "https://love2d.org/wiki/RevoluteJoint:setLimitsEnabled", type = "function" }, setLowerLimit = { args = { { name = "self" }, { name = "lower" } }, description = "Sets the lower limit.", link = "https://love2d.org/wiki/RevoluteJoint:setLowerLimit", type = "function" }, setMaxMotorTorque = { args = { { name = "self" }, { name = "f" } }, description = "Set the maximum motor force.", link = "https://love2d.org/wiki/RevoluteJoint:setMaxMotorTorque", type = "function" }, setMotorEnabled = { args = { { name = "self" }, { name = "enable" } }, description = "Starts or stops the joint motor.", link = "https://love2d.org/wiki/RevoluteJoint:setMotorEnabled", type = "function" }, setMotorSpeed = { args = { { name = "self" }, { name = "s" } }, description = "Sets the motor speed.", link = "https://love2d.org/wiki/RevoluteJoint:setMotorSpeed", type = "function" }, setUpperLimit = { args = { { name = "self" }, { name = "upper" } }, description = "Sets the upper limit.", link = "https://love2d.org/wiki/RevoluteJoint:setUpperLimit", type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, RopeJoint = { fields = { getMaxLength = { args = { { name = "self" } }, description = "Gets the maximum length of a RopeJoint.", link = "https://love2d.org/wiki/RopeJoint:getMaxLength", returnTypes = { { type = "number" } }, type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, Shader = { fields = { getExternVariable = { args = { { name = "self" }, { name = "name" } }, description = "Gets information about an 'extern' ('uniform') variable in the shader.", link = "https://love2d.org/wiki/Shader:getExternVariable", returnTypes = { { name = "ShaderVariableType", type = "ref" }, { type = "number" }, { type = "number" } }, type = "function" }, getWarnings = { args = { { name = "self" } }, description = "Returns any warning and error messages from compiling the shader code. This can be used for debugging your shaders if there's anything the graphics hardware doesn't like.", link = "https://love2d.org/wiki/Shader:getWarnings", returnTypes = { { type = "string" } }, type = "function" }, send = { link = "https://love2d.org/wiki/Shader:send", type = "function", variants = { { args = { { name = "self" }, { name = "name" }, { name = "number" }, { name = "..." } }, description = "Sends one or more values to a special (uniform) variable inside the shader. Uniform variables have to be marked using the uniform or extern keyword." }, { args = { { name = "self" }, { name = "name" }, { name = "vector" }, { name = "..." } }, description = "Sends one or more values to a special (uniform) variable inside the shader. Uniform variables have to be marked using the uniform or extern keyword." }, { args = { { name = "self" }, { name = "name" }, { name = "matrix" }, { name = "..." } }, description = "Sends one or more values to a special (uniform) variable inside the shader. Uniform variables have to be marked using the uniform or extern keyword." }, { args = { { name = "self" }, { name = "name" }, { name = "texture" } }, description = "Sends one or more values to a special (uniform) variable inside the shader. Uniform variables have to be marked using the uniform or extern keyword." }, { args = { { name = "self" }, { name = "name" }, { name = "boolean" }, { name = "..." } }, description = "Sends one or more values to a special (uniform) variable inside the shader. Uniform variables have to be marked using the uniform or extern keyword." } } }, sendColor = { args = { { name = "self" }, { name = "name" }, { name = "color" }, { name = "..." } }, description = "Sends one or more colors to a special (extern / uniform) vec3 or vec4 variable inside the shader. The color components must be in the range of [0, 255], unlike Shader:send. The colors are gamma-corrected if global gamma-correction is enabled.", link = "https://love2d.org/wiki/Shader:sendColor", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, Shape = { fields = { computeAABB = { args = { { name = "self" }, { name = "tx" }, { name = "ty" }, { name = "tr" }, { displayName = "[childIndex]", name = "childIndex" } }, description = "Returns the points of the bounding box for the transformed shape.", link = "https://love2d.org/wiki/Shape:computeAABB", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, computeMass = { args = { { name = "self" }, { name = "density" } }, description = "Computes the mass properties for the shape with the specified density.", link = "https://love2d.org/wiki/Shape:computeMass", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getChildCount = { args = { { name = "self" } }, description = "Returns the number of children the shape has.", link = "https://love2d.org/wiki/Shape:getChildCount", returnTypes = { { type = "number" } }, type = "function" }, getRadius = { args = { { name = "self" } }, description = "Gets the radius of the shape.", link = "https://love2d.org/wiki/Shape:getRadius", returnTypes = { { type = "number" } }, type = "function" }, getType = { args = { { name = "self" } }, description = "Gets a string representing the Shape. This function can be useful for conditional debug drawing.", link = "https://love2d.org/wiki/Shape:getType", returnTypes = { { name = "ShapeType", type = "ref" } }, type = "function" }, rayCast = { args = { { name = "self" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "maxFraction" }, { name = "tx" }, { name = "ty" }, { name = "tr" }, { displayName = "[childIndex]", name = "childIndex" } }, description = "Casts a ray against the shape and returns the surface normal vector and the line position where the ray hit. If the ray missed the shape, nil will be returned. The Shape can be transformed to get it into the desired position.\n\nThe ray starts on the first point of the input line and goes towards the second point of the line. The fourth argument is the maximum distance the ray is going to travel as a scale factor of the input line length.\n\nThe childIndex parameter is used to specify which child of a parent shape, such as a ChainShape, will be ray casted. For ChainShapes, the index of 1 is the first edge on the chain. Ray casting a parent shape will only test the child specified so if you want to test every shape of the parent, you must loop through all of its children.\n\nThe world position of the impact can be calculated by multiplying the line vector with the third return value and adding it to the line starting point.\n\nhitx, hity = x1 + (x2 - x1) * fraction, y1 + (y2 - y1) * fraction", link = "https://love2d.org/wiki/Shape:rayCast", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, testPoint = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Checks whether a point lies inside the shape. This is particularly useful for mouse interaction with the shapes. By looping through all shapes and testing the mouse position with this function, we can find which shapes the mouse touches.", link = "https://love2d.org/wiki/Shape:testPoint", returnTypes = { { type = "boolean" } }, type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, SoundData = { fields = { getBitDepth = { args = { { name = "self" } }, description = "Returns the number of bits per sample.", link = "https://love2d.org/wiki/SoundData:getBitDepth", returnTypes = { { type = "number" } }, type = "function" }, getChannels = { args = { { name = "self" } }, description = "Returns the number of channels in the stream.", link = "https://love2d.org/wiki/SoundData:getChannels", returnTypes = { { type = "number" } }, type = "function" }, getDuration = { args = { { name = "self" } }, description = "Gets the duration of the sound data.", link = "https://love2d.org/wiki/SoundData:getDuration", returnTypes = { { type = "number" } }, type = "function" }, getSample = { args = { { name = "self" }, { name = "i" } }, description = "Gets the sample at the specified position.", link = "https://love2d.org/wiki/SoundData:getSample", returnTypes = { { type = "number" } }, type = "function" }, getSampleCount = { args = { { name = "self" } }, description = "Returns the number of samples per channel of the SoundData.", link = "https://love2d.org/wiki/SoundData:getSampleCount", returnTypes = { { type = "number" } }, type = "function" }, getSampleRate = { args = { { name = "self" } }, description = "Returns the sample rate of the SoundData.", link = "https://love2d.org/wiki/SoundData:getSampleRate", returnTypes = { { type = "number" } }, type = "function" }, setSample = { args = { { name = "self" }, { name = "i" }, { name = "sample" } }, description = "Sets the sample at the specified position.", link = "https://love2d.org/wiki/SoundData:setSample", type = "function" } }, metatable = { fields = { __index = { name = "Data", type = "ref" } }, type = "table" }, type = "table" }, Source = { fields = { clone = { args = { { name = "self" } }, description = "Creates an identical copy of the Source in the stopped state.\n\nStatic Sources will use significantly less memory and take much less time to be created if Source:clone is used to create them instead of love.audio.newSource, so this method should be preferred when making multiple Sources which play the same sound.\n\nCloned Sources inherit all the set-able state of the original Source, but they are initialized stopped.", link = "https://love2d.org/wiki/Source:clone", returnTypes = { { name = "Source", type = "ref" } }, type = "function" }, getAttenuationDistances = { args = { { name = "self" } }, description = "Returns the reference and maximum distance of the source.", link = "https://love2d.org/wiki/Source:getAttenuationDistances", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getChannels = { args = { { name = "self" } }, description = "Gets the number of channels in the Source. Only 1-channel (mono) Sources can use directional and positional effects.", link = "https://love2d.org/wiki/Source:getChannels", returnTypes = { { type = "number" } }, type = "function" }, getCone = { args = { { name = "self" } }, description = "Gets the Source's directional volume cones. Together with Source:setDirection, the cone angles allow for the Source's volume to vary depending on its direction.", link = "https://love2d.org/wiki/Source:getCone", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getDirection = { args = { { name = "self" } }, description = "Gets the direction of the Source.", link = "https://love2d.org/wiki/Source:getDirection", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getDuration = { args = { { name = "self" }, { displayName = "[unit]", name = "unit" } }, description = "Gets the duration of the Source. For streaming Sources it may not always be sample-accurate, and may return -1 if the duration cannot be determined at all.", link = "https://love2d.org/wiki/Source:getDuration", returnTypes = { { type = "number" } }, type = "function" }, getPitch = { args = { { name = "self" } }, description = "Gets the current pitch of the Source.", link = "https://love2d.org/wiki/Source:getPitch", returnTypes = { { type = "number" } }, type = "function" }, getPosition = { args = { { name = "self" } }, description = "Gets the position of the Source.", link = "https://love2d.org/wiki/Source:getPosition", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getRolloff = { args = { { name = "self" } }, description = "Returns the rolloff factor of the source.", link = "https://love2d.org/wiki/Source:getRolloff", returnTypes = { { type = "number" } }, type = "function" }, getType = { args = { { name = "self" } }, description = "Gets the type (static or stream) of the Source.", link = "https://love2d.org/wiki/Source:getType", returnTypes = { { name = "SourceType", type = "ref" } }, type = "function" }, getVelocity = { args = { { name = "self" } }, description = "Gets the velocity of the Source.", link = "https://love2d.org/wiki/Source:getVelocity", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getVolume = { args = { { name = "self" } }, description = "Gets the current volume of the Source.", link = "https://love2d.org/wiki/Source:getVolume", returnTypes = { { type = "number" } }, type = "function" }, getVolumeLimits = { args = { { name = "self" } }, description = "Returns the volume limits of the source.", link = "https://love2d.org/wiki/Source:getVolumeLimits", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, isLooping = { args = { { name = "self" } }, description = "Returns whether the Source will loop.", link = "https://love2d.org/wiki/Source:isLooping", returnTypes = { { type = "boolean" } }, type = "function" }, isPaused = { args = { { name = "self" } }, description = "Returns whether the Source is paused.", link = "https://love2d.org/wiki/Source:isPaused", returnTypes = { { type = "boolean" } }, type = "function" }, isPlaying = { args = { { name = "self" } }, description = "Returns whether the Source is playing.", link = "https://love2d.org/wiki/Source:isPlaying", returnTypes = { { type = "boolean" } }, type = "function" }, isStopped = { args = { { name = "self" } }, description = "Returns whether the Source is stopped.", link = "https://love2d.org/wiki/Source:isStopped", returnTypes = { { type = "boolean" } }, type = "function" }, pause = { args = { { name = "self" } }, description = "Pauses the Source.", link = "https://love2d.org/wiki/Source:pause", type = "function" }, play = { args = { { name = "self" } }, description = "Starts playing the Source.", link = "https://love2d.org/wiki/Source:play", returnTypes = { { type = "boolean" } }, type = "function" }, resume = { args = { { name = "self" } }, description = "Resumes a paused Source.", link = "https://love2d.org/wiki/Source:resume", type = "function" }, rewind = { args = { { name = "self" } }, description = "Rewinds a Source.", link = "https://love2d.org/wiki/Source:rewind", type = "function" }, seek = { args = { { name = "self" }, { name = "position" }, { displayName = "[unit]", name = "unit" } }, description = "Sets the playing position of the Source.", link = "https://love2d.org/wiki/Source:seek", type = "function" }, setAttenuationDistances = { args = { { name = "self" }, { name = "ref" }, { name = "max" } }, description = "Sets the reference and maximum distance of the source.", link = "https://love2d.org/wiki/Source:setAttenuationDistances", type = "function" }, setCone = { args = { { name = "self" }, { name = "innerAngle" }, { name = "outerAngle" }, { displayName = "[outerVolume]", name = "outerVolume" } }, description = "Sets the Source's directional volume cones. Together with Source:setDirection, the cone angles allow for the Source's volume to vary depending on its direction.", link = "https://love2d.org/wiki/Source:setCone", type = "function" }, setDirection = { args = { { name = "self" }, { name = "x" }, { name = "y" }, { name = "z" } }, description = "Sets the direction vector of the Source. A zero vector makes the source non-directional.", link = "https://love2d.org/wiki/Source:setDirection", type = "function" }, setLooping = { args = { { name = "self" }, { name = "loop" } }, description = "Sets whether the Source should loop.", link = "https://love2d.org/wiki/Source:setLooping", type = "function" }, setPitch = { args = { { name = "self" }, { name = "pitch" } }, description = "Sets the pitch of the Source.", link = "https://love2d.org/wiki/Source:setPitch", type = "function" }, setPosition = { args = { { name = "self" }, { name = "x" }, { name = "y" }, { name = "z" } }, description = "Sets the position of the Source.", link = "https://love2d.org/wiki/Source:setPosition", type = "function" }, setRolloff = { args = { { name = "self" }, { name = "rolloff" } }, description = "Sets the rolloff factor which affects the strength of the used distance attenuation.\n\nExtended information and detailed formulas can be found in the chapter \"3.4. Attenuation By Distance\" of OpenAL 1.1 specification.", link = "https://love2d.org/wiki/Source:setRolloff", type = "function" }, setVelocity = { args = { { name = "self" }, { name = "x" }, { name = "y" }, { name = "z" } }, description = "Sets the velocity of the Source.\n\nThis does not change the position of the Source, but is used to calculate the doppler effect.", link = "https://love2d.org/wiki/Source:setVelocity", type = "function" }, setVolume = { args = { { name = "self" }, { name = "volume" } }, description = "Sets the volume of the Source.", link = "https://love2d.org/wiki/Source:setVolume", type = "function" }, setVolumeLimits = { args = { { name = "self" }, { name = "min" }, { name = "max" } }, description = "Sets the volume limits of the source. The limits have to be numbers from 0 to 1.", link = "https://love2d.org/wiki/Source:setVolumeLimits", type = "function" }, stop = { args = { { name = "self" } }, description = "Stops a Source.", link = "https://love2d.org/wiki/Source:stop", type = "function" }, tell = { args = { { name = "self" }, { displayName = "[unit]", name = "unit" } }, description = "Gets the currently playing position of the Source.", link = "https://love2d.org/wiki/Source:tell", returnTypes = { { type = "number" } }, type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, SpriteBatch = { fields = { add = { link = "https://love2d.org/wiki/SpriteBatch:add", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "self" }, { name = "x" }, { name = "y" }, { displayName = "[r]", name = "r" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Add a sprite to the batch." }, { args = { { name = "self" }, { name = "quad" }, { name = "x" }, { name = "y" }, { displayName = "[r]", name = "r" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Add a sprite to the batch." } } }, attachAttribute = { args = { { name = "self" }, { name = "name" }, { name = "mesh" } }, description = "Attaches a per-vertex attribute from a Mesh onto this SpriteBatch, for use when drawing. This can be combined with a Shader to augment a SpriteBatch with per-vertex or additional per-sprite information instead of just having per-sprite colors.\n\nEach sprite in a SpriteBatch has 4 vertices in the following order: top-left, bottom-left, top-right, bottom-right. The index returned by SpriteBatch:add (and used by SpriteBatch:set) can be multiplied by 4 to determine the first vertex in a specific sprite.", link = "https://love2d.org/wiki/SpriteBatch:attachAttribute", type = "function" }, clear = { args = { { name = "self" } }, description = "Removes all sprites from the buffer.", link = "https://love2d.org/wiki/SpriteBatch:clear", type = "function" }, flush = { args = { { name = "self" } }, description = "Immediately sends all new and modified sprite data in the batch to the graphics card.", link = "https://love2d.org/wiki/SpriteBatch:flush", type = "function" }, getBufferSize = { args = { { name = "self" } }, description = "Gets the maximum number of sprites the SpriteBatch can hold.", link = "https://love2d.org/wiki/SpriteBatch:getBufferSize", returnTypes = { { type = "number" } }, type = "function" }, getColor = { args = { { name = "self" } }, description = "Gets the color that will be used for the next add and set operations.\n\nIf no color has been set with SpriteBatch:setColor or the current SpriteBatch color has been cleared, this method will return nil.", link = "https://love2d.org/wiki/SpriteBatch:getColor", returnTypes = { { type = "number" }, { type = "number" }, { type = "number" }, { type = "number" } }, type = "function" }, getCount = { args = { { name = "self" } }, description = "Gets the amount of sprites currently in the SpriteBatch.", link = "https://love2d.org/wiki/SpriteBatch:getCount", returnTypes = { { type = "number" } }, type = "function" }, getTexture = { args = { { name = "self" } }, description = "Returns the Image or Canvas used by the SpriteBatch.", link = "https://love2d.org/wiki/SpriteBatch:getTexture", returnTypes = { { name = "Texture", type = "ref" } }, type = "function" }, set = { link = "https://love2d.org/wiki/SpriteBatch:set", type = "function", variants = { { args = { { name = "self" }, { name = "id" }, { name = "x" }, { name = "y" }, { displayName = "[r]", name = "r" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Changes a sprite in the batch. This requires the identifier returned by add and addq." }, { args = { { name = "self" }, { name = "id" }, { name = "quad" }, { name = "x" }, { name = "y" }, { displayName = "[r]", name = "r" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Changes a sprite in the batch. This requires the identifier returned by add and addq." } } }, setBufferSize = { args = { { name = "self" }, { name = "size" } }, description = "Sets the maximum number of sprites the SpriteBatch can hold. Existing sprites in the batch (up to the new maximum) will not be cleared when this function is called.", link = "https://love2d.org/wiki/SpriteBatch:setBufferSize", type = "function" }, setColor = { link = "https://love2d.org/wiki/SpriteBatch:setColor", type = "function", variants = { { args = { { name = "self" }, { name = "r" }, { name = "g" }, { name = "b" }, { displayName = "[a]", name = "a" } }, description = "Sets the color that will be used for the next add and set operations. Calling the function without arguments will clear the color.\n\nIn version [[0.9.2]] and older, the global color set with love.graphics.setColor will not work on the SpriteBatch if any of the sprites has its own color." }, { args = { { name = "self" } }, description = "Disables all per-sprite colors for this SpriteBatch." } } }, setTexture = { args = { { name = "self" }, { name = "texture" } }, description = "Replaces the Image or Canvas used for the sprites.", link = "https://love2d.org/wiki/SpriteBatch:setTexture", type = "function" } }, metatable = { fields = { __index = { name = "Drawable", type = "ref" } }, type = "table" }, type = "table" }, Text = { fields = { add = { link = "https://love2d.org/wiki/Text:add", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "self" }, { name = "textstring" }, { displayName = "[x]", name = "x" }, { displayName = "[y]", name = "y" }, { displayName = "[angle]", name = "angle" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Adds additional colored text to the Text object at the specified position." }, { args = { { name = "self" }, { name = "coloredtext" }, { displayName = "[x]", name = "x" }, { displayName = "[y]", name = "y" }, { displayName = "[angle]", name = "angle" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Adds additional colored text to the Text object at the specified position." } } }, addf = { link = "https://love2d.org/wiki/Text:addf", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "self" }, { name = "textstring" }, { name = "wraplimit" }, { name = "align" }, { name = "x" }, { name = "y" }, { displayName = "[angle]", name = "angle" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Adds additional formatted / colored text to the Text object at the specified position." }, { args = { { name = "self" }, { name = "coloredtext" }, { name = "wraplimit" }, { name = "align" }, { name = "x" }, { name = "y" }, { displayName = "[angle]", name = "angle" }, { displayName = "[sx]", name = "sx" }, { displayName = "[sy]", name = "sy" }, { displayName = "[ox]", name = "ox" }, { displayName = "[oy]", name = "oy" }, { displayName = "[kx]", name = "kx" }, { displayName = "[ky]", name = "ky" } }, description = "Adds additional formatted / colored text to the Text object at the specified position." } } }, clear = { args = { { name = "self" } }, description = "Clears the contents of the Text object.", link = "https://love2d.org/wiki/Text:clear", type = "function" }, getDimensions = { link = "https://love2d.org/wiki/Text:getDimensions", returnTypes = { { type = "number" }, { type = "number" } }, type = "function", variants = { { args = { { name = "self" } }, description = "Gets the width and height of the text in pixels." }, { args = { { name = "self" }, { name = "index" } }, description = "Gets the width and height of a specific sub-string that was previously added to the Text object." } } }, getFont = { args = { { name = "self" } }, description = "Gets the Font used with the Text object.", link = "https://love2d.org/wiki/Text:getFont", returnTypes = { { name = "Font", type = "ref" } }, type = "function" }, getHeight = { link = "https://love2d.org/wiki/Text:getHeight", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "self" } }, description = "Gets the height of the text in pixels." }, { args = { { name = "self" }, { name = "index" } }, description = "Gets the height of a specific sub-string that was previously added to the Text object." } } }, getWidth = { link = "https://love2d.org/wiki/Text:getWidth", returnTypes = { { type = "number" } }, type = "function", variants = { { args = { { name = "self" } }, description = "Gets the width of the text in pixels." }, { args = { { name = "self" }, { name = "index" } }, description = "Gets the width of a specific sub-string that was previously added to the Text object." } } }, set = { link = "https://love2d.org/wiki/Text:set", type = "function", variants = { { args = { { name = "self" }, { name = "textstring" } }, description = "Replaces the contents of the Text object with a new unformatted string." }, { args = { { name = "self" }, { name = "coloredtext" } }, description = "Replaces the contents of the Text object with a new unformatted string." }, { args = { { name = "self" } }, description = "Clears the contents of the Text object." } } }, setFont = { args = { { name = "self" }, { name = "font" } }, description = "Replaces the Font used with the text.", link = "https://love2d.org/wiki/Text:setFont", type = "function" }, setf = { link = "https://love2d.org/wiki/Text:setf", type = "function", variants = { { args = { { name = "self" }, { name = "textstring" }, { name = "wraplimit" }, { name = "align" } }, description = "Replaces the contents of the Text object with a new formatted string." }, { args = { { name = "self" }, { name = "coloredtext" }, { name = "wraplimit" }, { name = "align" } }, description = "Replaces the contents of the Text object with a new formatted string." }, { args = { { name = "self" } }, description = "Clears the contents of the Text object." } } } }, metatable = { fields = { __index = { name = "Drawable", type = "ref" } }, type = "table" }, type = "table" }, Texture = { fields = {}, metatable = { fields = { __index = { name = "Drawable", type = "ref" } }, type = "table" }, type = "table" }, Thread = { fields = { getError = { args = { { name = "self" } }, description = "Retrieves the error string from the thread if it produced an error.", link = "https://love2d.org/wiki/Thread:getError", returnTypes = { { type = "string" } }, type = "function" }, isRunning = { args = { { name = "self" } }, description = "Returns whether the thread is currently running.\n\nThreads which are not running can be (re)started with Thread:start.", link = "https://love2d.org/wiki/Thread:isRunning", returnTypes = { { type = "boolean" } }, type = "function" }, start = { link = "https://love2d.org/wiki/Thread:start", type = "function", variants = { { args = { { name = "self" } }, description = "Starts the thread.\n\nThreads can be restarted after they have completed their execution." }, { args = { { name = "self" }, { name = "arg1" }, { name = "arg2" }, { name = "..." } }, description = "Starts the thread.\n\nThreads can be restarted after they have completed their execution." } } }, wait = { args = { { name = "self" } }, description = "Wait for a thread to finish. This call will block until the thread finishes.", link = "https://love2d.org/wiki/Thread:wait", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, Video = { fields = { getDimensions = { args = { { name = "self" } }, description = "Gets the width and height of the Video in pixels.", link = "https://love2d.org/wiki/Video:getDimensions", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getFilter = { args = { { name = "self" } }, description = "Gets the scaling filters used when drawing the Video.", link = "https://love2d.org/wiki/Video:getFilter", returnTypes = { { name = "FilterMode", type = "ref" }, { name = "FilterMode", type = "ref" }, { type = "number" } }, type = "function" }, getHeight = { args = { { name = "self" } }, description = "Gets the height of the Video in pixels.", link = "https://love2d.org/wiki/Video:getHeight", returnTypes = { { type = "number" } }, type = "function" }, getSource = { args = { { name = "self" } }, description = "Gets the audio Source used for playing back the video's audio. May return nil if the video has no audio, or if Video:setSource is called with a nil argument.", link = "https://love2d.org/wiki/Video:getSource", returnTypes = { { name = "Source", type = "ref" } }, type = "function" }, getStream = { args = { { name = "self" } }, description = "Gets the VideoStream object used for decoding and controlling the video.", link = "https://love2d.org/wiki/Video:getStream", returnTypes = { { name = "VideoStream", type = "ref" } }, type = "function" }, getWidth = { args = { { name = "self" } }, description = "Gets the width of the Video in pixels.", link = "https://love2d.org/wiki/Video:getWidth", returnTypes = { { type = "number" } }, type = "function" }, isPlaying = { args = { { name = "self" } }, description = "Gets whether the Video is currently playing.", link = "https://love2d.org/wiki/Video:isPlaying", returnTypes = { { type = "boolean" } }, type = "function" }, pause = { args = { { name = "self" } }, description = "Pauses the Video.", link = "https://love2d.org/wiki/Video:pause", type = "function" }, play = { args = { { name = "self" } }, description = "Starts playing the Video. In order for the video to appear onscreen it must be drawn with love.graphics.draw.", link = "https://love2d.org/wiki/Video:play", type = "function" }, rewind = { args = { { name = "self" } }, description = "Rewinds the Video to the beginning.", link = "https://love2d.org/wiki/Video:rewind", type = "function" }, seek = { args = { { name = "self" }, { name = "offset" } }, description = "Sets the current playback position of the Video.", link = "https://love2d.org/wiki/Video:seek", type = "function" }, setFilter = { args = { { name = "self" }, { name = "min" }, { name = "mag" }, { displayName = "[anisotropy]", name = "anisotropy" } }, description = "Sets the scaling filters used when drawing the Video.", link = "https://love2d.org/wiki/Video:setFilter", type = "function" }, setSource = { args = { { name = "self" }, { displayName = "[source]", name = "source" } }, description = "Sets the audio Source used for playing back the video's audio. The audio Source also controls playback speed and synchronization.", link = "https://love2d.org/wiki/Video:setSource", type = "function" }, tell = { args = { { name = "self" }, { name = "seconds" } }, description = "Gets the current playback position of the Video.", link = "https://love2d.org/wiki/Video:tell", type = "function" } }, metatable = { fields = { __index = { name = "Drawable", type = "ref" } }, type = "table" }, type = "table" }, VideoStream = { fields = {}, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" }, WeldJoint = { fields = { getDampingRatio = { args = { { name = "self" } }, description = "Returns the damping ratio of the joint.", link = "https://love2d.org/wiki/WeldJoint:getDampingRatio", returnTypes = { { type = "number" } }, type = "function" }, getFrequency = { args = { { name = "self" } }, description = "Returns the frequency.", link = "https://love2d.org/wiki/WeldJoint:getFrequency", returnTypes = { { type = "number" } }, type = "function" }, setDampingRatio = { args = { { name = "self" }, { name = "ratio" } }, description = "The new damping ratio.", link = "https://love2d.org/wiki/WeldJoint:setDampingRatio", type = "function" }, setFrequency = { args = { { name = "self" }, { name = "freq" } }, description = "Sets a new frequency.", link = "https://love2d.org/wiki/WeldJoint:setFrequency", type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, WheelJoint = { fields = { getAxis = { args = { { name = "self" } }, description = "Gets the world-space axis vector of the Wheel Joint.", link = "https://love2d.org/wiki/WheelJoint:getAxis", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getJointSpeed = { args = { { name = "self" } }, description = "Returns the current joint translation speed.", link = "https://love2d.org/wiki/WheelJoint:getJointSpeed", returnTypes = { { type = "number" } }, type = "function" }, getJointTranslation = { args = { { name = "self" } }, description = "Returns the current joint translation.", link = "https://love2d.org/wiki/WheelJoint:getJointTranslation", returnTypes = { { type = "number" } }, type = "function" }, getMaxMotorTorque = { args = { { name = "self" } }, description = "Returns the maximum motor torque.", link = "https://love2d.org/wiki/WheelJoint:getMaxMotorTorque", returnTypes = { { type = "number" } }, type = "function" }, getMotorSpeed = { args = { { name = "self" } }, description = "Returns the speed of the motor.", link = "https://love2d.org/wiki/WheelJoint:getMotorSpeed", returnTypes = { { type = "number" } }, type = "function" }, getMotorTorque = { args = { { name = "self" }, { name = "invdt" } }, description = "Returns the current torque on the motor.", link = "https://love2d.org/wiki/WheelJoint:getMotorTorque", returnTypes = { { type = "number" } }, type = "function" }, getSpringDampingRatio = { args = { { name = "self" } }, description = "Returns the damping ratio.", link = "https://love2d.org/wiki/WheelJoint:getSpringDampingRatio", returnTypes = { { type = "number" } }, type = "function" }, getSpringFrequency = { args = { { name = "self" } }, description = "Returns the spring frequency.", link = "https://love2d.org/wiki/WheelJoint:getSpringFrequency", returnTypes = { { type = "number" } }, type = "function" }, setMaxMotorTorque = { args = { { name = "self" }, { name = "maxTorque" } }, description = "Sets a new maximum motor torque.", link = "https://love2d.org/wiki/WheelJoint:setMaxMotorTorque", type = "function" }, setMotorEnabled = { args = { { name = "self" }, { name = "enable" } }, description = "Starts and stops the joint motor.", link = "https://love2d.org/wiki/WheelJoint:setMotorEnabled", type = "function" }, setMotorSpeed = { args = { { name = "self" }, { name = "speed" } }, description = "Sets a new speed for the motor.", link = "https://love2d.org/wiki/WheelJoint:setMotorSpeed", type = "function" }, setSpringDampingRatio = { args = { { name = "self" }, { name = "ratio" } }, description = "Sets a new damping ratio.", link = "https://love2d.org/wiki/WheelJoint:setSpringDampingRatio", type = "function" }, setSpringFrequency = { args = { { name = "self" }, { name = "freq" } }, description = "Sets a new spring frequency.", link = "https://love2d.org/wiki/WheelJoint:setSpringFrequency", type = "function" } }, metatable = { fields = { __index = { name = "Joint", type = "ref" } }, type = "table" }, type = "table" }, World = { fields = { destroy = { args = { { name = "self" } }, description = "Destroys the world, taking all bodies, joints, fixtures and their shapes with it.\n\nAn error will occur if you attempt to use any of the destroyed objects after calling this function.", link = "https://love2d.org/wiki/World:destroy", type = "function" }, getBodyCount = { args = { { name = "self" } }, description = "Get the number of bodies in the world.", link = "https://love2d.org/wiki/World:getBodyCount", returnTypes = { { type = "number" } }, type = "function" }, getBodyList = { args = { { name = "self" } }, description = "Returns a table with all bodies.", link = "https://love2d.org/wiki/World:getBodyList", returnTypes = { { type = "table" } }, type = "function" }, getCallbacks = { args = { { name = "self" } }, description = "Returns functions for the callbacks during the world update.", link = "https://love2d.org/wiki/World:getCallbacks", returnTypes = { { type = "function" }, { type = "function" }, { type = "function" }, { type = "function" } }, type = "function" }, getContactCount = { args = { { name = "self" } }, description = "Returns the number of contacts in the world.", link = "https://love2d.org/wiki/World:getContactCount", returnTypes = { { type = "number" } }, type = "function" }, getContactFilter = { args = { { name = "self" } }, description = "Returns the function for collision filtering.", link = "https://love2d.org/wiki/World:getContactFilter", returnTypes = { { type = "function" } }, type = "function" }, getContactList = { args = { { name = "self" } }, description = "Returns a table with all contacts.", link = "https://love2d.org/wiki/World:getContactList", returnTypes = { { type = "table" } }, type = "function" }, getGravity = { args = { { name = "self" } }, description = "Get the gravity of the world.", link = "https://love2d.org/wiki/World:getGravity", returnTypes = { { type = "number" }, { type = "number" } }, type = "function" }, getJointCount = { args = { { name = "self" } }, description = "Get the number of joints in the world.", link = "https://love2d.org/wiki/World:getJointCount", returnTypes = { { type = "number" } }, type = "function" }, getJointList = { args = { { name = "self" } }, description = "Returns a table with all joints.", link = "https://love2d.org/wiki/World:getJointList", returnTypes = { { type = "table" } }, type = "function" }, isDestroyed = { args = { { name = "self" } }, description = "Gets whether the World is destroyed. Destroyed worlds cannot be used.", link = "https://love2d.org/wiki/World:isDestroyed", returnTypes = { { type = "boolean" } }, type = "function" }, isLocked = { args = { { name = "self" } }, description = "Returns if the world is updating its state.\n\nThis will return true inside the callbacks from World:setCallbacks.", link = "https://love2d.org/wiki/World:isLocked", returnTypes = { { type = "boolean" } }, type = "function" }, isSleepingAllowed = { args = { { name = "self" } }, description = "Returns the sleep behaviour of the world.", link = "https://love2d.org/wiki/World:isSleepingAllowed", returnTypes = { { type = "boolean" } }, type = "function" }, queryBoundingBox = { args = { { name = "self" }, { name = "topLeftX" }, { name = "topLeftY" }, { name = "bottomRightX" }, { name = "bottomRightY" }, { name = "callback" } }, description = "Calls a function for each fixture inside the specified area.", link = "https://love2d.org/wiki/World:queryBoundingBox", type = "function" }, rayCast = { args = { { name = "self" }, { name = "x1" }, { name = "y1" }, { name = "x2" }, { name = "y2" }, { name = "callback" } }, description = "Casts a ray and calls a function for each fixtures it intersects.", link = "https://love2d.org/wiki/World:rayCast", type = "function" }, setCallbacks = { args = { { name = "self" }, { name = "beginContact" }, { name = "endContact" }, { name = "preSolve" }, { name = "postSolve" } }, description = "Sets functions for the collision callbacks during the world update.\n\nFour Lua functions can be given as arguments. The value nil removes a function.\n\nWhen called, each function will be passed three arguments. The first two arguments are the colliding fixtures and the third argument is the Contact between them. The PostSolve callback additionally gets the normal and tangent impulse for each contact point.", link = "https://love2d.org/wiki/World:setCallbacks", type = "function" }, setContactFilter = { args = { { name = "self" }, { name = "filter" } }, description = "Sets a function for collision filtering.\n\nIf the group and category filtering doesn't generate a collision decision, this function gets called with the two fixtures as arguments. The function should return a boolean value where true means the fixtures will collide and false means they will pass through each other.", link = "https://love2d.org/wiki/World:setContactFilter", type = "function" }, setGravity = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Set the gravity of the world.", link = "https://love2d.org/wiki/World:setGravity", type = "function" }, setSleepingAllowed = { args = { { name = "self" }, { name = "allowSleep" } }, description = "Set the sleep behaviour of the world.\n\nA sleeping body is much more efficient to simulate than when awake.\n\nIf sleeping is allowed, any body that has come to rest will sleep.", link = "https://love2d.org/wiki/World:setSleepingAllowed", type = "function" }, translateOrigin = { args = { { name = "self" }, { name = "x" }, { name = "y" } }, description = "Translates the World's origin. Useful in large worlds where floating point precision issues become noticeable at far distances from the origin.", link = "https://love2d.org/wiki/World:translateOrigin", type = "function" }, update = { args = { { name = "self" }, { name = "dt" } }, description = "Update the state of the world.", link = "https://love2d.org/wiki/World:update", type = "function" } }, metatable = { fields = { __index = { name = "Object", type = "ref" } }, type = "table" }, type = "table" } }, packagePath = "./?.lua,./?/init.lua" }
mapEffects = "lib/mapEffects" target.reserved_effect(mapEffects.getReservedEffect("pirateScene") .. target.gender)
local AS = unpack(AddOnSkins) if not AS:CheckAddOn('TinyDPS') then return end function AS:TinyDPS() AS:SkinBackdropFrame(tdpsFrame) tdpsFrame.Backdrop:SetAllPoints() tdpsFrame:HookScript('OnShow', function() if AS:CheckEmbed('TinyDPS') then EmbedSystem_MainWindow:Show() end end) if tdpsStatusBar then tdpsStatusBar:SetBackdrop({bgFile = AS.NormTex, edgeFile = AS.Blank, tile = false, tileSize = 0, edgeSize = 1}) tdpsStatusBar:SetStatusBarTexture(AS.NormTex) end tdpsRefresh() end AS:RegisterSkin('TinyDPS', AS.TinyDPS)
--------------------------------------------------------------------------------------------------- -- User story: https://github.com/smartdevicelink/sdl_requirements/issues/9 -- Use case: https://github.com/smartdevicelink/sdl_requirements/blob/master/detailed_docs/button_press_emulation.md -- Item: Use Case 1: Alternative flow 1 -- -- Requirement summary: -- [SDL_RC] Button press event emulation -- -- Description: -- In case: -- 1) Application registered with REMOTE_CONTROL AppHMIType sends ButtonPress RPC -- 2) (with <climate-related-buttons> and RADIO moduleType) OR (with <radio-related-buttons> and CLIMATE moduleType) -- SDL must: -- 1) Respond with "resultCode: INVALID_DATA, success: false" to this mobile app, not transferring this RPC to the vehicle --------------------------------------------------------------------------------------------------- --[[ Required Shared libraries ]] local commonRC = require('test_scripts/RC/commonRC') local runner = require('user_modules/script_runner') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false -- [[ Local Variables ]] local paramsStep1 = { moduleType = "CLIMATE", buttonName = "VOLUME_UP", buttonPressMode = "SHORT" } local paramsStep2 = { moduleType = "RADIO", buttonName = "AC", buttonPressMode = "LONG" } --[[ Scenario ]] runner.Title("Preconditions") runner.Step("Clean environment", commonRC.preconditions) runner.Step("Start SDL, HMI, connect Mobile, start Session", commonRC.start) runner.Step("RAI", commonRC.registerAppWOPTU) runner.Step("Activate App", commonRC.activateApp) runner.Title("Test") runner.Step("ButtonPress_CLIMATE", commonRC.rpcDeniedWithCustomParams, {paramsStep1, 1, "ButtonPress", "INVALID_DATA"}) runner.Step("ButtonPress_RADIO", commonRC.rpcDeniedWithCustomParams, {paramsStep2, 1, "ButtonPress", "INVALID_DATA"}) runner.Title("Postconditions") runner.Step("Stop SDL", commonRC.postconditions)
return { topics = { "draw", "keypressed", "quit", "update", }, systems = { category = { categories = {}, }, fixedUpdate = { fixedDt = 1 / 60, topics = { "transform", "input", "physics", "death", }, }, graphics = { topics = { "debug", }, }, transform = {}, transformDebug = {}, physics = { gravityX = 0, gravityY = 50, }, physicsDebug = { colors = { fixture = {0, 1, 0, 1}, }, }, update = { topics = { "transform", "fixedUpdate", "graphics", }, }, script = { scripts = { curveFixture = "resources.scripts.CurveFixture", flipper = "resources.scripts.Flipper", hullFixtures = "resources.scripts.HullFixtures", }, }, }, entities = { { components = { transform = {}, camera = { scale = 0.02, }, }, }, { components = { transform = {}, body = {}, }, children = { { prototype = "resources.entities.flipper", components = { transform = { x = -8, y = 16, }, flipper = { key = "lshift", direction = -1, }, }, }, { prototype = "resources.entities.flipper", components = { transform = { x = 8, y = 16, angle = math.pi, }, revoluteJoint = { referenceAngle = -math.pi, }, flipper = { key = "rshift", direction = 1, }, }, }, { components = { transform = {}, curveFixture = { controlPoints = { -25.7175, 0, -25.7175, -18, 0, -18, }, }, }, }, { components = { transform = {}, curveFixture = { controlPoints = { 25.7175, 0, 25.7175, -18, 0, -18, }, }, }, }, { components = { transform = {}, curveFixture = { controlPoints = { -25.7175, 0, -25.7175, 10, -8, 15, }, }, }, }, { components = { transform = {}, curveFixture = { controlPoints = { 25.7175, 0, 25.7175, 10, 8, 15, }, }, }, }, }, }, { prototype = "resources.entities.ball", components = { transform = { x = -5, }, }, }, }, }
SafeAddString(SI_PET_HEALTH_COMBAT_ACTIVATED , "La fenetre de santé de familier n'est active juste en combat.") SafeAddString(SI_PET_HEALTH_COMBAT_DEACTIVATED , "La fenetre de santé de familier reste active tant qu'un familier est invoqué.") SafeAddString(SI_PET_HEALTH_VALUES_ACTIVATED , "Les valeurs sont activées.") SafeAddString(SI_PET_HEALTH_VALUES_DEACTIVATED , "Les valeurs sont désactivées.") SafeAddString(SI_PET_HEALTH_LABELS_ACTIVATED , "Les étiquettes sont activées.") SafeAddString(SI_PET_HEALTH_LABELS_DEACTIVATED , "Les étiquettes sont désactivées.") SafeAddString(SI_PET_HEALTH_BACKGROUND_ACTIVATED , "L'arrière-plan est activé.") SafeAddString(SI_PET_HEALTH_BACKGROUND_DEACTIVATED , "L'arrière-plan est désactivé.") SafeAddString(SI_PET_HEALTH_CLASS , "Votre classe n'est pas supportée.") -- SLASH COMMANDS SafeAddString(SI_PET_HEALTH_LSC_DEBUG , "Toggle debug mode.") SafeAddString(SI_PET_HEALTH_LSC_COMBAT , "Toggle pet window in combat.") SafeAddString(SI_PET_HEALTH_LSC_VALUES , "Toggle pet attribute values. They have to set up in eso combat settings.") SafeAddString(SI_PET_HEALTH_LSC_LABELS , "Toggle pet name labels.") SafeAddString(SI_PET_HEALTH_LSC_BACKGROUND , "Toggle pet window background.")
-- entity_manager -- ArkhieDev -- 5/9/2021 -- Services local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") local RunService = game:GetService("RunService") -- Variables local xeno = require(ReplicatedStorage:WaitForChild("xeno")) local network = xeno.network -- Constants -- Utilities local Janitor, EnumList, Promise, TableUtil, Timer = xeno.getUtil("Janitor", "EnumList", "Promise", "TableUtil") return {};
-- -- AI Classes ----------------- function init_aiClass() -- Create the table for the class definition ai_Class = {} -- Define the new() function ai_Class.new = function() local self = {} self.heroes = {} self.heroGroup = CreateGroup() self.heroOptions = { "heroA", "heroB", "heroC", "heroD", "heroE", "heroF", "heroG", "heroH", "heroI", "heroJ", "heroK", "heroL" } self.count = 0 self.loop = 1 self.tick = 1 function self:isAlive(i) return self[i].alive end function self:countOfHeroes() return self.count end function self:initHero(heroUnit) self.count = self.count + 1 self.tick = (1.00 + (self.count * 0.1)) / self.count local i = self.heroOptions[self.count] print("Name: " .. i) table.insert(self.heroes, i) self[i] = {} self[i].unit = heroUnit GroupAddUnit(self.heroGroup, self[i].unit) self[i].id = GetUnitTypeId(heroUnit) self[i].four = CC2Four(self[i].id) self[i].name = hero[self[i].four] self[i].player = GetOwningPlayer(heroUnit) self[i].playerNumber = GetConvertedPlayerId(GetOwningPlayer(heroUnit)) if self[i].playerNumber > 6 then self[i].teamNumber = 2 self[i].teamName = "federation" self[i].teamNameEnemy = "allied" else self[i].teamNumber = 1 self[i].teamName = "allied" self[i].teamNameEnemy = "federation" end print("Team Number: " .. self[i].teamNumber) self[i].heroesFriend = CreateGroup() self[i].heroesEnemy = CreateGroup() self[i].lifeHistory = {0.00, 0.00, 0.00} indexer:add(self[i].unit) indexer:addKey(self[i].unit, "heroName", i) indexer:addKey(self[i].unit, "heroNumber", self.count) self[i].alive = false self[i].fleeing = false self[i].casting = false self[i].castingDuration = -10.00 self[i].castingDanger = false self[i].order = nil self[i].castingUlt = false self[i].chasing = false self[i].defending = false self[i].defendingFast = false self[i].lowLife = false self[i].highDamage = false self[i].updateDest = false self[i].regionAttacking = nil self[i].unitHealing = nil self[i].unitAttacking = nil self[i].unitDefending = nil self[i].unitChasing = nil if self[i].four == hero.brawler.four then -- Brawler self[i].healthFactor = 1.00 self[i].manaFactor = 0.02 self[i].lifeHighPercent = 65.00 self[i].lifeLowPercent = 20.00 self[i].lifeLowNumber = 400.00 self[i].highDamageSingle = 17.00 self[i].highDamageAverage = 25.00 self[i].powerBase = 500.00 self[i].powerLevel = 200.00 self[i].clumpCheck = true self[i].clumpRange = 100.00 self[i].intelRange = 1100.00 self[i].closeRange = 500.00 self[i].strats = {"aggressive", "defensive", "passive"} elseif self[i].four == hero.manaAddict.four then -- Mana Addict self[i].healthFactor = 1.00 self[i].manaFactor = 0.75 self[i].lifeHighPercent = 85.00 self[i].lifeLowPercent = 25.00 self[i].lifeLowNumber = 300.00 self[i].highDamageSingle = 3.00 self[i].highDamageAverage = 18.00 self[i].powerBase = 700.00 self[i].powerLevel = 220.00 self[i].clumpCheck = true self[i].clumpRange = 100.00 self[i].intelRange = 1000.00 self[i].closeRange = 400.00 self[i].strats = {"aggressive", "defensive", "passive"} elseif self[i].four == hero.tactition.four then -- Tactition self[i].healthFactor = 1.00 self[i].manaFactor = 0.20 self[i].lifeHighPercent = 75.00 self[i].lifeLowPercent = 20.00 self[i].lifeLowNumber = 350.00 self[i].highDamageSingle = 17.00 self[i].highDamageAverage = 25.00 self[i].powerBase = 500.00 self[i].powerLevel = 200.00 self[i].clumpCheck = true self[i].clumpRange = 250.00 self[i].intelRange = 1000.00 self[i].closeRange = 400.00 self[i].strats = {"aggressive", "defensive", "passive"} elseif self[i].four == hero.timeMage.four then -- Time Mage self[i].healthFactor = 1.00 self[i].manaFactor = 0.10 self[i].lifeHighPercent = 85.00 self[i].lifeLowPercent = 25.00 self[i].lifeLowNumber = 350.00 self[i].highDamageSingle = 8.00 self[i].highDamageAverage = 17.00 self[i].powerBase = 750.00 self[i].powerLevel = 250.00 self[i].clumpCheck = true self[i].clumpRange = 250.00 self[i].intelRange = 1100.00 self[i].closeRange = 700.00 self[i].strats = {"aggressive", "defensive", "passive"} elseif self[i].four == hero.shiftMaster.four then -- Shifter self[i].healthFactor = 1.00 self[i].manaFactor = 0.15 self[i].lifeHighPercent = 70.00 self[i].lifeLowPercent = 25.00 self[i].lifeLowNumber = 350.00 self[i].highDamageSingle = 17.00 self[i].highDamageAverage = 25.00 self[i].powerBase = 500.00 self[i].powerLevel = 200.00 self[i].clumpCheck = true self[i].clumpRange = 100.00 self[i].intelRange = 1100.00 self[i].closeRange = 400.00 self[i].strats = {"aggressive", "defensive", "passive"} end local randI = GetRandomInt(1, #self[i].strats) self[i].strat = self[i].strats[randI] -- TESTING -- self[i].strat = "aggressive" -- TESTING print(self[i].strat) end -- Update Intel function self:updateIntel(i) -- Only run if the hero is alive if (self[i].alive == true) then -- Update info about the AI Hero self[i].x = GetUnitX(self[i].unit) self[i].y = GetUnitY(self[i].unit) self[i].life = GetWidgetLife(self[i].unit) self[i].lifePercent = GetUnitLifePercent(self[i].unit) self[i].lifeMax = GetUnitState(self[i].unit, UNIT_STATE_MAX_LIFE) self[i].mana = GetUnitState(self[i].unit, UNIT_STATE_MANA) self[i].manaPercent = GetUnitManaPercent(self[i].unit) self[i].manaMax = GetUnitState(self[i].unit, UNIT_STATE_MAX_MANA) self[i].level = GetHeroLevel(self[i].unit) self[i].currentOrder = OrderId2String(GetUnitCurrentOrder(self[i].unit)) -- Reset Intel self[i].countUnit = 0 self[i].countUnitFriend = 0 self[i].countUnitFriendClose = 0 self[i].countUnitEnemy = 0 self[i].countUnitEnemyClose = 0 self[i].powerFriend = 0.00 self[i].powerEnemy = 0.00 self[i].unitPowerFriend = nil self[i].unitPowerEnemy = nil self[i].clumpFriend = nil self[i].clumpFriendNumber = 0 self[i].clumpFriendPower = 0.00 self[i].clumpEnemy = nil self[i].clumpEnemyNumber = 0 self[i].clumpEnemyPower = 0.00 self[i].clumpBoth = nil self[i].clumpBothNumber = 0 self[i].clumpBothPower = 0.00 GroupClear(self[i].heroesFriend) GroupClear(self[i].heroesEnemy) -- Units around Hero local g = CreateGroup() local clump = CreateGroup() local unitPower = 0.00 local unitPower = 0.00 local unitLife = 0.00 local unitX local unitY local unitDistance = 0.00 local unitRange = 0.00 local unitPowerRangeMultiplier = 0.00 local u local clumpUnit local powerAllyTemp, powerAllyNumTemp, powerEnemyTemp, powerEnemyNumTemp GroupEnumUnitsInRange(g, self[i].x, self[i].y, self[i].intelRange, nil) -- Enumerate through group while true do u = FirstOfGroup(g) if (u == nil) then break end -- Unit is alive and not the hero if (IsUnitAliveBJ(u) == true and u ~= self[i].unit) then self[i].countUnit = self[i].countUnit + 1 -- Get Unit Details unitLife = GetUnitLifePercent(u) unitRange = BlzGetUnitWeaponRealField(u, UNIT_WEAPON_RF_ATTACK_RANGE, 0) unitX = GetUnitX(u) unitY = GetUnitY(u) unitDistance = DistanceBetweenCoordinates(unitX, unitY, self[i].x, self[i].y) -- Get Unit Power if (IsUnitType(u, UNIT_TYPE_HERO) == true) then -- is Hero unitPower = I2R((GetHeroLevel(u) * 75)) if IsUnitAlly(u, self[i].player) then -- Add to hero Group GroupAddUnit(self[i].heroesFriend, u) else GroupAddUnit(self[i].heroesEnemy, u) end else -- Unit is NOT a hero unitPower = I2R(GetUnitPointValue(u)) end -- Power range modifier if unitDistance < unitRange then unitPowerRangeMultiplier = 1.00 else unitPowerRangeMultiplier = 300.00 / (unitDistance - unitRange + 300.00) end if IsUnitAlly(u, self[i].player) == true then -- Update count self[i].countUnitFriend = self[i].countUnitFriend + 1 if unitDistance <= self[i].closeRange then self[i].countUnitFriendClose = self[i].countUnitFriendClose + 1 end -- Check to see if unit is the most powerful friend if unitPower > self[i].powerFriend then self[i].unitPowerFriend = u end -- Relative Power self[i].powerFriend = self[i].powerFriend + (unitPower * (unitLife / 100.00) * unitPowerRangeMultiplier) else -- Update Count self[i].countUnitEnemy = self[i].countUnitEnemy + 1 if unitDistance <= self[i].closeRange then self[i].countUnitEnemyClose = self[i].countUnitEnemyClose + 1 end -- Check to see if unit is the most powerful Enemy if unitPower > self[i].powerEnemy then self[i].unitPowerEnemy = u end -- Relative Power self[i].powerEnemy = self[i].powerEnemy + (unitPower * (unitLife / 100.00) * unitPowerRangeMultiplier) end if self[i].clumpCheck == true then powerAllyTemp = 0 powerEnemyTemp = 0 powerAllyNumTemp = 0 powerEnemyNumTemp = 0 clump = CreateGroup() GroupEnumUnitsInRange(clump, unitX, unitY, self[i].clumpRange, nil) while true do clumpUnit = FirstOfGroup(clump) if clumpUnit == nil then break end if IsUnitAliveBJ(clumpUnit) and IsUnitType(clumpUnit, UNIT_TYPE_STRUCTURE) == false then if IsUnitAlly(clumpUnit, self[i].player) then powerAllyTemp = powerAllyTemp + SquareRoot(I2R(GetUnitPointValue(clumpUnit))) powerAllyNumTemp = powerAllyNumTemp + 1 else powerEnemyTemp = powerEnemyTemp + SquareRoot(I2R(GetUnitPointValue(clumpUnit))) powerEnemyNumTemp = powerEnemyNumTemp + 1 end end GroupRemoveUnit(clump, clumpUnit) end DestroyGroup(clump) if powerAllyNumTemp > self[i].clumpFriendNumber then self[i].clumpFriendNumber = powerAllyNumTemp end if powerEnemyNumTemp > self[i].clumpEnemyNumber then self[i].clumpEnemyNumber = powerEnemyNumTemp end if powerAllyTemp > self[i].clumpFriendPower then self[i].clumpFriendPower = powerAllyTemp self[i].clumpFriend = u end if powerEnemyTemp > self[i].clumpEnemyPower then self[i].clumpEnemyPower = powerEnemyTemp self[i].clumpEnemy = u end if (powerAllyTemp + powerEnemyTemp) > self[i].clumpBothPower then self[i].clumpBothPower = powerAllyTemp + powerEnemyTemp self[i].clumpBoth = u end end end GroupRemoveUnit(g, u) end DestroyGroup(g) -- Find how much damage the Hero is taking self[i].lifeHistory[#self[i].lifeHistory + 1] = self[i].lifePercent if #self[i].lifeHistory > 5 then table.remove(self[i].lifeHistory, 1) end self[i].clumpBothNumber = self[i].clumpFriendNumber + self[i].clumpEnemyNumber self[i].percentLifeSingle = self[i].lifeHistory[#self[i].lifeHistory - 1] - self[i].lifeHistory[#self[i].lifeHistory] self[i].percentLifeAverage = self[i].lifeHistory[1] - self[i].lifeHistory[#self[i].lifeHistory] -- Figure out the Heroes Weighted Life self[i].weightedLife = (self[i].life * self[i].healthFactor) + (self[i].mana * self[i].manaFactor) self[i].weightedLifeMax = (self[i].lifeMax * self[i].healthFactor) + (self[i].manaMax * self[i].manaFactor) self[i].weightedLifePercent = (self[i].weightedLife / self[i].weightedLifeMax) * 100.00 -- Get the Power Level of the surrounding Units self[i].powerEnemy = (self[i].powerEnemy * (((100.00 - self[i].weightedLifePercent) / 20.00) + 0.50)) self[i].powerCount = self[i].powerEnemy - self[i].powerFriend -- Raise Hero Confidence Level self[i].powerBase = self[i].powerBase + (0.25 * I2R(self[i].level)) self[i].powerHero = self[i].powerBase + (self[i].powerLevel * I2R(self[i].level)) -- print(self[i].currentOrder) -- print("Clump Enemy: " .. R2S(self[i].clumpEnemyPower)) -- print("Clump Both: " .. R2S(self[i].clumpBothPower)) -- print("Clump: " .. GetUnitName(self[i].clumpBoth)) -- print("Enemies Nearby: " .. self[i].countUnitEnemy) -- print("Power Clump Enemy: " .. self[i].powerEnemy) -- print("Hero Power: " .. R2S(self[i].powerHero)) -- print("Power Level: " .. R2S(self[i].powerCount)) end end function self:CleanUp(i) if (self[i].currentOrder ~= "move" and (self[i].lowLife or self[i].fleeing)) then self:ACTIONtravelToHeal(i) end if (self[i].currentOrder ~= "attack" and self[i].currentOrder ~= "move" and self[i].lowLife == false and self[i].casting == false) then self:ACTIONtravelToDest(i) end end -- AI Run Specifics function self:STATEAbilities(i) if self[i].name == "manaAddict" then self:manaAddictAI(i) elseif self[i].name == "brawler" then self:brawlerAI(i) elseif self[i].name == "shiftMaster" then self:shiftMasterAI(i) elseif self[i].name == "tactition" then self:tactitionAI(i) elseif self[i].name == "timeMage" then self:timeMageAI(i) end end -- Check to see if Hero should try to upgrade function self:STATEUpgrade(i) local randInt = GetRandomInt(1, 40) if randInt == 10 then hero.upgrade(i) end end function self:STATEDefend(i) if self[i].alive and not self[i].lowLife and not self[i].fleeing and not self[i].casting and not self[i].defending then local baseCountDanger = CountUnitsInGroup(base[self[i].teamName].gDanger) if baseCountDanger > 0 then local u, id, defend, unitCount, danger, selectedId, distanceToBase local g = CreateGroup() GroupAddGroup(base[self[i].teamName].gDanger, g) local danger = 0 local selectedId = nil while true do u = FirstOfGroup(g) if u == nil then break end id = GetHandleId(u) if base[id].danger > danger then danger = base[id].danger selectedId = id end GroupRemoveUnit(g, u) end DestroyGroup(g) id = selectedId if self[i].strat == "defensive" and danger > 40 then self[i].defending = true elseif self[i].strat == "passive" and danger > 120 then self[i].defending = true elseif self[i].strat == "aggressive" and danger > 400 then self[i].defending = true end if self[i].defending then self[i].unitDefending = base[id].unit distanceToBase = DistanceBetweenCoordinates(self[i].x, self[i].y, base[id].x, base[id].y) if distanceToBase > 3500 then self[i].defendingFast = true end self:ACTIONtravelToDest(i) print("Defending: " .. GetUnitName(self[i].unitDefending)) end end end end function self:STATEDefending(i) if self[i].defending then local id = GetHandleId(self[i].unitDefending) if base[id].danger <= 0 or not IsUnitAliveBJ(self[i].unitDefending) then self[i].defending = false self[i].defendingFast = false self[i].unitDefending = nil self:ACTIONattackBase(i) print("Stop Defending") else local distanceToBase = DistanceBetweenCoordinates(self[i].x, self[i].y, base[id].x, base[id].y) local teleportCooldown = BlzGetUnitAbilityCooldownRemaining(self[i].unit, hero.item.teleportation.abilityId) if distanceToBase < 2500 and self[i].defendingFast then self[i].defendingFast = false self:ACTIONtravelToDest(i) elseif distanceToBase > 4000 and teleportCooldown == 0 then self:ACTIONtravelToDest(i) end end end end -- AI has Low Health function self:STATELowHealth(i) if (self[i].weightedLifePercent < self[i].lifeLowPercent or self[i].weightedLife < self[i].lifeLowNumber) and self[i].lowLife == false then print("Low Health") self[i].lowLife = true self[i].fleeing = false self[i].chasing = false self[i].defending = false self[i].highdamage = false self[i].updateDest = false if self[i].castingDanger == false then self[i].casting = false self[i].castingCounter = -10.00 self:ACTIONtravelToHeal(i) end end end -- AI Has High Health function self:STATEHighHealth(i) if self[i].alive == true and self[i].lowLife == true and self[i].weightedLifePercent > self[i].lifeHighPercent then print("High Health") self[i].lowLife = false self[i].fleeing = false -- Reward the AI For doing good self[i].lifeLowPercent = self[i].lifeLowPercent - 1.00 self[i].lifeHighPercent = self[i].lifeHighPercent - 1.00 if self[i].defending then self:ACTIONtravelToDest(i) else local rand = GetRandomInt(1, 3) if rand == 1 then self:ACTIONattackBase(i) else self:ACTIONtravelToDest(i) end end end end -- AI is Dead function self:STATEDead(i) if self[i].alive == true and IsUnitAliveBJ(self[i].unit) == false then print("Dead") self[i].alive = false self[i].lowLife = false self[i].fleeing = false self[i].chasing = false self[i].defending = false self[i].highdamage = false self[i].updateDest = false self[i].casting = false self[i].castingUlt = false self[i].defending = false self[i].defendingFast = false self[i].castingCounter = -10.00 -- Punish the AI for screwing up. IT WILL FEAR DEATH!!! self[i].lifeLowPercent = self[i].lifeLowPercent + 4.00 self[i].powerBase = self[i].powerBase / 2 if self[i].lifeHighPercent < 98.00 then self[i].lifeHighPercent = self[i].lifeHighPercent + 2.00 end end end -- AI has Revived function self:STATERevived(i) if self[i].alive == false and IsUnitAliveBJ(self[i].unit) == true then print("Revived") self[i].alive = true self:ACTIONattackBase(i) end end -- AI Fleeing function self:STATEFleeing(i) if (self[i].powerHero < self[i].powerCount or self[i].percentLifeSingle > self[i].highDamageSingle or self[i].percentLifeAverage > self[i].highDamageAverage) and self[i].lowLife == false and self[i].fleeing == false then print("Flee") self[i].fleeing = true if self[i].castingDanger == false then self[i].casting = false self[i].castingCounter = -10.00 self:ACTIONtravelToHeal(i) end end end -- AI Stop Fleeing function self:STATEStopFleeing(i) if self[i].powerHero > self[i].powerCount and self[i].percentLifeSingle <= 0.0 and self[i].percentLifeAverage <= self[i].highDamageAverage and self[i].lowLife == false and self[i].fleeing == true then print("Stop Fleeing") self[i].fleeing = false self:ACTIONtravelToDest(i) end end -- AI Casting Spell function self:STATEcastingSpell(i) if self[i].casting == true then if self[i].castingDuration > 0.00 then print("Casting Spell: " .. self[i].spellCast.name .. " - " .. self[i].castingDuration) self[i].castingDuration = self[i].castingDuration - (self.tick * self.count) else print("Stopped Cast") self[i].casting = false self[i].castingDuration = 0 self[i].spellCast = {} self[i].castingDanger = false self:ACTIONtravelToDest(i) end end end -- -- ACTIONS -- function self:castSpell(i, spellCast, danger) if not self[i].casting then danger = danger or false if spellCast ~= nil then if (self[i].fleeing == true or self[i].lowhealth == true) and danger == false then self:ACTIONtravelToDest(i) else print("Spell Cast") self[i].casting = true if danger then self[i].castingDanger = true end self[i].spellCast = spellCast if self[i].spellCast.instant then self[i].castingDuration = 1 else self[i].castingDuration = self[i].spellCast.castTime[1] end end end end end function self:ACTIONtravelToHeal(i) local healDistance = 100000000.00 local healDistanceNew = 0.00 local unitX, unitY, u local g = CreateGroup() GroupAddGroup(base[self[i].teamName].gHealing, g) while true do u = FirstOfGroup(g) if u == nil then break end unitX = GetUnitX(u) unitY = GetUnitY(u) healDistanceNew = DistanceBetweenCoordinates(self[i].x, self[i].y, unitX, unitY) if healDistanceNew < healDistance then healDistance = healDistanceNew self[i].unitHealing = u end GroupRemoveUnit(g, u) end DestroyGroup(g) unitX = GetUnitX(self[i].unitHealing) unitY = GetUnitY(self[i].unitHealing) -- print("x:" .. unitX .. "y:" .. unitY) IssuePointOrder(self[i].unit, "move", unitX, unitY) end function self:ACTIONtravelToDest(i) local unitX, unitY if not self[i].casting then if self[i].lowLife == true or self[i].fleeing == true then unitX = GetUnitX(self[i].unitHealing) unitY = GetUnitY(self[i].unitHealing) IssuePointOrder(self[i].unit, "move", unitX, unitY) elseif self[i].defending then unitX = GetUnitX(self[i].unitDefending) unitY = GetUnitY(self[i].unitDefending) if not self:teleportCheck(i, unitX, unitY) then if self[i].defendingFast == true then IssuePointOrder(self[i].unit, "move", unitX, unitY) else IssuePointOrder(self[i].unit, "attack", unitX, unitY) end end else if not IsUnitAliveBJ(self[i].unitAttacking) then self:ACTIONattackBase(i) return end unitX = GetUnitX(self[i].unitAttacking) unitY = GetUnitY(self[i].unitAttacking) if not self:teleportCheck(i, unitX, unitY) then IssuePointOrder(self[i].unit, "attack", unitX, unitY) end end end end function self:ACTIONattackBase(i) if not self[i].casting then local regionAdvantage = 0 local regions = {"top", "middle", "bottom"} local regionsPick = {} local baseAdvantage if self[i].strat == "aggressive" then baseAdvantage = self[i].teamName elseif self[i].strat == "defensive" then baseAdvantage = self[i].teamNameEnemy end if self[i].strat == "passive" then self[i].regionAttacking = regions[GetRandomInt(1, #regions)] else for a = 1, 3 do if regionAdvantage < base[regions[a]][baseAdvantage].advantage then regionAdvantage = base[regions[a]][baseAdvantage].advantage self[i].regionAttacking = regions[a] regionsPick = {} table.insert(regionsPick, regions[a]) elseif regionAdvantage == base[regions[a]][baseAdvantage].advantage then table.insert(regionsPick, regions[a]) end end if #regionsPick > 1 then self[i].regionAttacking = regionsPick[GetRandomInt(1, #regionsPick)] end end self[i].unitAttacking = GroupPickRandomUnit(base[self[i].regionAttacking][self[i].teamNameEnemy].g) local unitX = GetUnitX(self[i].unitAttacking) local unitY = GetUnitY(self[i].unitAttacking) print("Attacking: " .. self[i].regionAttacking .. " Base: " .. GetUnitName(self[i].unitAttacking)) if not self:teleportCheck(i, unitX, unitY) then IssuePointOrder(self[i].unit, "attack", unitX, unitY) end end end function self:getHeroData(unit) return self[indexer:get(unit).heroName] end -- Teleport Stuff function self:teleportCheck(i, destX, destY) local destDistance = 100000000.00 local destDistanceNew = 0.00 local unitX, unitY, u local teleportUnit local g = CreateGroup() local heroUnit = self[i].unit local distanceOrig = DistanceBetweenCoordinates(self[i].x, self[i].y, destX, destY) local teleportCooldown = BlzGetUnitAbilityCooldownRemaining(heroUnit, hero.item.teleportation.abilityId) if teleportCooldown == 0 and UnitHasItemOfTypeBJ(heroUnit, hero.item.teleportation.id) then GroupAddGroup(base[self[i].teamName].gTeleport, g) while true do u = FirstOfGroup(g) if u == nil then break end unitX = GetUnitX(u) unitY = GetUnitY(u) destDistanceNew = DistanceBetweenCoordinates(destX, destY, unitX, unitY) if destDistanceNew < destDistance then destDistance = destDistanceNew teleportUnit = u end GroupRemoveUnit(g, u) end DestroyGroup(g) if distanceOrig - 2000 > destDistanceNew then print("Teleporting") -- PingMinimap(unitX, unitY, 15) UnitUseItemTarget(heroUnit, GetItemOfTypeFromUnitBJ(heroUnit, hero.item.teleportation.id), teleportUnit) self:castSpell(i, hero.item.teleportation) return true else return false end else return false end end -- Hero AI function self:manaAddictAI(i) local curSpell ---@type table -- Always Cast ------- -- Mana Shield if self[i].casting then return false end curSpell = hero.spell(self[i], "manaShield") if curSpell.castable == true and curSpell.hasBuff == false then print(curSpell.name) IssueImmediateOrder(self[i].unit, curSpell.order) self:castSpell(i, curSpell) return true end -- Cast available all the time ------- -- Mana Drain curSpell = hero.spell(self[i], "manaExplosion") if self[i].countUnitEnemyClose > 3 and self[i].manaPercent < 90.00 and curSpell.castable == true then print(curSpell.name) IssueImmediateOrder(self[i].unit, curSpell.order) self:castSpell(i, curSpell) return true end -- Normal Cast -------- if self[i].lowLife == false and self[i].fleeing == false then -- Frost Nova curSpell = hero.spell(self[i], "manaBomb") if self[i].clumpEnemyPower >= 40 and curSpell.castable == true and curSpell.manaLeft > 80 then print(curSpell.name) IssuePointOrder(self[i].unit, curSpell.order, GetUnitX(self[i].clumpEnemy), GetUnitY(self[i].clumpEnemy)) self:castSpell(i, curSpell) return true end end end function self:brawlerAI(i) local curSpell ---@type table if self[i].casting == false then end end -- Shift Master Spell AI function self:shiftMasterAI(i) local curSpell ---@type table if not self[i].casting then -- Custom Intel local g = CreateGroup() local gUnits = CreateGroup() local gIllusions = CreateGroup() local u, uTemp, unitsNearby local illusionsNearby = 0 -- Find all Nearby Illusions GroupEnumUnitsInRange(g, self[i].x, self[i].y, 600.00, nil) GroupAddGroup(g, gIllusions) while true do u = FirstOfGroup(g) if (u == nil) then break end if IsUnitIllusion(u) then illusionsNearby = illusionsNearby + 1 end GroupRemoveUnit(g, u) end DestroyGroup(g) if self[i].fleeing or self[i].lowLife then -- Check if there are illusions Nearby if illusionsNearby > 0 then curSpell = hero.spell(self[i], "switch") if curSpell.castable and curSpell.manaLeft > 0 and not self[i].casting then print(curSpell.name) u = GroupPickRandomUnit(gIllusions) GroupEnumUnitsInRange(gUnits, GetUnitX(u), GetUnitY(u), 350, nil) unitsNearby = 0 while true do uTemp = FirstOfGroup(g) if (uTemp == nil) then break end if not IsUnitAlly(uTemp, GetOwningPlayer(self[i].unit)) then unitsNearby = unitsNearby + 1 end GroupRemoveUnit(g, uTemp) end DestroyGroup(g) if unitsNearby < self[i].countUnitEnemyClose then IssuePointOrderById(self[i].unit, oid.reveal, GetUnitX(u), GetUnitY(u)) end end end curSpell = hero.spell(self[i], "shift") if curSpell.castable == true and curSpell.manaLeft > 0 then print(curSpell.name) IssueImmediateOrder(self[i].unit, curSpell.order) self:castSpell(i, curSpell) end end -- Normal Cast Spells if self[i].casting == false and self[i].lowLife == false and self[i].fleeing == false then -- Shift curSpell = hero.spell(self[i], "shift") if self[i].countUnitEnemyClose >= 2 and curSpell.castable == true and curSpell.manaLeft > 45 then print(curSpell.name) IssueImmediateOrder(self[i].unit, curSpell.order) self:castSpell(i, curSpell) end -- Falling Strike curSpell = hero.spell(self[i], "fallingStrike") if (self[i].powerEnemy > 250.00 or self[i].clumpEnemyPower > 80.00) and curSpell.castable == true and curSpell.manaLeft > 45 then print(curSpell.name) if self[i].powerEnemy > 250.00 then IssuePointOrder(self[i].unit, curSpell.order, GetUnitX(self[i].unitPowerEnemy), GetUnitY(self[i].unitPowerEnemy)) else IssuePointOrder(self[i].unit, curSpell.order, GetUnitX(self[i].clumpEnemy), GetUnitY(self[i].clumpEnemy)) end self:castSpell(i, curSpell) end -- Shift Storm curSpell = hero.spell(self[i], "shiftStorm") if self[i].countUnitEnemy >= 6 and curSpell.castable == true and curSpell.manaLeft > 30 then print(curSpell.name) IssueImmediateOrder(self[i].unit, curSpell.order) self:castSpell(i, curSpell) end end -- Clean up custom Intel DestroyGroup(gIllusions) end end function self:tactitionAI(i) local curSpell ---@type table local u -- Iron Defense curSpell = hero.spell(self[i], "ironDefense") if self[i].countUnitEnemy >= 2 and curSpell.castable == true and curSpell.manaLeft > 20 and self[i].lifePercent < 80 and not self[i].casting then print(curSpell.name) IssueImmediateOrder(self[i].unit, curSpell.order) self:castSpell(i, curSpell) end if not self[i].fleeing and not self[i].lowLife then -- Bolster curSpell = hero.spell(self[i], "bolster") if self[i].countUnitFriendClose >= 1 and curSpell.castable == true and curSpell.manaLeft > 50 and not self[i].casting then print(curSpell.name) IssueImmediateOrder(self[i].unit, curSpell.order) self:castSpell(i, curSpell) end -- Attack! curSpell = hero.spell(self[i], "attack") if CountUnitsInGroup(self[i].heroesEnemy) > 0 and curSpell.castable == true and curSpell.manaLeft > 40 and not self[i].casting then print(curSpell.name) u = GroupPickRandomUnit(self[i].heroesEnemy) IssuePointOrder(self[i].unit, curSpell.order, GetUnitX(u), GetUnitY(u)) IssueImmediateOrder(self[i].unit, curSpell.order) self:castSpell(i, curSpell) end end end function self:timeMageAI(i) if self[i].casting then return end local curSpell ---@type table local x, y, u if not self[i].fleeing and not self[i].lowLife then -- chrono Atrophy curSpell = hero.spell(self[i], "chronoAtrophy") if self[i].clumpBothNumber >= 7 and curSpell.castable and curSpell.manaLeft > 30 then print(curSpell.name) x = GetUnitX(self[i].clumpBoth) y = GetUnitY(self[i].clumpBoth) IssuePointOrder(self[i].unit, curSpell.order, x, y) self:castSpell(i, curSpell) return end -- Decay curSpell = hero.spell(self[i], "decay") if CountUnitsInGroup(self[i].heroesEnemies) > 0 and curSpell.castable == true and curSpell.manaLeft > 20 then print(curSpell.name) u = GroupPickRandomUnit(self[i].heroesEnemies) IssuePointOrder(self[i].unit, curSpell.order, GetUnitX(u), GetUnitY(u)) self:castSpell(i, curSpell) return end -- Time Travel curSpell = hero.spell(self[i], "timeTravel") if self[i].clumpBothNumber >= 4 and curSpell.castable and curSpell.manaLeft > 30 then print(curSpell.name) x = GetUnitX(self[i].clumpBoth) y = GetUnitY(self[i].clumpBoth) IssuePointOrder(self[i].unit, curSpell.order, x, y) self:castSpell(i, curSpell) return end end end return self end end -- Functions function init_aiLoopStates() if (ai.count > 0) then local t = CreateTrigger() TriggerRegisterTimerEventPeriodic(t, ai.tick) TriggerAddAction(t, function() -- print(" -- ") if ai.loop >= ai.count then ai.loop = 1 else ai.loop = ai.loop + 1 end local i = ai.heroOptions[ai.loop] print(i) try(function() ai:updateIntel(i) if ai:isAlive(i) then ai:STATEDead(i) ai:STATELowHealth(i) ai:STATEStopFleeing(i) ai:STATEFleeing(i) ai:STATEHighHealth(i) ai:STATEcastingSpell(i) ai:STATEDefend(i) ai:STATEDefending(i) ai:STATEAbilities(i) ai:CleanUp(i) else ai:STATERevived(i) end print(" --") end) end) end end ---comment ---@param triggerUnit unit ---@param four string function CAST_aiHero(triggerUnit, four) if IsUnitInGroup(triggerUnit, ai.heroGroup) then local heroName = indexer:getKey(triggerUnit, "heroName") local spellCastData = spell[SPELL.NAME[four]] if spellCastData ~= nil then ai:castSpell(heroName, spellCastData) print("MANUAL CAST") end end end -- Unit Casts Spell function Init_UnitCastsSpell() trig_CastSpell = CreateTrigger() TriggerRegisterAnyUnitEventBJ(trig_CastSpell, EVENT_PLAYER_UNIT_SPELL_CAST) TriggerAddAction(trig_CastSpell, function() local triggerUnit = GetTriggerUnit() local order = OrderId2String(GetUnitCurrentOrder(triggerUnit)) local spellCast = CC2Four(GetSpellAbilityId()) try(function() CAST_aiHero(triggerUnit, spellCast) end, "CAST_aiHero") end) end
--[[ This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:29' using the latest game version. NOTE: This file should only be used as IDE support; it should NOT be distributed with addons! **************************************************************************** CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC. **************************************************************************** ]] --Tooltip Style ------------------------------ local DEFAULT_TEXTURE_SIZE = 24 function ZO_Tooltip_CopyStyle(style) return ZO_ShallowTableCopy(style) end --Tooltips Properties --layoutPrimaryDirection - The direction the controls are laid out in: "up", "down", "left", "right." --layoutPrimaryDirectionCentered - If true, and the primary direction is fixed (for example, you're laying out controls to the left and the width is fixed) the controls are centered in the space. --layoutSecondaryDirection - The direction the layout moves when the primary direction is filled. For example, after you fill a horizontal line it will advance vertically. "up", "down", "left", "right." --width - Fixed width. "auto" sets the width to 0 for auto sizing labels. --widthPercent - Fixed width as a percent of it's parent's inner width. --height - Fixed height. --heightPercent - Fixed height as a percent of it's parent's inner height. --childSpacing - Space between each control that is added to a section. --customSpacing - Custom space above the control. --fontFace - Font face. --fontSize - Font size. --horizontalAlignment - The horizontal alignment of a label --fontColorField, fontColorType - Interface color to set on the label --padding, paddingLeft, paddingRight, paddingTop, paddingBottom - Extra unused space in a section. Consumes the fixed dimension space. For example, if width was 100 and padding 10, then there are -- 80 UI units of space (100 - 10 * 2) to add controls. --uppercase - Renders the text in uppercase if set to true. --statValuePairSpacing - Spacing between the stat name and the value in a stat value pair. --statusBarTemplate - Template used to create a status bar. --desaturation - Sets the desaturation of textures. --tint - Sets a tint color that is used with textures. --dimensionConstraints - provides restrictions on the minimum or maximum width or height of a sections. This should be a table with -- some combination of minHeight, maxHeight, minWidth, and maxWidth set. Any combination may be nil. This property is not inherited -- by children. --Tooltip Styled Object ------------------------------ ZO_TooltipStyledObject = {} function ZO_TooltipStyledObject:Initialize(parent) self.parent = parent end function ZO_TooltipStyledObject:GetParent() return self.parent end function ZO_TooltipStyledObject:GetProperty(propertyName, ...) local propertyValue = self:GetPropertyNoChain(propertyName, ...) if(propertyValue ~= nil) then return propertyValue end local section = self while(section ~= nil) do local styles = section:GetStyles() if(styles) then propertyValue = self:GetPropertyNoChain(propertyName, unpack(styles)) if(propertyValue ~= nil) then return propertyValue end end section = section:GetParent() end end function ZO_TooltipStyledObject:GetPropertyNoChain(propertyName, ...) for i = 1, select("#", ...) do local style = select(i, ...) if(style) then local propertyValue = style[propertyName] if(propertyValue ~= nil) then return propertyValue end end end end --where ... is the list of styles function ZO_TooltipStyledObject:GetFontString(...) local fontFace = self:GetProperty("fontFace", ...) local fontSize = self:GetProperty("fontSize", ...) if fontFace and fontSize then if type(fontSize) == "number" then fontSize = tostring(fontSize) end local fontStyle = self:GetProperty("fontStyle", ...) if fontStyle then return string.format("%s|%s|%s", fontFace, fontSize, fontStyle) else return string.format("%s|%s", fontFace, fontSize) end else return "ZoFontGame" end end --where ... is the list of styles function ZO_TooltipStyledObject:FormatLabel(label, text, ...) local fontString = self:GetFontString(...) if(fontString ~= label.fontString) then label:SetFont(fontString) label.fontString = fontString end local uppercase = self:GetProperty("uppercase", ...) label:SetModifyTextType(uppercase and MODIFY_TEXT_TYPE_UPPERCASE or MODIFY_TEXT_TYPE_NONE) label:SetText(text) local interfaceColor = self:GetProperty("fontColor", ...) if interfaceColor then label:SetColor(interfaceColor:UnpackRGBA()) else local interfaceColorField = self:GetProperty("fontColorField", ...) if(interfaceColorField ~= nil) then local interfaceColorType = self:GetProperty("fontColorType", ...) if(interfaceColorType ~= nil) then label:SetColor(GetInterfaceColor(interfaceColorType, interfaceColorField)) end end end local interfaceHorizontalAlignmentField = self:GetProperty("horizontalAlignment", ...) if(interfaceHorizontalAlignmentField ~= nil) then label:SetHorizontalAlignment(interfaceHorizontalAlignmentField) else label:SetHorizontalAlignment(TEXT_ALIGN_LEFT) end end --where ... is the list of styles function ZO_TooltipStyledObject:GetWidthProperty(...) local width = self:GetPropertyNoChain("width", ...) if(width == nil) then local widthPercent = self:GetPropertyNoChain("widthPercent", ...) if(widthPercent) then if(self.parent) then if(self.parent:IsVertical()) then width = self.parent:GetInnerSecondaryDimension() else width = self.parent:GetInnerPrimaryDimension() end width = width * (widthPercent / 100) end end end return width end --where ... is the list of styles function ZO_TooltipStyledObject:GetHeightProperty(...) local height = self:GetPropertyNoChain("height", ...) if(height == nil) then local heightPercent = self:GetPropertyNoChain("heightPercent", unpack(self.styles)) if(heightPercent) then if(self.parent) then if(self.parent:IsVertical()) then height = self.parent:GetInnerPrimaryDimension() else height = self.parent:GetInnerSecondaryDimension() end height = height * (heightPercent / 100) end end end return height end function ZO_TooltipStyledObject:GetStyles() return self.styles end function ZO_TooltipStyledObject:SetStyles(...) self.styles = {...} self:ApplyStyles() end function ZO_TooltipStyledObject:ApplyStyles() end --Tooltip Stat Value Pair ------------------------------ local ZO_TooltipStatValuePair = {} function ZO_TooltipStatValuePair:Initialize(parent) ZO_TooltipStyledObject.Initialize(self, parent) self.statLabel = self:GetNamedChild("Stat") self.valueLabel = self:GetNamedChild("Value") -- in case the width was set in ComputeDimensions, reset it so it can dynamically resize again self.valueLabel:SetWidth(0) end --where ... is a list of styles function ZO_TooltipStatValuePair:SetStat(statText, ...) self:FormatLabel(self.statLabel, statText, ...) self:SetDimensions(self:ComputeDimensions()) end --where ... is a list of styles function ZO_TooltipStatValuePair:SetValue(valueText, ...) self:FormatLabel(self.valueLabel, valueText, ...) local spacing = self:GetProperty("statValuePairSpacing") or 5 self.valueLabel:ClearAnchors() self.valueLabel:AnchorToBaseline(self:GetNamedChild("Stat"), spacing, RIGHT) self:SetDimensions(self:ComputeDimensions()) end function ZO_TooltipStatValuePair:ComputeDimensions() local spacing = self:GetProperty("statValuePairSpacing") or 5 local statWidth, statHeight = self.statLabel:GetTextDimensions() local valueWidth, valueHeight = self.valueLabel:GetTextDimensions() local height = self:GetHeightProperty(unpack(self.styles)) local width = self:GetWidthProperty(unpack(self.styles)) if(width == nil) then width = statWidth + spacing + valueWidth else self.valueLabel:SetWidth(width - spacing - statWidth) valueWidth, valueHeight = self.valueLabel:GetTextDimensions() -- Recompute because line wrapping could cause the height to change end if(height == nil) or (valueHeight > height) then height = zo_max(statHeight, valueHeight) end return width, height end function ZO_TooltipStatValuePair:UpdateFontOffset() local statTop = self.statLabel:GetTop() local valueTop = self.valueLabel:GetTop() if statTop ~= valueTop then local heightDifference = statTop - valueTop local isValid, point, relTo, relPoint, offsetX = self.statLabel:GetAnchor() self.statLabel:SetAnchor(point, relTo, relPoint, offsetX, heightDifference) end end --Tooltip Stat Value Slider ------------------------------ local ZO_TooltipStatValueSlider = {} function ZO_TooltipStatValueSlider:Initialize(parent) ZO_TooltipStyledObject.Initialize(self, parent) self.nameLabel = self:GetNamedChild("Stat") self.valueLabel = self:GetNamedChild("Value") self.slider = self:GetNamedChild("Slider") self.sliderBar = self.slider:GetNamedChild("Bar") end --where ... is a list of styles function ZO_TooltipStatValueSlider:SetStat(statText, ...) self:FormatLabel(self.nameLabel, statText, ...) self:SetDimensions(self:ComputeDimensions()) end --where ... is a list of styles function ZO_TooltipStatValueSlider:SetValue(value, maxValue, valueText, ...) local spacing = self:GetProperty("statValuePairSpacing") or 5 local gradientColors = self:GetProperty("gradientColors") -- Setup the slider. local FORCE_VALUE = true ZO_StatusBar_SmoothTransition(self.sliderBar, value, maxValue, FORCE_VALUE) if gradientColors then ZO_StatusBar_SetGradientColor(self.sliderBar, gradientColors) end -- Setup the label. self:FormatLabel(self.valueLabel, valueText, ...) self.valueLabel:ClearAnchors() self.valueLabel:SetAnchor(TOP, self.nameLabel, TOP) self.valueLabel:SetAnchor(LEFT, self.slider, RIGHT, spacing) self:SetDimensions(self:ComputeDimensions()) end function ZO_TooltipStatValueSlider:ComputeDimensions() local spacing = self:GetProperty("statValuePairSpacing") or 5 local statWidth, statHeight = self.nameLabel:GetTextDimensions() local valueWidth, valueHeight = self.valueLabel:GetTextDimensions() local sliderWidth, sliderHeight = self.slider:GetDimensions() local height = self:GetHeightProperty(unpack(self.styles)) if(height == nil) then height = zo_max(statHeight, valueHeight, sliderHeight) end local width = self:GetWidthProperty(unpack(self.styles)) if(width == nil) then width = statWidth + spacing + valueWidth + spacing + sliderWidth end return width, height end --Tooltip Status Bar ZO_TooltipStatusBar = {} function ZO_TooltipStatusBar:ApplyStyles() local height = self:GetHeightProperty(unpack(self.styles)) if height then self:SetHeight(height) end local width = self:GetWidthProperty(unpack(self.styles)) if width then self:SetWidth(width) end local gradientColors = self:GetProperty("statusBarGradientColors") if gradientColors then ZO_StatusBar_SetGradientColor(self, gradientColors) end end --Tooltip Custom Control ZO_TooltipCustomControl = {} function ZO_TooltipCustomControl:ApplyStyles() local height = self:GetHeightProperty(unpack(self.styles)) if height then self:SetHeight(height) end local width = self:GetWidthProperty(unpack(self.styles)) if width then self:SetWidth(width) end end --Tooltip Section ------------------------------ ZO_TooltipSection = {} function ZO_TooltipSection.InitializeStaticPools(class) class.labelPool = ZO_ControlPool:New("ZO_TooltipLabel", GuiRoot, "Label") class.texturePool = ZO_ControlPool:New("ZO_TooltipTexture", GuiRoot, "Texture") class.colorPool = ZO_ControlPool:New("ZO_TooltipColorSwatch", GuiRoot, "Color") class.colorPool:SetCustomFactoryBehavior(function(control) control.label = control:GetNamedChild("Label") control.backdrop = control:GetNamedChild("Backdrop") control.Reset = function() control.label:SetText("") control:SetColor(1, 1, 1, 1) end end) class.colorPool:SetCustomResetBehavior(function(control) control:Reset() end) class.statValuePairPool = ZO_ControlPool:New("ZO_TooltipStatValuePair", GuiRoot, "StatValuePair") class.statValuePairPool:SetCustomFactoryBehavior(function(control) zo_mixin(control, ZO_TooltipStyledObject, ZO_TooltipStatValuePair) end) class.statValueSliderPool = ZO_ControlPool:New("ZO_TooltipStatValueSlider", GuiRoot, "StatValueSlider") class.statValueSliderPool:SetCustomFactoryBehavior(function(control) zo_mixin(control, ZO_TooltipStyledObject, ZO_TooltipStatValueSlider) end) class.sectionPool = ZO_ControlPool:New("ZO_TooltipSection", GuiRoot, "Section") class.sectionPool:SetCustomFactoryBehavior(function(control) zo_mixin(control, ZO_TooltipStyledObject, ZO_TooltipSection) end) class.sectionPool:SetCustomResetBehavior(function(control) control:Reset() end) end ZO_TooltipSection.InitializeStaticPools(ZO_TooltipSection) function ZO_TooltipSection:CreateMetaControlPool(sourcePool) local metaPool = ZO_MetaPool:New(sourcePool) metaPool:SetCustomAcquireBehavior(function(control) if control.Initialize then control:Initialize(self) end control:SetParent(self.contentsControl) end) return metaPool end function ZO_TooltipSection:Initialize(parent) ZO_TooltipStyledObject.Initialize(self, parent) self.contentsControl = self:GetNamedChild("Contents") if not self.hasInitialized then self.labelPool = self:CreateMetaControlPool(ZO_TooltipSection.labelPool) self.texturePool = self:CreateMetaControlPool(ZO_TooltipSection.texturePool) self.colorPool = self:CreateMetaControlPool(ZO_TooltipSection.colorPool) self.statValuePairPool = self:CreateMetaControlPool(ZO_TooltipSection.statValuePairPool) self.statValueSliderPool = self:CreateMetaControlPool(ZO_TooltipSection.statValueSliderPool) self.sectionPool = self:CreateMetaControlPool(ZO_TooltipSection.sectionPool) self.hasInitialized = true end self.customControlPools = {} end --Style Application function ZO_TooltipSection:ApplyPadding() local padding = self:GetPropertyNoChain("padding", unpack(self.styles)) self.paddingLeft = self:GetPropertyNoChain("paddingLeft", unpack(self.styles)) or padding or 0 self.paddingRight = self:GetPropertyNoChain("paddingRight", unpack(self.styles)) or padding or 0 self.paddingTop = self:GetPropertyNoChain("paddingTop", unpack(self.styles)) or padding or 0 self.paddingBottom = self:GetPropertyNoChain("paddingBottom", unpack(self.styles)) or padding or 0 self.contentsControl:ClearAnchors() self.contentsControl:SetAnchor(TOPLEFT, nil, TOPLEFT, self.paddingLeft, self.paddingTop) self.contentsControl:SetAnchor(BOTTOMRIGHT, nil, BOTTOMRIGHT, -self.paddingRight, -self.paddingBottom) end function ZO_TooltipSection:ApplyLayoutVariables() local layoutPrimaryDirection = self:GetPropertyNoChain("layoutPrimaryDirection", unpack(self.styles)) or "down" local layoutSecondaryDirection = self:GetPropertyNoChain("layoutSecondaryDirection", unpack(self.styles)) or "right" self.primaryCursorDirection = (layoutPrimaryDirection == "down" or layoutPrimaryDirection == "right") and 1 or -1 self.secondaryCursorDirection = (layoutSecondaryDirection == "down" or layoutSecondaryDirection == "right") and 1 or -1 self.vertical = (layoutPrimaryDirection == "up" or layoutPrimaryDirection == "down") local combinedDirection = layoutPrimaryDirection .. layoutSecondaryDirection if(combinedDirection == "upleft" or combinedDirection == "leftup") then self.layoutRootAnchor = BOTTOMRIGHT elseif(combinedDirection == "downleft" or combinedDirection == "leftdown") then self.layoutRootAnchor = TOPRIGHT elseif(combinedDirection == "upright" or combinedDirection == "rightup") then self.layoutRootAnchor = BOTTOMLEFT else self.layoutRootAnchor = TOPLEFT end end function ZO_TooltipSection:ApplyStyles() self:ApplyLayoutVariables() self:ApplyPadding() self:Reset() end --Reset function ZO_TooltipSection:SetupPrimaryDimension() if(self:IsVertical()) then local fixedHeight = self:GetHeightProperty(unpack(self.styles)) if(fixedHeight ~= nil) then self:SetPrimaryDimension(fixedHeight) self.innerPrimaryDimension = fixedHeight - self.paddingTop - self.paddingBottom self.isPrimaryDimensionFixed = true else self:SetPrimaryDimension(self.paddingTop + self.paddingBottom) self.innerPrimaryDimension = nil self.isPrimaryDimensionFixed = false end else local fixedWidth = self:GetWidthProperty(unpack(self.styles)) if(fixedWidth ~= nil) then self:SetPrimaryDimension(fixedWidth) self.innerPrimaryDimension = fixedWidth - self.paddingLeft - self.paddingRight self.isPrimaryDimensionFixed = true else self:SetPrimaryDimension(self.paddingLeft + self.paddingRight) self.innerPrimaryDimension = nil self.isPrimaryDimensionFixed = nil end end if self.isPrimaryDimensionFixed then self.isPrimaryDimensionCentered = self:GetPropertyNoChain("layoutPrimaryDirectionCentered", unpack(self.styles)) or false else self.isPrimaryDimensionCentered = false end end function ZO_TooltipSection:SetupSecondaryDimension() if(self:IsVertical()) then local fixedWidth = self:GetWidthProperty(unpack(self.styles)) if(fixedWidth ~= nil) then self:SetSecondaryDimension(fixedWidth) self.innerSecondaryDimension = fixedWidth - self.paddingLeft - self.paddingRight self.isSecondaryDimensionFixed = true else self:SetSecondaryDimension(self.paddingLeft + self.paddingRight) self.innerSecondaryDimension = nil self.isSecondaryDimensionFixed = false end else local fixedHeight = self:GetHeightProperty(unpack(self.styles)) if(fixedHeight ~= nil) then self:SetSecondaryDimension(fixedHeight) self.innerSecondaryDimension = fixedHeight - self.paddingTop - self.paddingBottom self.isSecondaryDimensionFixed = true else self:SetSecondaryDimension(self.paddingTop + self.paddingBottom) self.innerSecondaryDimension = nil self.isSecondaryDimensionFixed = false end end end function ZO_TooltipSection:Reset() self.primaryCursor = 0 self.secondaryCursor = 0 self.numControls = 0 self.firstInLine = true self.maxSecondarySizeOnLine = 0 self.customNextSpacing = nil self:SetupPrimaryDimension() self:SetupSecondaryDimension() self.labelPool:ReleaseAllObjects() self.texturePool:ReleaseAllObjects() self.colorPool:ReleaseAllObjects() self.sectionPool:ReleaseAllObjects() self.statValuePairPool:ReleaseAllObjects() self.statValueSliderPool:ReleaseAllObjects() for _, pool in pairs(self.customControlPools) do pool:ReleaseAllObjects() end end --Layout Variables function ZO_TooltipSection:IsVertical() return self.vertical end function ZO_TooltipSection:IsPrimaryDimensionFixed() return self.isPrimaryDimensionFixed end function ZO_TooltipSection:IsSecondaryDimensionFixed() return self.isSecondaryDimensionFixed end function ZO_TooltipSection:SetNextSpacing(spacing) self.customNextSpacing = spacing end --where ... is the list of styles function ZO_TooltipSection:GetNextSpacing(...) local customNextSpacing = self.customNextSpacing if(customNextSpacing == nil) then customNextSpacing = self:GetPropertyNoChain("customSpacing", ...) end self.customNextSpacing = nil if(self.firstInLine) then return customNextSpacing or 0 else local nextSpacing = customNextSpacing or self:GetProperty("childSpacing") or 0 return nextSpacing end end function ZO_TooltipSection:GetDimensionWithContraints(base, useHeightContraint) local constraints = self:GetPropertyNoChain("dimensionConstraints", unpack(self.styles)) if not constraints then return base end local min, max if useHeightContraint then min = constraints.minHeight max = constraints.maxHeight else min = constraints.minWidth max = constraints.maxWidth end min = min or base max = max or base return zo_clamp(base, min, max) end function ZO_TooltipSection:GetPrimaryDimension() return self:GetDimensionWithContraints(self.primaryDimension, self:IsVertical()) end function ZO_TooltipSection:GetInnerPrimaryDimension() return self.innerPrimaryDimension end function ZO_TooltipSection:SetPrimaryDimension(size) if(self:IsVertical()) then self:SetHeight(size) else self:SetWidth(size) end self.primaryDimension = size end function ZO_TooltipSection:AddToPrimaryDimension(amount) self:SetPrimaryDimension(self.primaryDimension + amount) end function ZO_TooltipSection:GetSecondaryDimension() return self:GetDimensionWithContraints(self.secondaryDimension, not self:IsVertical()) end function ZO_TooltipSection:GetInnerSecondaryDimension() return self.innerSecondaryDimension end function ZO_TooltipSection:SetSecondaryDimension(size) if(self:IsVertical()) then self:SetWidth(size) else self:SetHeight(size) end self.secondaryDimension = size end function ZO_TooltipSection:AddToSecondaryDimension(amount) self:SetSecondaryDimension(self.secondaryDimension + amount) end function ZO_TooltipSection:GetNumControls() return self.numControls end function ZO_TooltipSection:HasControls() return self.numControls > 0 end function ZO_TooltipSection:SetPoolKey(poolKey) self.poolKey = poolKey end function ZO_TooltipSection:GetPoolKey() return self.poolKey end --Layout --where ... is the list of styles function ZO_TooltipSection:ShouldAdvanceSecondaryCursor(primarySize, spacingSize) if(self:IsPrimaryDimensionFixed()) then return self.primaryCursor + spacingSize + primarySize > self.innerPrimaryDimension end return false end function ZO_TooltipSection:AddControl(control, primarySize, secondarySize, ...) control:SetParent(self.contentsControl) control:ClearAnchors() local spacing = self:GetNextSpacing(...) if self:ShouldAdvanceSecondaryCursor(primarySize, spacing) then local advanceAmount = self.maxSecondarySizeOnLine + (self:GetProperty("childSecondarySpacing") or 0) self.secondaryCursor = self.secondaryCursor + advanceAmount if not self:IsSecondaryDimensionFixed() then self:AddToSecondaryDimension(advanceAmount) end self.maxSecondarySizeOnLine = 0 self.primaryCursor = 0 self.firstInLine = true spacing = self:GetNextSpacing(...) end self.primaryCursor = self.primaryCursor + spacing self.maxSecondarySizeOnLine = zo_max(self.maxSecondarySizeOnLine, secondarySize) if not self:IsSecondaryDimensionFixed() then if self:IsVertical() then self:SetSecondaryDimension(self.maxSecondarySizeOnLine + self.secondaryCursor + self.paddingLeft + self.paddingRight) else self:SetSecondaryDimension(self.maxSecondarySizeOnLine + self.secondaryCursor + self.paddingTop + self.paddingBottom) end end if self:IsVertical() then control.offsetX = self.secondaryCursor * self.secondaryCursorDirection control.offsetY = self.primaryCursor * self.primaryCursorDirection else control.offsetX = self.primaryCursor * self.primaryCursorDirection control.offsetY = self.secondaryCursor * self.secondaryCursorDirection end if not self.isPrimaryDimensionCentered then control:SetAnchor(self.layoutRootAnchor, nil, self.layoutRootAnchor, control.offsetX, control.offsetY) end if not self:IsPrimaryDimensionFixed() then self:AddToPrimaryDimension(primarySize + spacing) end self.primaryCursor = self.primaryCursor + primarySize self.numControls = self.numControls + 1 self.firstInLine = false if self.isPrimaryDimensionCentered then local centerOffsetPrimary = ((self.innerPrimaryDimension - self.primaryCursor) / 2) * self.primaryCursorDirection local numChildren = self.contentsControl:GetNumChildren() for i = 1, numChildren do local childControl = self.contentsControl:GetChild(i) local childSecondaryOffset = self:IsVertical() and childControl.offsetX or childControl.offsetY if childSecondaryOffset == self.secondaryCursor then local modifiedOffsetX = childControl.offsetX + (self:IsVertical() and 0 or centerOffsetPrimary) local modifiedOffsetY = childControl.offsetY + (self:IsVertical() and centerOffsetPrimary or 0) childControl:SetAnchor(self.layoutRootAnchor, nil, self.layoutRootAnchor, modifiedOffsetX, modifiedOffsetY) end end end end function ZO_TooltipSection:AddDimensionedControl(control) local width, height = control:GetDimensions() if(self:IsVertical()) then self:AddControl(control, height, width, unpack(control:GetStyles())) else self:AddControl(control, width, height, unpack(control:GetStyles())) end end --where ... is the list of styles function ZO_TooltipSection:AddLine(text, ...) local customFunction = function(label, ...) self:FormatLabel(label, text, ...) end self:AddCustomLabel(customFunction, ...) end function ZO_TooltipSection:AddCustomLabel(customFunction, ...) local label = self.labelPool:AcquireObject() customFunction(label, ...) local widthProperty = self:GetWidthProperty(...) local width = widthProperty if(width == "auto" or (width == nil and not self:IsVertical())) then width = 0 elseif(width == nil and self:IsVertical()) then width = self:GetInnerSecondaryDimension() end label:SetWidth(width) -- If the width of height property is set to a non-zero size, use that rather than the actual size -- of the text. This allows for fixed-width labels to be used in tooltips. local heightProperty = self:GetHeightProperty(...) local controlWidth, controlHeight = label:GetTextDimensions() if (type(widthProperty) == "number") and (widthProperty ~= 0) then controlWidth = widthProperty end if (type(heightProperty) == "number") and (heightProperty ~= 0) then controlHeight = heightProperty end if(self:IsVertical()) then self:AddControl(label, controlHeight, controlWidth, ...) else self:AddControl(label, controlWidth, controlHeight, ...) end end function ZO_TooltipSection:AddSimpleCurrency(currencyType, amount, options, showAll, notEnough, ...) local customFunction = function(label, ...) self:FormatLabel(label, "", ...) -- This is so it uses the correct styling ZO_CurrencyControl_SetSimpleCurrency(label, currencyType, amount, options, showAll, notEnough) -- ZO_CurrencyControl_SetSimpleCurrency will set the font in this case so the fontString attribute need to be updated to reflect -- the new font so that the label will be reset correctly when added back into the label pool. if options.font then label.fontString = options.font end end self:AddCustomLabel(customFunction, ...) end function ZO_TooltipSection:BasicTextureSetup(texture, ...) local width = self:GetWidthProperty(...) if(width == nil or width == 0) then -- Set default width width = DEFAULT_TEXTURE_SIZE end texture:SetWidth(width) local height = self:GetHeightProperty(...) if(height == nil or height == 0) then -- Set default height height = DEFAULT_TEXTURE_SIZE end texture:SetHeight(height) if(self:IsVertical()) then self:AddControl(texture, height, width, ...) else self:AddControl(texture, width, height, ...) end end --where ... is the list of styles function ZO_TooltipSection:AddTexture(path, ...) local texture = self.texturePool:AcquireObject() texture:SetTexture(path) local desaturation = self:GetProperty("desaturation", ...) or 0 texture:SetDesaturation(desaturation) local color = self:GetProperty("color", ...) if color then texture:SetColor(color:UnpackRGBA()) else texture:SetColor(ZO_DEFAULT_ENABLED_COLOR:UnpackRGBA()) end local left = self:GetProperty("textureCoordinateLeft", ...) or 0 local right = self:GetProperty("textureCoordinateRight", ...) or 1 local top = self:GetProperty("textureCoordinateTop", ...) or 0 local bottom = self:GetProperty("textureCoordinateBottom", ...) or 1 texture:SetTextureCoords(left, right, top, bottom) self:BasicTextureSetup(texture, ...) end --where ... is the list of styles function ZO_TooltipSection:AddColorSwatch(r, g, b, a, ...) self:AddColorAndTextSwatch(r, g, b, a, "", ...) end --where ... is the list of styles function ZO_TooltipSection:AddColorAndTextSwatch(r, g, b, a, text, ...) local control = self.colorPool:AcquireObject() control:SetColor(r, g, b, a) local edgeTextureFile = self:GetProperty("edgeTextureFile", ...) local edgeTextureWidth = self:GetProperty("edgeTextureWidth", ...) local edgeTextureHeight = self:GetProperty("edgeTextureHeight", ...) if edgeTextureFile and edgeTextureWidth and edgeTextureHeight then control.backdrop:SetHidden(false) control.backdrop:SetEdgeTexture(edgeTextureFile, edgeTextureWidth, edgeTextureHeight) else control.backdrop:SetHidden(true) end self:FormatLabel(control.label, zo_strformat(SI_ITEM_FORMAT_STR_COLOR_NAME, text), ...) self:BasicTextureSetup(control, ...) end function ZO_TooltipSection:AddSectionEvenIfEmpty(section) if(self:IsVertical()) then if(section:IsVertical()) then self:AddControl(section, section:GetPrimaryDimension(), section:GetSecondaryDimension(), unpack(section:GetStyles())) else self:AddControl(section, section:GetSecondaryDimension(), section:GetPrimaryDimension(), unpack(section:GetStyles())) end else if(section:IsVertical()) then self:AddControl(section, section:GetSecondaryDimension(), section:GetPrimaryDimension(), unpack(section:GetStyles())) else self:AddControl(section, section:GetPrimaryDimension(), section:GetSecondaryDimension(), unpack(section:GetStyles())) end end end function ZO_TooltipSection:AddSection(section) if(not section:HasControls()) then self:ReleaseSection(section) return end self:AddSectionEvenIfEmpty(section) end --where ... is the list of styles function ZO_TooltipSection:AcquireSection(...) local section, key = self.sectionPool:AcquireObject() section:SetPoolKey(key) section:SetStyles(...) return section end function ZO_TooltipSection:ReleaseSection(section) self.sectionPool:ReleaseObject(section:GetPoolKey()) end --where ... is the list of styles function ZO_TooltipSection:AcquireStatValuePair(...) local statValuePair = self.statValuePairPool:AcquireObject() statValuePair:SetStyles(...) return statValuePair end function ZO_TooltipSection:AcquireStatValueSlider(...) local statValueSlider = self.statValueSliderPool:AcquireObject() statValueSlider:SetStyles(...) return statValueSlider end function ZO_TooltipSection:AddStatValuePair(statValuePair) self:AddDimensionedControl(statValuePair) statValuePair:UpdateFontOffset() end function ZO_TooltipSection:AcquireStatusBar(...) local template = self:GetProperty("statusBarTemplate", ...) local pool = self.customControlPools[template] if not pool then pool = ZO_ControlPool:New(template, self.contentsControl, self:GetProperty("statusBarTemplateOverrideName", ...)) pool:SetCustomFactoryBehavior(function(control) zo_mixin(control, ZO_TooltipStyledObject, ZO_TooltipStatusBar) control:Initialize(self) end) self.customControlPools[template] = pool end local bar = pool:AcquireObject() bar:SetStyles(...) return bar end function ZO_TooltipSection:AddStatusBar(statusBar) self:AddDimensionedControl(statusBar) end function ZO_TooltipSection:AcquireCustomControl(...) local template = self:GetProperty("controlTemplate", ...) local pool = self.customControlPools[template] if not pool then pool = ZO_ControlPool:New(template, self.contentsControl, self:GetProperty("controlTemplateOverrideName", ...)) pool:SetCustomFactoryBehavior(function(control) zo_mixin(control, ZO_TooltipStyledObject, ZO_TooltipCustomControl) control:Initialize(self) end) self.customControlPools[template] = pool end local styledControl = pool:AcquireObject() styledControl:SetStyles(...) return styledControl end function ZO_TooltipSection:AddCustomControl(control) self:AddDimensionedControl(control) end --Tooltip ------------------------------ ZO_Tooltip = {} function ZO_Tooltip:Initialize(control, styleNamespace, style) zo_mixin(control, ZO_TooltipStyledObject, ZO_TooltipSection, self) ZO_TooltipSection.Initialize(control) control.styleNamespace = styleNamespace control:SetStyles(control:GetStyle(style or "tooltip")) control:SetClearOnHidden(true) end function ZO_Tooltip:SetClearOnHidden(clearOnHidden) if clearOnHidden then self:SetHandler("OnEffectivelyHidden", function() self:Reset() end) else self:SetHandler("OnEffectivelyHidden", nil) end end local RELATIVE_POINT_FROM_POINT = { [TOP] = BOTTOM, [TOPRIGHT] = TOPLEFT, [RIGHT] = LEFT, [BOTTOMRIGHT] = BOTTOMLEFT, [BOTTOM] = TOP, [BOTTOMLEFT] = BOTTOMRIGHT, [LEFT] = RIGHT, [TOPLEFT] = TOPRIGHT, } function ZO_Tooltip:SetOwner(owner, point, offsetX, offsetY, relativePoint) self.owner = owner if owner then self:ClearAnchors() if relativePoint == nil then relativePoint = RELATIVE_POINT_FROM_POINT[point] end self:SetAnchor(point, owner, relativePoint, offsetX or 0, offsetY or 0) end end function ZO_Tooltip:ClearLines() self:Reset() end function ZO_Tooltip:GetStyle(styleName) return self.styleNamespace[styleName] end function ZO_Tooltip:LayoutTitleAndDescriptionTooltip(title, description) self:LayoutTitleAndMultiSectionDescriptionTooltip(title, description) end function ZO_Tooltip:LayoutTitleAndMultiSectionDescriptionTooltip(title, ...) --Title if title then local headerSection = self:AcquireSection(self:GetStyle("bodyHeader")) headerSection:AddLine(title, self:GetStyle("title")) self:AddSection(headerSection) end --Body for i = 1, select("#", ...) do local bodySection = self:AcquireSection(self:GetStyle("bodySection")) bodySection:AddLine(select(i, ...), self:GetStyle("bodyDescription")) self:AddSection(bodySection) end end
project = "plugin" title = "Plugin Title" description = "Plugin Description" full_description = "Plugin Full Description" not_luadoc = true template = true examples = "examples" custom_tags = { { "link", title = "Links", format = function(text) local name = text:gsub("^%s*(.-)%s*http.*$", "%1", 1) local link = text:gsub("^.*%s*(http.-)%s*$", "%1", 1) local fmt = "%s: <%s>" return fmt:format(name, link) end, }, { "homepage", title = "Homepage" }, } alias("tfield", { "field", modifiers = { type = "$1" } })
-- https://github.com/kosayoda/nvim-lightbulb local icons = require('icons') vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()]] vim.fn.sign_define('LightBulbSign', { text = icons.lightbulb })
lokis_favor = { cast = function(player) if (not player:hasDuration("lokis_favor")) then player:setDuration("lokis_favor", 9999999) else player:setDuration("lokis_favor", 1) end end, while_cast_500 = function(player) player:swing() player:swing() if (not player:hasDuration("flank_warrior")) then flank_warrior.cast(player) end if (not player:hasDuration("backstab_warrior")) then backstab_warrior.cast(player) end if (not player:hasDuration("potence_warrior")) then potence_warrior.cast(player) end if (not player:hasDuration("bless_warrior")) then bless_warrior.cast(player) end if (not player:hasAether("chung_ryongs_rage")) then if (player:getDuration("chung_ryongs_rage") > 125000 or player:getDuration("chung_ryongs_rage") == 0) then chung_ryongs_rage.cast(player) end end end, uncast = function(player) end }
local InfiniteScroller = script:FindFirstAncestor("infinite-scroller") local Root = InfiniteScroller.Parent local Roact = require(Root.Roact) local Cryo = require(Root.Cryo) local Scroller = require(InfiniteScroller).Scroller local Story = Roact.PureComponent:extend("Rhodium Story - a few large items") function Story:render() return Roact.createElement(Scroller, Cryo.Dictionary.join({ BackgroundColor3 = Color3.fromRGB(255, 0, 0), Size = UDim2.new(0, 50, 0, 50), padding = UDim.new(), itemList = {1, 2, 3, 4, 5, 6, 7}, focusIndex = 4, anchorLocation = UDim.new(0.5, 0), loadingBuffer = 2, mountingBuffer = 49, renderItem = function(item, _) return Roact.createElement("Frame", { Size = UDim2.new(0, 50, 0, 50), BackgroundColor3 = Color3.fromRGB(item*30, item*30, item*30), }, { ["INDEX" .. tostring(item)] = Roact.createElement("Frame"), }) end, }, self.props)) end return Story
-- In Lua 5.1/LuaJIT, there is one global function called unpack. -- In Lua >= 5.2 it was deprecated in favor of the function table.unpack. -- The following line creates a new local variable called `unpack` pointing -- to the right function depending on the Lua version you are in. -- Just remember that unpack is not available in Lua >= 5.3 any more. local unpack = _G.unpack or table.unpack function test_brackets_convert_dot_dot_dot_to_table() local third = function(...) local args = {...} return args[3] end assert_equal('c', third('a','b','c','d')) end function test_unpack_for_converting_a_table_into_params() local params = {1,2,3} local sum = function(a,b,c) return a+b+c end assert_equal(6, sum(unpack(params))) end function test_functions_can_be_inserted_into_tables_and_invoked() local foo = function() return "foo" end local t = {} t[1] = foo assert_equal("foo", t[1]()) end function test_function_variables_can_be_used_as_literal_table_elements() local foo = function() return "foo" end local t = { foo } assert_equal("foo", t[1]()) end function test_anonymous_functions_can_be_used_as_literal_table_elements() local t = { function() return "foo" end } assert_equal("foo", t[1]()) end function test_functions_can_be_inserted_into_tables_with_strings_and_invoked() local bar = function() return "bar" end local t = {} t.bar = bar assert_equal("bar", t.bar()) end function test_function_variables_can_be_used_as_literal_table_elements_when_using_strings_as_keys() local bar = function() return "bar" end local t = { bar = bar } assert_equal("bar", t.bar()) end function test_anonymous_functions_can_be_used_as_literal_table_elements_when_using_strings_as_keys() local t = { bar = function() return "bar" end } assert_equal("bar", t.bar()) end function test_syntactic_sugar_for_declaring_functions_indexed_by_strings() -- declaring a function inside a table with a string is so common that Lua -- provides some syntactic sugar just for that: local t = {} function t.bar() return "bar" end assert_equal("bar", t.bar()) end function test_colon_syntactic_sugar_for_calling_functions_that_use_the_table_they_are_in_as_param() local t = { 1, 2, 3, 4, 5, 6 } function t.even(x) local result = {} for i=2, #x, 2 do table.insert(result, x[i]) end return result end local result1 = t.even(t) local result2 = t:even() -- notice that we used a colon instead of a dot here -- these two assertions should expect the same result assert_equal("2, 4, 6", table.concat(result1, ', ')) assert_equal("2, 4, 6", table.concat(result2, ', ')) end function test_automatic_first_parameter_called_self_when_using_colon_in_declaration() local t = { 1, 2, 3, 4, 5, 6 } function t:even() -- notice the colon here local result = {} for i=2, #self, 2 do -- notice the "self" table.insert(result, self[i]) end return result end local result = t:even() assert_equal("2, 4, 6", table.concat(result, ', ')) end
vim9jit = {} vim9jit.DefaultForType = function(type_str) if type_str == 'number' then return 0 else error(string.format('Unknown type_str: %s', type_str)) end end local exact_comparisons = { ["=="] = true, ["==#"] = true, } vim9jit.ComparisonEvaluate = function(operator, a, b) if exact_comparisons[operator] then return a == b end if operator == "==?" then return string.lower(a) == string.lower(b) end error("Unsupported operator: " .. operator) end -- Binary Op Evaluate -- Make sure to handle stuff like [1, 2] + [3] -> [1, 2, 3] vim9jit.BinaryOpEval = function(operator, a, b) end return vim9jit
--------------------------------------------- -- Fossilizaing Breath -- -- Description: Petrifies targets within a fan-shaped area. -- Type: Breath -- Ignores Shadows -- Range: Unknown cone --------------------------------------------- require("scripts/globals/monstertpmoves") require("scripts/globals/settings") require("scripts/globals/status") --------------------------------------------- function onMobSkillCheck(target,mob,skill) local mobSkin = mob:getModelId() if (mobSkin == 1805) then return 0 else return 1 end end function onMobWeaponSkill(target, mob, skill) local typeEffect = tpz.effect.PETRIFICATION local power = 1 local duration = 30 skill:setMsg(MobStatusEffectMove(mob, target, typeEffect, power, 0, duration)) return typeEffect end
local args = ... local row = args[1] local col = args[2] local y_offset = args[3] local af = Def.ActorFrame{ Name="SongWheelShared", InitCommand=function(self) self:y(y_offset) end } ----------------------------------------------------------------- -- black background quad af[#af+1] = Def.Quad{ Name="SongWheelBackground", InitCommand=cmd(zoomto, _screen.w, _screen.h/(row.how_many-2); diffuse, Color.Black; diffusealpha,1; cropbottom,1), OnCommand=cmd(xy, _screen.cx, math.ceil((row.how_many-2)/2) * row.h + 10; finishtweening; accelerate, 0.2; cropbottom,0), SwitchFocusToGroupsMessageCommand=cmd(smooth,0.3; cropright,1), SwitchFocusToSongsMessageCommand=cmd(smooth,0.3; cropright,0), SwitchFocusToSingleSongMessageCommand=cmd(smooth,0.3; cropright,1), } -- rainbow glowing border top af[#af+1] = Def.Quad{ InitCommand=cmd(zoomto, _screen.w, 1; diffuse, Color.White; diffusealpha,0; xy, _screen.cx, _screen.cy+30 + _screen.h/(row.how_many-2)*-0.5; faderight, 10; rainbow), OnCommand=cmd(sleep,0.3; diffusealpha, 0.75; queuecommand, "FadeMe"), FadeMeCommand=cmd(accelerate,1.5; faderight, 0; accelerate, 1.5; fadeleft, 10; sleep,0; diffusealpha,0; fadeleft,0; sleep,1.5; faderight, 10; diffusealpha,0.75; queuecommand, "FadeMe"), SwitchFocusToGroupsMessageCommand=cmd(visible, false), SwitchFocusToSingleSongMessageCommand=cmd(visible, false), SwitchFocusToSongsMessageCommand=cmd(visible,true) } -- rainbow glowing border bottom af[#af+1] = Def.Quad{ InitCommand=cmd(zoomto, _screen.w, 1; diffuse, Color.White; diffusealpha,0; xy, _screen.cx, _screen.cy+30 + _screen.h/(row.how_many-2) * 0.5; faderight, 10; rainbow), OnCommand=cmd(sleep,0.3; diffusealpha, 0.75; queuecommand, "FadeMe"), FadeMeCommand=cmd(accelerate,1.5; faderight, 0; accelerate, 1.5; fadeleft, 10; sleep,0; diffusealpha,0; fadeleft,0; sleep,1.5; faderight, 10; diffusealpha,0.75; queuecommand, "FadeMe"), SwitchFocusToGroupsMessageCommand=cmd(visible, false), SwitchFocusToSingleSongMessageCommand=cmd(visible, false), SwitchFocusToSongsMessageCommand=cmd(visible,true) } ----------------------------------------------------------------- -- left/right UI arrows af[#af+1] = Def.ActorFrame{ Name="Arrows", InitCommand=function(self) self:diffusealpha(0):xy(_screen.cx, _screen.cy+30) end, OnCommand=function(self) self:sleep(0.1):linear(0.2):diffusealpha(1) end, SwitchFocusToGroupsMessageCommand=cmd(linear, 0.2; diffusealpha, 0), SwitchFocusToSingleSongMessageCommand=cmd(linear, 0.1; diffusealpha, 0), SwitchFocusToSongsMessageCommand=cmd(sleep, 0.2; linear, 0.2; diffusealpha, 1), -- right arrow Def.ActorFrame{ Name="RightArrow", OnCommand=cmd(x, _screen.cx-50), PressCommand=cmd(decelerate,0.05; zoom,0.7; glow,color("#ffffff22"); accelerate,0.05; zoom,1; glow, color("#ffffff00");), LoadActor("./img/arrow_glow.png")..{ Name="RightArrowGlow", InitCommand=cmd(zoom,0.25), OnCommand=function(self) self:diffuseshift():effectcolor1(1,1,1,0):effectcolor2(1,1,1,1) end }, LoadActor("./img/arrow.png")..{ Name="RightArrow", InitCommand=cmd(zoom,0.25; diffuse, Color.White ), } }, -- left arrow Def.ActorFrame{ Name="LeftArrow", OnCommand=cmd(x, -_screen.cx+50), PressCommand=cmd(decelerate,0.05; zoom,0.7; glow,color("#ffffff22"); accelerate,0.05; zoom,1; glow, color("#ffffff00")), LoadActor("./img/arrow_glow.png")..{ Name="LeftArrowGlow", InitCommand=cmd(zoom,0.25; rotationz, 180), OnCommand=function(self) self:diffuseshift():effectcolor1(1,1,1,0):effectcolor2(1,1,1,1) end }, LoadActor("./img/arrow.png")..{ Name="LeftArrow", InitCommand=cmd(zoom,0.25; diffuse, Color.White; rotationz, 180), } } } ----------------------------------------------------------------- -- text af[#af+1] = Def.ActorFrame{ Name="CurrentSongInfoAF", InitCommand=function(self) self:y( row.h * 2 + 10 ):x( col.w + 80):diffusealpha(0) end, OnCommand=function(self) self:sleep(0.15):linear(0.15):diffusealpha(1) end, SwitchFocusToGroupsMessageCommand=function(self) self:visible(false) end, SwitchFocusToSongsMessageCommand=function(self) self:visible(true):linear(0.2):zoom(1):y(row.h*2+10):x(col.w+80) end, SwitchFocusToSingleSongMessageCommand=function(self) self:linear(0.2):zoom(0.9):xy(col.w+WideScale(20,65), row.h+43) end, -- main title Def.BitmapText{ Font="_miso", Name="Title", InitCommand=function(self) self:zoom(1.3):diffuse(Color.White):horizalign(left):y(-45):maxwidth(300) end, CurrentSongChangedMessageCommand=function(self, params) if params.song then self:settext( params.song:GetDisplayMainTitle() ) end end, SwitchFocusToGroupsMessageCommand=function(self) self:settext("") end, CloseThisFolderHasFocusMessageCommand=function(self) self:settext("") end, SwitchFocusToSingleSongMessageCommand=cmd(diffuse, Color.White), SwitchFocusToSongsMessageCommand=cmd(diffuse, Color.White) }, -- artist Def.BitmapText{ Font="_miso", Name="Artist", InitCommand=function(self) self:zoom(0.85):diffuse(Color.White):y(-20):horizalign(left) end, CurrentSongChangedMessageCommand=function(self, params) if params.song then self:settext( THEME:GetString("ScreenSelectMusic", "Artist") .. ": " .. params.song:GetDisplayArtist() ) end end, SwitchFocusToGroupsMessageCommand=function(self) self:settext("") end, CloseThisFolderHasFocusMessageCommand=function(self) self:settext("") end, SwitchFocusToSingleSongMessageCommand=cmd(diffuse, Color.White), SwitchFocusToSongsMessageCommand=cmd(diffuse, Color.White) }, Def.ActorFrame{ InitCommand=function(self) self:y(25) end, -- BPM Def.BitmapText{ Font="_miso", Name="BPM", InitCommand=function(self) self:zoom(0.65):diffuse(Color.White):y(0):horizalign(left) end, CurrentSongChangedMessageCommand=function(self, params) if params.song then self:settext( THEME:GetString("ScreenSelectMusic", "BPM") .. ": " .. GetDisplayBPMs() ) end end, SwitchFocusToGroupsMessageCommand=function(self) self:settext("") end, CloseThisFolderHasFocusMessageCommand=function(self) self:settext("") end, SwitchFocusToSingleSongMessageCommand=cmd(diffuse, Color.White), SwitchFocusToSongsMessageCommand=cmd(diffuse, Color.White) }, -- length Def.BitmapText{ Font="_miso", Name="Length", InitCommand=function(self) self:zoom(0.65):diffuse(Color.White):y(14):horizalign(left) end, CurrentSongChangedMessageCommand=function(self, params) if params.song then self:settext( THEME:GetString("ScreenSelectMusic", "Length") .. ": " .. SecondsToMMSS(params.song:MusicLengthSeconds()):gsub("^0*","") ) end end, SwitchFocusToGroupsMessageCommand=function(self) self:settext("") end, CloseThisFolderHasFocusMessageCommand=function(self) self:settext("") end, SwitchFocusToSingleSongMessageCommand=cmd(diffuse, Color.White), SwitchFocusToSongsMessageCommand=cmd(diffuse, Color.White) }, -- genre Def.BitmapText{ Font="_miso", Name="Genre", InitCommand=function(self) self:zoom(0.65):diffuse(Color.White):y(28):horizalign(left) end, CurrentSongChangedMessageCommand=function(self, params) if params.song then self:settext( THEME:GetString("ScreenSelectMusic", "Genre") .. ": " .. params.song:GetGenre() ) end end, SwitchFocusToGroupsMessageCommand=function(self) self:settext("") end, CloseThisFolderHasFocusMessageCommand=function(self) self:settext("") end, SwitchFocusToSingleSongMessageCommand=cmd(diffuse, Color.White), SwitchFocusToSongsMessageCommand=cmd(diffuse, Color.White) }, } } return af
tt = { createObject(3749,2759.6006000,1313.2002000,16.8000000,0.0000000,0.0000000,90.0000000), --object(clubgate01_lax), (2), createObject(6959,2799.6999500,1224.2998000,-10.2000000,90.0000000,0.0000000,0.0000000), --object(vegasnbball1), (11), createObject(11353,2758.2998000,1276.7002000,13.9000000,0.0000000,0.0000000,0.0000000), --object(station5new), (4), createObject(6959,2841.0000000,1224.2998000,-10.2000000,90.0000000,0.0000000,0.0000000), --object(vegasnbball1), (12), createObject(11353,2784.7998000,1223.7998000,13.6000000,0.0000000,0.0000000,90.0000000), --object(station5new), (8), createObject(11353,2834.1006000,1223.7998000,13.6000000,0.0000000,0.0000000,90.0000000), --object(station5new), (9), createObject(6959,2840.2002000,1244.2002000,-9.5500000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (13), createObject(11353,2860.9004000,1304.5996000,13.6000000,0.0000000,0.0000000,179.9950000), --object(station5new), (11), createObject(11353,2860.8999000,1355.1000000,13.6000000,0.0000000,0.0000000,179.9950000), --object(station5new), (12), createObject(6959,2860.5000000,1244.6000000,-10.9000000,0.0000000,90.0000000,0.0000000), --object(vegasnbball1), (15), createObject(11353,2834.4004000,1382.5996000,13.6000000,0.0000000,0.0000000,269.9950000), --object(station5new), (18), createObject(11353,2758.2000000,1250.4000000,13.6000000,0.0000000,0.0000000,0.0000000), --object(station5new), (20), createObject(11353,2860.9004000,1250.5000000,13.6000000,0.0000000,0.0000000,179.9950000), --object(station5new), (23), createObject(6959,2860.5000000,1284.5000000,-10.9000000,0.0000000,90.0000000,0.0000000), --object(vegasnbball1), (28), createObject(6959,2799.4004000,1282.9004000,-9.4000000,0.0000000,0.0000000,90.0000000), --object(vegasnbball1), (33), createObject(6959,2799.8000000,1241.5000000,-9.4000000,0.0000000,0.0000000,90.0000000), --object(vegasnbball1), (34), createObject(6959,2780.1006000,1243.9004000,-12.0000000,0.0000000,90.0000000,0.0000000), --object(vegasnbball1), (43), createObject(6959,2860.5000000,1324.5000000,-10.9000000,0.0000000,90.0000000,0.0000000), --object(vegasnbball1), (3), createObject(6959,2860.5000000,1364.4000000,-10.9000000,0.0000000,90.0000000,0.0000000), --object(vegasnbball1), (4), createObject(6959,2841.0000000,1382.0996000,-10.7000000,90.0000000,0.0000000,0.0000000), --object(vegasnbball1), (7), createObject(6959,2799.7000000,1382.1000000,-11.8000000,90.0000000,0.0000000,0.0000000), --object(vegasnbball1), (16), createObject(6959,2780.2002000,1283.5996000,-12.0000000,0.0000000,90.0000000,0.0000000), --object(vegasnbball1), (32), createObject(6959,2780.2000000,1323.6000000,-12.0000000,0.0000000,90.0000000,0.0000000), --object(vegasnbball1), (38), createObject(6959,2780.2000000,1363.6000000,-12.7000000,0.0000000,90.0000000,0.0000000), --object(vegasnbball1), (41), createObject(7600,2777.7002000,1263.7002000,9.8200000,0.0000000,0.0000000,90.0000000), --object(vegasgolfcrs03), (1), createObject(8661,2826.6006000,1283.7998000,9.9000000,0.0000000,0.0000000,90.0000000), --object(gnhtelgrnd_lvs), (5), createObject(4567,2807.7998000,1322.0996000,9.7000000,0.0000000,0.0000000,90.0000000), --object(road07_lan2), (1), createObject(3452,2823.9004000,1234.8301000,-7.2300000,0.0000000,0.0000000,0.0000000), --object(bballintvgn1), (1), createObject(3453,2795.7002000,1240.5996000,-7.2300000,0.0000000,0.0000000,268.7480000), --object(bballintvgn2), (1), createObject(3452,2790.0300000,1270.0000000,-7.2300000,0.0000000,0.0000000,268.5000000), --object(bballintvgn1), (2), createObject(9946,2814.1001000,1261.2998000,-9.5000000,0.0000000,0.0000000,91.0000000), --object(pyrground_sfe), (1), createObject(3607,2780.0000000,1248.2002000,15.7000000,0.0000000,0.0000000,90.0000000), --object(bevman2_law2), (1), createObject(9946,2821.4004000,1244.7002000,9.8000000,0.0000000,0.0000000,0.0000000), --object(pyrground_sfe), (3), createObject(8854,2797.5000000,1292.8000000,10.1000000,0.0000000,0.0000000,0.0000000), --object(vgeplntr03_lvs), (1), createObject(8854,2797.5000000,1233.9000000,10.1000000,0.0000000,0.0000000,0.0000000), --object(vgeplntr03_lvs), (2), createObject(8856,2797.5000000,1260.9004000,10.1000000,0.0000000,0.0000000,0.0000000), --object(vgeplntr06_lvs), (1), createObject(4206,2774.3000000,1276.3000000,9.8000000,0.0000000,0.0000000,0.0000000), --object(pershingpool_lan), (1), createObject(4206,2770.7000000,1291.5000000,9.9000000,0.0000000,0.0000000,0.0000000), --object(pershingpool_lan), (2), createObject(8661,2851.3999000,1244.3000000,9.9280000,0.0000000,0.0000000,90.0000000), --object(gnhtelgrnd_lvs), (2), createObject(9600,2849.7002000,1335.2002000,-5.3000000,0.0000000,0.0000000,90.0000000), --object(road_sfw14), (1), createObject(3604,2807.0000000,1376.4004000,12.0000000,0.0000000,0.0000000,0.0000000), --object(bevmangar_law2), (1), createObject(8838,2857.9004000,1240.9004000,11.4000000,0.0000000,0.0000000,270.0000000), --object(vgehshade01_lvs), (2), createObject(8661,2826.6006000,1323.7002000,9.9000000,0.0000000,0.0000000,90.0000000), --object(gnhtelgrnd_lvs), (3), createObject(8661,2826.7002000,1363.0996000,9.7000000,0.0000000,0.5000000,90.0000000), --object(gnhtelgrnd_lvs), (4), createObject(8661,2846.5000000,1323.7002000,9.9000000,0.0000000,0.0000000,90.0000000), --object(gnhtelgrnd_lvs), (6), createObject(8661,2846.6001000,1362.2000000,9.7000000,0.0000000,0.5000000,90.0000000), --object(gnhtelgrnd_lvs), (7), createObject(8661,2840.8999000,1264.1000000,-10.3000000,0.0000000,90.0000000,180.0000000), --object(gnhtelgrnd_lvs), (9), createObject(8661,2841.0000000,1289.1000000,-6.0000000,108.0000000,90.0000000,180.0000000), --object(gnhtelgrnd_lvs), (10), createObject(8661,2840.8999000,1316.9000000,-13.6000000,90.0000000,90.0000000,179.9950000), --object(gnhtelgrnd_lvs), (11), createObject(8661,2840.8999000,1353.1000000,-19.9000000,107.0000000,90.0000000,179.9950000), --object(gnhtelgrnd_lvs), (12), createObject(3877,2797.5000000,1251.5996000,11.7000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (1), createObject(3877,2797.5000000,1243.6000000,11.7000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (2), createObject(3877,2797.5000000,1270.6000000,11.7000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (3), createObject(3877,2797.5000000,1283.2998000,11.7000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (4), createObject(3877,2797.5000000,1302.0000000,11.7000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (5), createObject(8661,2783.4004000,1285.0000000,-26.3000000,16.0000000,90.0000000,88.6000000), --object(gnhtelgrnd_lvs), (13), createObject(8661,2838.7241000,1229.0000000,-26.3000000,16.2980000,90.0000000,179.9950000), --object(gnhtelgrnd_lvs), (14), createObject(3524,2757.2000000,1320.5000000,14.1000000,0.0000000,0.0000000,275.0000000), --object(skullpillar01_lvs), (1), createObject(3524,2757.2002000,1305.5000000,14.1000000,0.0000000,0.0000000,274.9990000), --object(skullpillar01_lvs), (2), createObject(14789,2790.8999000,1357.8000000,-5.1890000,0.0000000,0.0000000,90.0000000), --object(ab_sfgymmain1), (1), createObject(14789,2791.2002000,1289.5996000,-5.1000000,0.0000000,0.0000000,90.0000000), --object(ab_sfgymmain1), (2), createObject(17864,2805.7002000,1362.0996000,-9.6000000,358.7480000,0.0000000,90.0000000), --object(comp_puchase), (2), createObject(17864,2805.6001000,1296.5000000,-9.6000000,358.7480000,0.0000000,90.0000000), --object(comp_puchase), (3), createObject(8661,2787.0000000,1329.2002000,-9.7000000,0.0000000,0.0000000,90.0000000), --object(gnhtelgrnd_lvs), (15), createObject(8661,2786.1006000,1369.2002000,-9.7000000,0.0000000,0.0000000,90.0000000), --object(gnhtelgrnd_lvs), (16), createObject(11353,2796.8000000,1356.1000000,22.6000000,0.0000000,0.0000000,0.0000000), --object(station5new), (1), createObject(11353,2758.2000000,1250.4000000,22.6000000,0.0000000,0.0000000,0.0000000), --object(station5new), (6), createObject(1597,2831.1001000,1346.5000000,-7.1000000,0.0000000,0.0000000,0.0000000), --object(cntrlrsac1), (1), createObject(11353,2784.7998000,1223.7002000,22.6000000,0.0000000,0.0000000,90.0000000), --object(station5new), (7), createObject(11353,2860.9004000,1250.5000000,22.6000000,0.0000000,0.0000000,179.9950000), --object(station5new), (14), createObject(3532,2804.7000000,1352.9000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (3), createObject(3532,2804.0000000,1337.6000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (4), createObject(3532,2816.1001000,1338.1000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (5), createObject(3532,2815.6001000,1346.8000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (6), createObject(3532,2811.6001000,1346.0000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (7), createObject(3532,2796.0000000,1350.0000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (9), createObject(11353,2860.9004000,1302.2998000,22.6000000,0.0000000,0.0000000,179.9950000), --object(station5new), (15), createObject(11353,2860.9004000,1355.0996000,22.6000000,0.0000000,0.0000000,179.9950000), --object(station5new), (16), createObject(7952,2818.5000000,1333.1000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(miragehedge09), (1), createObject(3532,2806.6001000,1336.0000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (14), createObject(3532,2808.0000000,1334.1000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (15), createObject(3532,2810.0000000,1334.1000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (16), createObject(3532,2811.3000000,1332.8000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (17), createObject(3532,2812.3999000,1331.5000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (18), createObject(3532,2814.1001000,1332.1000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (19), createObject(3532,2807.0000000,1335.2000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (20), createObject(3532,2805.2000000,1337.1000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (21), createObject(3532,2813.3000000,1340.0000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (22), createObject(3532,2812.1001000,1341.0000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (23), createObject(3532,2797.6001000,1352.0000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (24), createObject(3532,2809.1001000,1343.2000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (28), createObject(3532,2811.3000000,1341.0000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (29), createObject(3532,2814.3999000,1339.3000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (30), createObject(3532,2815.8999000,1331.1000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (31), createObject(8623,2810.7000000,1317.8000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (1), createObject(8623,2810.7000000,1319.5000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (2), createObject(8623,2810.8000000,1322.2000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (3), createObject(8623,2810.8000000,1323.9000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (4), createObject(8623,2810.8999000,1326.6000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (5), createObject(8623,2811.0000000,1328.6000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (6), createObject(8623,2799.8999000,1317.2000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (7), createObject(8623,2799.8999000,1318.9000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (8), createObject(8623,2800.0000000,1321.6000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (9), createObject(8623,2809.7000000,1330.3000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (10), createObject(8623,2795.7000000,1349.1000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (11), createObject(8623,2795.7000000,1347.8000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (12), createObject(8623,2795.6001000,1351.7000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (13), createObject(8623,2795.8999000,1352.5000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (14), createObject(8623,2796.0000000,1353.7000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (15), createObject(8623,2810.7000000,1354.2000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (20), createObject(8623,2811.5000000,1352.7002000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (26), createObject(14467,2824.0000000,1287.8000000,-6.8000000,0.0000000,0.0000000,180.0000000), --object(carter_statue), (1), createObject(1597,2830.8999000,1311.8000000,-7.1000000,0.0000000,0.0000000,0.0000000), --object(cntrlrsac1), (2), createObject(9833,2811.1001000,1342.4000000,-9.4000000,0.0000000,0.0000000,313.0000000), --object(fountain_sfw), (2), createObject(9833,2806.8000000,1325.5000000,-12.7000000,0.0000000,0.0000000,312.9950000), --object(fountain_sfw), (3), createObject(9833,2810.5000000,1331.6000000,-9.7000000,0.0000000,0.0000000,312.9950000), --object(fountain_sfw), (4), createObject(14467,2837.5000000,1288.0000000,-6.7000000,0.0000000,0.0000000,179.9950000), --object(carter_statue), (2), createObject(9833,2808.2000000,1348.6000000,-12.4000000,0.0000000,0.0000000,312.9950000), --object(fountain_sfw), (5), createObject(5052,2831.2002000,1318.2002000,-9.6000000,0.0000000,0.0000000,179.9950000), --object(btoroad1vb_las), (1), createObject(17864,2805.6006000,1336.2002000,-9.6000000,358.7480000,0.0000000,90.0000000), --object(comp_puchase), (4), createObject(14794,2792.2000000,1334.7000000,-7.1000000,0.0000000,0.0000000,90.0000000), --object(ab_vegasgymmain2), (2), createObject(8661,2850.6001000,1367.1000000,-9.5500000,0.0000000,0.0000000,90.0000000), --object(gnhtelgrnd_lvs), (17), createObject(8661,2843.0000000,1266.5000000,-9.6000000,0.0000000,0.0000000,270.5000000), --object(gnhtelgrnd_lvs), (18), createObject(8838,2838.6499000,1227.1000000,11.4000000,0.0000000,0.0000000,179.9950000), --object(vgehshade01_lvs), (3), createObject(3578,2828.5000000,1285.8160000,-9.0000000,0.0000000,0.0000000,0.0000000), --object(dockbarr1_la), (1), createObject(3578,2838.7000000,1285.8000000,-9.0000000,0.0000000,0.0000000,0.0000000), --object(dockbarr1_la), (2), createObject(8623,2810.3000000,1349.9000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (27), createObject(8623,2810.1001000,1348.4000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (28), createObject(8623,2811.2000000,1345.9000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (29), createObject(8623,2810.8000000,1343.4000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(bush03_lvs), (30), createObject(3532,2810.8999000,1352.2000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (32), createObject(3532,2808.8999000,1347.7000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (33), createObject(3532,2805.1001000,1334.1000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (34), createObject(3532,2803.8999000,1334.6000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(triadbush), (35), createObject(6959,2794.8000000,1326.1000000,7.2000000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (19), createObject(3877,2818.2002000,1337.4004000,-7.9000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (6), createObject(6959,2794.7998000,1366.0000000,7.2000000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (21), createObject(3877,2818.2000000,1332.1000000,-7.9000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (7), createObject(3877,2818.3999000,1374.4000000,-7.9000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (8), createObject(6959,2836.0000000,1373.9000000,7.2000000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (22), createObject(3877,2818.7000000,1381.5000000,-7.8000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (9), createObject(6959,2836.1006000,1334.0000000,7.2000000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (23), createObject(6959,2794.7002000,1286.2002000,7.2000000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (26), createObject(6959,2794.7002000,1246.2002000,7.2000000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (29), createObject(6959,2836.0000000,1241.5000000,7.2000000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (30), createObject(8661,2850.8000000,1323.7000000,9.8690000,0.0000000,0.0000000,90.0000000), --object(gnhtelgrnd_lvs), (19), createObject(8661,2850.7998000,1363.0000000,9.7000000,0.0000000,0.5000000,90.0000000), --object(gnhtelgrnd_lvs), (20), createObject(8661,2831.2002000,1283.7998000,9.9000000,0.0000000,0.0000000,90.0000000), --object(gnhtelgrnd_lvs), (21), createObject(3749,2850.6001000,1300.9000000,6.8000000,16.5000000,0.0000000,180.7500000), --object(clubgate01_lax), (1), createObject(2885,2840.8000000,1278.9000000,9.9000000,0.0000000,0.0000000,90.0000000), --object(xref_garagedoor), (1), createObject(2885,2840.8000000,1289.7000000,9.9000000,0.0000000,0.0000000,90.0000000), --object(xref_garagedoor), (2), createObject(3877,2818.3999000,1317.0000000,-7.9000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (10), createObject(3877,2818.5000000,1307.9000000,-7.9000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (11), createObject(2885,2840.7002000,1300.2002000,4.4000000,0.0000000,90.0000000,90.0000000), --object(xref_garagedoor), (4), createObject(2885,2840.7998000,1300.2002000,-6.5000000,0.0000000,90.0000000,90.0000000), --object(xref_garagedoor), (5), createObject(8661,2840.8999000,1244.3000000,-10.3000000,0.0000000,90.0000000,179.9950000), --object(gnhtelgrnd_lvs), (23), createObject(8661,2840.9004000,1224.2998000,-10.3000000,0.0000000,90.0000000,179.9950000), --object(gnhtelgrnd_lvs), (24), createObject(11353,2834.4004000,1382.5996000,22.5000000,0.0000000,0.0000000,269.9950000), --object(station5new), (17), createObject(11353,2796.7998000,1356.0996000,13.7000000,0.0000000,0.0000000,0.0000000), --object(station5new), (19), createObject(14787,2794.8999000,1370.3000000,-9.3000000,0.0000000,0.0000000,90.0000000), --object(ab_sfgymbits02a), (1), createObject(16151,2781.5000000,1371.6000000,-9.1000000,0.0000000,0.0000000,180.0000000), --object(ufo_bar), (1), createObject(2229,2807.2000000,1377.3000000,-9.3000000,0.0000000,0.0000000,0.0000000), --object(swank_speaker), (1), createObject(2229,2795.8000000,1377.2000000,-9.3000000,0.0000000,0.0000000,0.0000000), --object(swank_speaker), (2), createObject(2229,2795.2000000,1365.6000000,-9.3000000,0.0000000,0.0000000,180.0000000), --object(swank_speaker), (3), createObject(2229,2806.6001000,1365.6000000,-9.3000000,0.0000000,0.0000000,179.9950000), --object(swank_speaker), (4), createObject(18102,2806.1001000,1372.9000000,-3.6000000,0.0000000,0.0000000,0.0000000), --object(light_box1), (1), createObject(18102,2805.8000000,1367.5000000,-3.4000000,0.0000000,0.0000000,0.0000000), --object(light_box1), (2), createObject(1709,2813.8000000,1363.0000000,-9.5000000,0.0000000,0.0000000,231.0000000), --object(kb_couch08), (1), createObject(1823,2811.6001000,1361.2000000,-9.4000000,0.0000000,0.0000000,50.0000000), --object(coffee_med_5), (1), createObject(1491,2815.2998000,1376.7002000,-9.4000000,0.0000000,0.0000000,90.0000000), --object(gen_doorint01), (1), createObject(3578,2831.2002000,1289.5996000,-8.9200000,0.0000000,0.0000000,0.0000000), --object(dockbarr1_la), (4), createObject(1710,2793.2000000,1301.2000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (1), createObject(1710,2796.2000000,1301.1000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (2), createObject(1710,2798.5000000,1301.1000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (3), createObject(1710,2801.5000000,1301.1000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (4), createObject(1710,2804.3000000,1301.0000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (5), createObject(1710,2793.2000000,1309.0000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (6), createObject(1710,2796.1001000,1309.0000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (7), createObject(1710,2798.3999000,1309.0000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (8), createObject(1710,2801.3999000,1309.0000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (9), createObject(1710,2804.3000000,1309.0000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (10), createObject(1710,2806.7000000,1301.0000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (11), createObject(1710,2806.8999000,1309.1000000,-9.3000000,0.0000000,0.0000000,270.0000000), --object(kb_couch07), (12), createObject(14486,2791.1001000,1335.6000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(madgym1), (1), createObject(14791,2792.2000000,1335.5000000,-7.5000000,0.0000000,0.0000000,0.0000000), --object(a_vgsgymboxa), (1), createObject(2629,2795.5000000,1343.2000000,-9.5000000,0.0000000,0.0000000,0.0000000), --object(gym_bench1), (1), createObject(2628,2791.7000000,1343.2000000,-9.5000000,0.0000000,0.0000000,0.0000000), --object(gym_bench2), (1), createObject(2627,2787.8000000,1343.0000000,-9.5000000,0.0000000,0.0000000,0.0000000), --object(gym_treadmill), (1), createObject(2630,2783.5000000,1332.8000000,-9.5000000,0.0000000,0.0000000,270.0000000), --object(gym_bike), (1), createObject(2630,2783.5000000,1334.5000000,-9.5000000,0.0000000,0.0000000,270.0000000), --object(gym_bike), (2), createObject(2630,2783.5000000,1336.4000000,-9.5000000,0.0000000,0.0000000,270.0000000), --object(gym_bike), (3), createObject(16151,2798.1001000,1290.7000000,-9.0000000,0.0000000,0.0000000,270.0000000), --object(ufo_bar), (2), createObject(16782,2781.1001000,1303.0000000,-5.4000000,0.0000000,0.0000000,0.0000000), --object(a51_radar_scan), (1), createObject(16662,2778.1001000,1295.3000000,-8.4000000,0.0000000,0.0000000,63.0000000), --object(a51_radar_stuff), (1), createObject(6959,2877.3000000,1374.0000000,7.2000000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (36), createObject(6959,2877.3000000,1334.0000000,7.2000000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (37), createObject(11353,2823.6999500,1382.6999500,13.6000000,0.0000000,0.0000000,269.9950000), --object(station5new), (21), createObject(11353,2823.6001000,1382.6999500,22.5000000,0.0000000,0.0000000,269.9950000), --object(station5new), (22), createObject(11353,2758.2998000,1276.7002000,22.6000000,0.0000000,0.0000000,0.0000000), --object(station5new), (25), createObject(8661,2777.1006000,1322.9004000,9.9000000,90.0000000,90.0000000,90.0000000), --object(gnhtelgrnd_lvs), (26), createObject(8661,2778.5000000,1303.4004000,9.9000000,90.0000000,90.0000000,90.0000000), --object(gnhtelgrnd_lvs), (27), createObject(11353,2796.7998000,1349.5996000,22.6000000,0.0000000,0.0000000,0.0000000), --object(station5new), (26), createObject(11353,2796.7998000,1349.5996000,13.8000000,0.0000000,0.0000000,0.0000000), --object(station5new), (27), createObject(8171,2840.2900000,1312.9004000,25.8900000,0.0000000,0.0000000,179.9950000), --object(vgssairportland06), (1), createObject(8251,2840.2000000,1368.7002000,29.8178000,0.0000000,0.0000000,270.0000000), --object(pltschlhnger02_lvs), (1), createObject(3494,2821.4004000,1381.5000000,13.8500000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (1), createObject(3494,2822.3999000,1363.6000000,13.8500000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (2), createObject(3494,2821.4004000,1349.2998000,13.8500000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (3), createObject(3494,2821.4004000,1328.5996000,13.8500000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (4), createObject(3494,2821.4004000,1311.2998000,13.8500000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (5), createObject(3494,2821.4004000,1287.7002000,13.8500000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (6), createObject(3494,2821.4004000,1264.7002000,13.8500000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (7), createObject(982,2820.3408000,1369.2067000,26.5736000,0.0000000,0.0000000,0.0000000), --object(fenceshit), (5), createObject(8661,2817.1001000,1372.5000000,8.9000000,0.0000000,0.5000000,0.2500000), --object(gnhtelgrnd_lvs), (28), createObject(2047,2796.1001000,1344.9000000,-6.7000000,0.0000000,0.0000000,0.0000000), --object(cj_flag1), (1), createObject(3471,2800.0000000,1304.9000000,11.2000000,0.0000000,0.0000000,0.0000000), --object(vgschinalion1), (1), createObject(3471,2799.6001000,1321.3000000,11.2000000,0.0000000,0.0000000,0.0000000), --object(vgschinalion1), (2), createObject(354,2757.2000000,1307.5000000,20.8000000,0.0000000,0.0000000,0.0000000), --object(1), createObject(354,2757.3999000,1319.0000000,21.0000000,0.0000000,0.0000000,0.0000000), --object(2), createObject(360,2702.3000000,1311.1000000,-7.4000000,0.0000000,0.0000000,0.0000000), --object(4), createObject(12978,2829.9004000,1273.5000000,10.2700000,0.0000000,0.0000000,1.2470000), --object(sw_shed02), (1), createObject(3293,2830.0000000,1272.9000000,13.1000000,0.0000000,0.0000000,181.0000000), --object(des_payspint), (1), createObject(3383,2813.2000000,1290.5000000,-9.3000000,0.0000000,0.0000000,0.0000000), --object(a51_labtable1_), (2), createObject(3383,2809.0000000,1290.7998000,-9.3000000,0.0000000,0.0000000,0.0000000), --object(a51_labtable1_), (3), createObject(3383,2804.8999000,1290.1000000,-9.3000000,0.0000000,0.0000000,0.0000000), --object(a51_labtable1_), (4), createObject(356,2812.6001000,1291.0000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(11), createObject(12928,2837.3000000,1363.9000000,9.7300000,0.0000000,0.0000000,0.0000000), --object(sw_shedinterior04), (1), createObject(12929,2837.2998000,1363.9004000,9.7000000,0.0000000,0.0000000,0.0000000), --object(sw_shed06), (1), createObject(359,2809.1001000,1291.5000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(12), createObject(360,2809.0000000,1290.8000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(13), createObject(361,2804.3000000,1290.1000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(14), createObject(362,2812.3999000,1290.4000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(15), createObject(12928,2842.7000000,1351.9000000,9.8000000,0.0000000,0.0000000,270.0000000), --object(sw_shedinterior04), (2), createObject(363,2806.0000000,1289.7000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(16), createObject(364,2806.3000000,1290.2000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(17), createObject(355,2813.8999000,1290.4000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(18), createObject(353,2803.2000000,1290.6000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(19), createObject(352,2806.1001000,1290.7000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(20), createObject(351,2804.8000000,1290.9000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(21), createObject(350,2803.7000000,1290.9000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(22), createObject(349,2807.6001000,1291.4000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(23), createObject(348,2810.1001000,1291.1000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(24), createObject(12929,2842.6396000,1351.9004000,9.7800000,0.0000000,0.0000000,270.2420000), --object(sw_shed06), (2), createObject(342,2805.8000000,1290.9000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(25), createObject(343,2805.5000000,1290.9000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(26), createObject(344,2806.5000000,1290.5000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(27), createObject(346,2811.6001000,1290.8000000,-8.0000000,0.0000000,0.0000000,0.0000000), --object(28), createObject(339,2804.8999000,1291.0000000,-9.1000000,0.0000000,0.0000000,0.0000000), --object(29), createObject(3604,2807.1006000,1229.9004000,12.4800000,0.0000000,0.0000000,179.9950000), --object(bevmangar_law2), (2), createObject(16151,2845.3999000,1354.9000000,10.1000000,0.0000000,0.0000000,358.7500000), --object(ufo_bar), (3), createObject(1709,2839.0000000,1366.2002000,9.7000000,0.0000000,0.0000000,351.2490000), --object(kb_couch08), (2), createObject(2297,2840.1001000,1360.1000000,9.7000000,0.0000000,0.0000000,114.0000000), --object(tv_unit_2), (1), createObject(3044,2841.1001000,1365.9000000,10.2850000,0.0000000,0.0000000,0.0000000), --object(cigar), (1), createObject(2314,2840.9004000,1365.5000000,9.7000000,0.0000000,0.0000000,341.7460000), --object(cj_tv_table3), (1), createObject(1486,2842.0000000,1364.9004000,10.3300000,0.0000000,0.0000000,0.0000000), --object(dyn_beer_1), (1), createObject(1486,2841.7998000,1365.5996000,10.3300000,0.0000000,0.0000000,0.0000000), --object(dyn_beer_1), (2), createObject(1486,2840.7998000,1365.7998000,10.3300000,0.0000000,0.0000000,0.0000000), --object(dyn_beer_1), (3), createObject(1486,2841.1006000,1365.4004000,10.3300000,0.0000000,0.0000000,0.0000000), --object(dyn_beer_1), (4), createObject(3044,2842.3000000,1365.3000000,10.1000000,290.1040000,322.7800000,246.4990000), --object(cigar), (2), createObject(1578,2840.7998000,1365.4004000,10.1800000,0.0000000,0.0000000,0.0000000), --object(drug_green), (1), createObject(1578,2842.3999000,1364.8000000,10.1800000,0.0000000,0.0000000,0.0000000), --object(drug_green), (2), createObject(1578,2841.6006000,1365.4004000,10.1800000,0.0000000,0.0000000,0.0000000), --object(drug_green), (3), createObject(1578,2839.7002000,1367.0000000,10.1800000,0.0000000,0.0000000,0.0000000), --object(drug_green), (4), createObject(1578,2837.7002000,1367.0996000,9.7150000,0.0000000,0.0000000,0.0000000), --object(drug_green), (5), createObject(1550,2846.3999000,1358.4000000,11.1000000,0.0000000,0.0000000,0.0000000), --object(cj_money_bag), (1), createObject(1550,2846.3999000,1358.1000000,11.1000000,0.0000000,0.0000000,0.0000000), --object(cj_money_bag), (2), createObject(1550,2846.1001000,1358.2000000,11.1000000,0.0000000,0.0000000,0.0000000), --object(cj_money_bag), (3), createObject(1550,2845.4004000,1359.2998000,10.1500000,0.0000000,0.0000000,0.0000000), --object(cj_money_bag), (4), createObject(1544,2844.5000000,1357.6000000,10.7000000,0.0000000,0.0000000,0.0000000), --object(cj_beer_b_1), (1), createObject(1544,2844.1001000,1355.2000000,10.7000000,0.0000000,0.0000000,0.0000000), --object(cj_beer_b_1), (2), createObject(1544,2844.2000000,1354.5000000,10.7000000,0.0000000,0.0000000,0.0000000), --object(cj_beer_b_1), (3), createObject(1544,2844.3999000,1356.6000000,10.7000000,0.0000000,0.0000000,0.0000000), --object(cj_beer_b_1), (4), createObject(1544,2844.8000000,1358.2000000,10.7000000,0.0000000,0.0000000,0.0000000), --object(cj_beer_b_1), (5), createObject(1544,2844.7998000,1358.2002000,10.7000000,0.0000000,0.0000000,0.0000000), --object(cj_beer_b_1), (6), createObject(1580,2844.6001000,1357.9000000,10.7000000,0.0000000,0.0000000,0.0000000), --object(drug_red), (1), createObject(8838,2857.7000000,1326.4000000,11.4000000,0.0000000,0.0000000,270.0000000), --object(vgehshade01_lvs), (4), createObject(3524,2814.2002000,1321.0996000,12.7500000,0.0000000,0.0000000,274.9990000), --object(skullpillar01_lvs), (3), createObject(3524,2814.2002000,1338.7002000,12.7500000,0.0000000,0.0000000,274.9990000), --object(skullpillar01_lvs), (4), createObject(3524,2814.2002000,1361.9004000,12.7500000,0.0000000,0.0000000,274.9990000), --object(skullpillar01_lvs), (5), createObject(3524,2814.2002000,1297.2002000,12.7500000,0.0000000,0.0000000,274.9990000), --object(skullpillar01_lvs), (6), createObject(3524,2814.2002000,1274.2002000,12.7500000,0.0000000,0.0000000,274.9990000), --object(skullpillar01_lvs), (7), createObject(1715,2786.9866000,1303.5332000,-9.3344000,0.0000000,0.0000000,90.0000000), --object(kb_swivelchair2), (2), createObject(18070,2787.1001000,1303.3000000,-8.8000000,0.0000000,0.0000000,90.0000000), --object(gap_counter), (1), createObject(3437,2795.2002000,1348.0996000,15.8000000,0.0000000,0.0000000,90.0000000), --object(ballypllr01_lvs), (1), createObject(3437,2794.7002000,1348.2002000,22.5000000,0.0000000,90.0000000,90.0000000), --object(ballypllr01_lvs), (2), createObject(3437,2757.1006000,1262.2002000,15.6000000,0.0000000,0.0000000,90.0000000), --object(ballypllr01_lvs), (3), createObject(3437,2756.6006000,1262.5000000,21.1000000,0.0000000,90.0000000,90.0000000), --object(ballypllr01_lvs), (4), createObject(3092,2803.0000000,1357.1000000,-8.5000000,0.0000000,0.0000000,0.0000000), --object(dead_tied_cop), (1), createObject(3092,2805.2000000,1357.2000000,-8.5000000,0.0000000,0.0000000,0.0000000), --object(dead_tied_cop), (2), createObject(3092,2806.8999000,1357.2000000,-8.5000000,0.0000000,0.0000000,0.0000000), --object(dead_tied_cop), (3), createObject(3092,2788.8999000,1356.6000000,-8.5000000,0.0000000,0.0000000,0.0000000), --object(dead_tied_cop), (4), createObject(3092,2790.6001000,1356.7000000,-8.5000000,0.0000000,0.0000000,0.0000000), --object(dead_tied_cop), (5), createObject(3092,2792.8000000,1356.9000000,-8.5000000,0.0000000,0.0000000,0.0000000), --object(dead_tied_cop), (6), createObject(3525,2807.3000000,1357.9000000,-7.4000000,0.0000000,0.0000000,180.0000000), --object(exbrtorch01), (3), createObject(3525,2802.3000000,1357.7000000,-7.4000000,0.0000000,0.0000000,179.9950000), --object(exbrtorch01), (4), createObject(3525,2793.3999000,1357.8000000,-7.7000000,0.0000000,0.0000000,179.9950000), --object(exbrtorch01), (5), createObject(3525,2788.3000000,1357.9000000,-7.6000000,0.0000000,0.0000000,179.9950000), --object(exbrtorch01), (6), createObject(1568,2768.3000000,1318.8000000,10.5000000,0.0000000,0.0000000,0.0000000), --object(chinalamp_sf), (1), createObject(1568,2768.2000000,1307.8000000,10.5000000,0.0000000,0.0000000,0.0000000), --object(chinalamp_sf), (2), createObject(1568,2778.0000000,1318.8000000,9.9000000,0.0000000,0.0000000,0.0000000), --object(chinalamp_sf), (3), createObject(1568,2777.0000000,1307.9000000,9.9000000,0.0000000,0.0000000,0.0000000), --object(chinalamp_sf), (4), createObject(1568,2791.6006000,1318.7998000,9.9000000,0.0000000,0.0000000,0.0000000), --object(chinalamp_sf), (5), createObject(1568,2790.7000000,1308.1000000,9.9000000,0.0000000,0.0000000,0.0000000), --object(chinalamp_sf), (6), createObject(1215,2829.2000000,1361.5000000,10.3000000,0.0000000,0.0000000,0.0000000), --object(bollardlight), (1), createObject(1215,2829.2002000,1366.2998000,10.2000000,0.0000000,0.0000000,0.0000000), --object(bollardlight), (2), createObject(3877,2844.3999000,1355.7000000,-7.9000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (12), createObject(3877,2856.8000000,1355.4000000,-7.9000000,0.0000000,0.0000000,0.0000000), --object(sf_rooflite), (13), createObject(1226,2826.6001000,1359.3000000,-5.8000000,0.0000000,0.0000000,180.0000000), --object(lamppost3), (1), createObject(1226,2826.7000000,1341.1000000,-5.8000000,0.0000000,0.0000000,179.9950000), --object(lamppost3), (2), createObject(1226,2826.3000000,1323.8000000,-5.8000000,0.0000000,0.0000000,179.9950000), --object(lamppost3), (3), createObject(1226,2826.3999000,1299.8000000,-5.8000000,0.0000000,0.0000000,179.9950000), --object(lamppost3), (4), createObject(1226,2835.8000000,1358.4000000,-5.8000000,0.0000000,0.0000000,0.0000000), --object(lamppost3), (5), createObject(1226,2835.7000000,1340.6000000,-5.8000000,0.0000000,0.0000000,0.0000000), --object(lamppost3), (6), createObject(1226,2835.6001000,1323.6000000,-5.8000000,0.0000000,0.0000000,0.0000000), --object(lamppost3), (7), createObject(1226,2835.3000000,1299.6000000,-5.8000000,0.0000000,0.0000000,0.0000000), --object(lamppost3), (8), createObject(2773,2823.8000000,1289.6000000,-9.0000000,0.0000000,0.0000000,0.0000000), --object(cj_airprt_bar), (1), createObject(2773,2823.8000000,1291.5000000,-9.0000000,0.0000000,0.0000000,0.0000000), --object(cj_airprt_bar), (2), createObject(3666,2797.5000000,1257.5000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(airuntest_las), (1), createObject(3666,2797.5000000,1262.9000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(airuntest_las), (2), createObject(3666,2836.5000000,1242.9004000,-8.9100000,0.0000000,0.0000000,0.0000000), --object(airuntest_las), (3), createObject(3666,2831.3000000,1242.8000000,-8.9000000,0.0000000,0.0000000,0.0000000), --object(airuntest_las), (4), createObject(14467,2849.3999000,1380.6000000,-6.9000000,0.0000000,0.0000000,0.0000000), --object(carter_statue), (3), createObject(3789,2846.0000000,1380.3000000,-9.2000000,0.0000000,0.0000000,0.0000000), --object(missile_09_sfxr), (1), createObject(3790,2845.8000000,1380.2000000,-8.8000000,0.0000000,0.0000000,0.0000000), --object(missile_01_sfxr), (1), createObject(3795,2852.2000000,1380.6000000,-9.2000000,0.0000000,0.0000000,0.0000000), --object(missile_04_sfxr), (1), createObject(3794,2856.3000000,1380.4000000,-9.0000000,0.0000000,0.0000000,0.0000000), --object(missile_07_sfxr), (1), createObject(3936,2850.3418000,1382.0781300,-11.0606000,0.0000000,0.0000000,0.0000000), --object(bwire_fence), (1), createObject(2773,2843.2000000,1380.8000000,-9.1000000,0.0000000,0.0000000,0.0000000), --object(cj_airprt_bar), (3), createObject(2773,2843.2000000,1378.9000000,-9.1000000,0.0000000,0.0000000,0.0000000), --object(cj_airprt_bar), (4), createObject(2773,2843.3000000,1377.0000000,-9.1000000,0.0000000,0.0000000,0.0000000), --object(cj_airprt_bar), (5), createObject(2773,2844.3999000,1376.1000000,-9.1000000,0.0000000,0.0000000,90.0000000), --object(cj_airprt_bar), (6), createObject(2773,2846.3000000,1376.1000000,-9.1000000,0.0000000,0.0000000,90.0000000), --object(cj_airprt_bar), (7), createObject(2773,2848.2002000,1376.2002000,-9.1000000,0.0000000,0.0000000,90.0000000), --object(cj_airprt_bar), (8), createObject(2773,2850.1001000,1376.2000000,-9.1000000,0.0000000,0.0000000,90.0000000), --object(cj_airprt_bar), (9), createObject(2773,2852.0000000,1376.2000000,-9.1000000,0.0000000,0.0000000,90.0000000), --object(cj_airprt_bar), (10), createObject(2773,2853.8999000,1376.2000000,-9.1000000,0.0000000,0.0000000,90.0000000), --object(cj_airprt_bar), (11), createObject(2773,2855.8000000,1376.3000000,-9.1000000,0.0000000,0.0000000,90.0000000), --object(cj_airprt_bar), (12), createObject(2773,2857.7002000,1376.2998000,-9.1000000,0.0000000,0.0000000,90.0000000), --object(cj_airprt_bar), (13), createObject(3666,2843.3999000,1375.6000000,-9.1000000,0.0000000,0.0000000,0.0000000), --object(airuntest_las), (5), createObject(3666,2849.2000000,1375.6000000,-9.1000000,0.0000000,0.0000000,0.0000000), --object(airuntest_las), (6), createObject(3666,2854.8000000,1375.9000000,-9.1000000,0.0000000,0.0000000,0.0000000), --object(airuntest_las), (7), createObject(3437,2833.2000000,1382.1000000,-3.8000000,0.0000000,0.0000000,0.0000000), --object(ballypllr01_lvs), (5), createObject(3437,2833.3000000,1381.6000000,3.3000000,0.0000000,90.0000000,0.0000000), --object(ballypllr01_lvs), (6), createObject(3437,2840.8999000,1259.7000000,-3.6000000,0.0000000,0.0000000,90.0000000), --object(ballypllr01_lvs), (7), createObject(3437,2840.3999000,1260.0000000,1.8000000,0.0000000,90.0000000,90.0000000), --object(ballypllr01_lvs), (8), createObject(2773,2859.6001000,1376.3000000,-9.1000000,0.0000000,0.0000000,90.0000000), --object(cj_airprt_bar), (14), createObject(8661,2816.2000000,1373.3000000,9.4750000,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (1), createObject(8661,2818.2000000,1234.3000000,9.9000000,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (8), createObject(8661,2821.3999000,1234.2000000,9.9200000,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (22), createObject(3494,2821.4004000,1264.7000000,21.8800000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (8), createObject(3494,2821.4004000,1287.7000000,21.8800000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (9), createObject(3494,2821.4004000,1311.2998000,21.8800000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (10), createObject(3494,2821.4004000,1328.5996000,21.8800000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (11), createObject(3494,2821.4004000,1349.3000000,21.8800000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (12), createObject(3494,2822.3999000,1363.6000000,21.8800000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (13), createObject(3494,2821.4004000,1381.4000000,21.8800000,0.0000000,0.0000000,0.0000000), --object(luxorpillar04_lvs), (14), createObject(6959,2843.9165000,1322.9764000,7.1800000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (1), createObject(6959,2820.3000000,1280.0000000,7.1900000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (2), createObject(6959,2819.9231000,1298.4711000,7.1881000,0.0000000,0.0000000,0.0000000), --object(vegasnbball1), (5), createObject(982,2820.3408000,1343.6400000,26.5736000,0.0000000,0.0000000,0.0000000), --object(fenceshit), (8), createObject(982,2820.3438000,1318.0143000,26.5736000,0.0000000,0.0000000,0.0000000), --object(fenceshit), (9), createObject(982,2820.3550000,1292.4242000,26.5736000,0.0000000,0.0000000,0.0000000), --object(fenceshit), (10), createObject(982,2820.3425000,1266.8329000,26.5736000,0.0000000,0.0000000,0.0000000), --object(fenceshit), (11), createObject(982,2820.3142000,1257.2371000,26.5736000,0.0000000,0.0000000,0.0000000), --object(fenceshit), (12), createObject(1491,2803.1001000,1341.4310000,-9.5083000,0.0000000,0.0000000,90.0000000), --object(gen_doorint01), (2), createObject(1491,2815.5835000,1308.5135000,-9.3344000,0.0000000,0.0000000,90.0000000), --object(gen_doorint01), (3), createObject(11353,2834.1006000,1223.7998000,22.6000000,0.0000000,0.0000000,90.0000000), --object(station5new), (2), createObject(2957,2838.8000000,1346.6000000,11.4000000,0.0000000,0.0000000,90.0000000), --object(chinatgaragedoor), (3), createObject(9241,2780.6001000,1282.4000000,11.0000000,0.0000000,0.0000000,90.0000000), --object(copbits_sfn), (1), } for index,v in ipairs (tt) do setElementDoubleSided(v, true) setObjectBreakable(v, false) end
-- Requires highlighter currently. if hex_write_config == nil then hex_write_config = {} end if hex_write_config["selected_attribute"] == nil then hex_write_config["selected_attribute"] = DrawingAttributes.Standout end if hex_write_config["selected_editing_attribute"] == nil then hex_write_config["selected_editing_attribute"] = DrawingAttributes.Underlined end -- Cache the bytes that byteToStringPadded uses -- I was unsure if I should do this optimization in lua or in the byteToStringPadded. local bytes = {} for index=0, 255 do bytes[index] = byteToStringPadded(index) end function hw_byte_to_string (byte) return bytes[byte] end local prev_state = getHexViewState() local requires_rehighlight = false listenForUndo(function (pos) requires_rehighlight = true end) listenForRedo(function (pos) requires_rehighlight = true end) function base_on_write (data, size, position) local byte_entries_col = getHexByteWidth() local byte_entries_row = getHexViewHeight() local selected_pos = getSelectedPosition() local hex_view_state = getHexViewState() local hex_view_x = getHexViewX() local hex_view_y = getHexViewY() -- Unsure if this is that great of an ''optimization'' local func_on_write if hex_view_state == HexViewState.Editing then func_on_write = on_write_selected_state_editing else func_on_write = on_write_selected end highlight_update(position, size, requires_rehighlight or (prev_state == HexViewState.Editing and hex_view_state ~= HexViewState.Editing) ) requires_rehighlight = false prev_state = hex_view_state fh_highlight_get_load_screen() -- This assumes that data is sequential, not sure we can rely on that for j, v in ipairs(data) do local i = j - 1 -- one-indexed if i % byte_entries_col == 0 and i ~= 0 then moveView(hex_view_x, hex_view_y + (i // byte_entries_col)) end local v_highlight_attr = highlight_get(position + i) toggle_highlight_attributes(v_highlight_attr, true) local byte_text = hw_byte_to_string(v) if selected_pos == (position + i) then func_on_write(byte_text) else printView(byte_text .. " ") end toggle_highlight_attributes(v_highlight_attr, false) end end function on_write_selected_state_editing (byte_text) if getEditingPosition() == false then enableAttribute(hex_write_config["selected_editing_attribute"]) printView(string.sub(byte_text, 1, 1)) disableAttribute(hex_write_config["selected_editing_attribute"]) printView(string.sub(byte_text, 2, 2) .. " ") else printView(string.sub(byte_text, 1, 1)) enableAttribute(hex_write_config["selected_editing_attribute"]) printView(string.sub(byte_text, 2, 2)) disableAttribute(hex_write_config["selected_editing_attribute"]) printView(" ") end end function on_write_selected (byte_text) enableAttribute(hex_write_config["selected_attribute"]) printView(byte_text) disableAttribute(hex_write_config["selected_attribute"]) printView(" ") end listenForWrite(base_on_write)
local function AdminLog(message, colour) local RF = RecipientFilter() for k,v in pairs(player.GetAll()) do local canHear = hook.Call("canSeeLogMessage", GAMEMODE, v, message, colour) if canHear then RF:AddPlayer(v) end end umsg.Start("DRPLogMsg", RF) umsg.Short(colour.r) umsg.Short(colour.g) umsg.Short(colour.b) -- Alpha is not needed umsg.String(message) umsg.End() end local DarkRPFile function DarkRP.log(text, colour) if colour then AdminLog(text, colour) end if not GAMEMODE.Config.logging or not text then return end if not DarkRPFile then -- The log file of this session, if it's not there then make it! if not file.IsDir("darkrp_logs", "DATA") then file.CreateDir("darkrp_logs") end DarkRPFile = "darkrp_logs/"..os.date("%m_%d_%Y %I_%M %p")..".txt" file.Write(DarkRPFile, os.date().. "\t".. text) return end file.Append(DarkRPFile, "\n"..os.date().. "\t"..(text or "")) end
AddCSLuaFile() g_PrimarySlotWeapons = {} g_SecondarySlotWeapons = {} g_MeleeSlotWeapons = {} g_GunTypeWeapons = {} g_MeleeTypeWeapons = {} WEAPON_SLOT_PRIMARY = 1 WEAPON_SLOT_SECONDARY = 2 WEAPON_SLOT_MELEE = 3 WEAPON_TYPE_GUN = 1 WEAPON_TYPE_MELEE = 2 g_DefaultWeapons = { [WEAPON_SLOT_PRIMARY] = "weapon_ak47", [WEAPON_SLOT_SECONDARY] = "weapon_pistol", [WEAPON_SLOT_MELEE] = "weapon_crowbar" } local SlotToTable = { [WEAPON_SLOT_PRIMARY] = "g_PrimarySlotWeapons", [WEAPON_SLOT_SECONDARY] = "g_SecondarySlotWeapons", [WEAPON_SLOT_MELEE] = "g_MeleeSlotWeapons" } local TypeToTable = { [WEAPON_TYPE_GUN] = "g_GunTypeWeapons", [WEAPON_TYPE_MELEE] = "g_MeleeTypeWeapons" } local TypeToBase = { [WEAPON_TYPE_GUN] = "weapon_basegun", [WEAPON_TYPE_MELEE] = "weapon_basemelee" } local function GenerateWeaponTable(type) return weapons.Get(TypeToBase[type]) end if CLIENT then surface.CreateFont("CSTypeDeath", { font = "csd", size = ScreenScale(20), antialias = true, weight = 300 }) end local killicon_color = Color(255, 80, 0, 255) function AddNewWeapon(slot, typ, tab, cls, icon) local new = GenerateWeaponTable(typ) _G[SlotToTable[slot]][cls] = true _G[TypeToTable[typ]][cls] = true game.AddAmmoType({name = "ammotype_" .. cls}) if CLIENT then language.Add("ammotype_" .. cls .. "_ammo", "Bullets") end for k, v in pairs(tab) do new[k] = v end new.Primary.ClipSize = -1 new.Primary.Ammo = "ammotype_" .. cls new.Primary.Automatic = true if typ == WEAPON_TYPE_MELEE then new.Primary.DefaultClip = -1 end new.Secondary.Automatic = true if not g_DefaultWeapons[typ] then g_DefaultWeapons[typ] = cls end weapons.Register(new, cls) if CLIENT and type(icon) == "table" then killicon.AddFont(cls, icon.font, icon.letter, killicon_color) end end local Wep = {Primary = {}} Wep.PrintName = "AK-47" Wep.HoldType = "ar2" Wep.ViewModel = Model("models/weapons/cstrike/c_rif_ak47.mdl") Wep.WorldModel = Model("models/weapons/w_rif_ak47.mdl") Wep.Slot = 0 Wep.Primary.DefaultClip = 30 Wep.Primary.Sound = Sound("Weapon_AK47.Single") Wep.Primary.Damage = 120 Wep.Primary.Delay = 0.1 Wep.Primary.Recoil = 1 Wep.Primary.Cone = 0.02 Wep.Primary.NumShots = 1 AddNewWeapon(WEAPON_SLOT_PRIMARY, WEAPON_TYPE_GUN, Wep, "weapon_ak47", {font = "CSTypeDeath", letter = "b"}) Wep = {Primary = {}} Wep.PrintName = "Shotgun" Wep.HoldType = "shotgun" Wep.ViewModel = Model("models/weapons/c_shotgun.mdl") Wep.WorldModel = Model("models/weapons/w_shotgun.mdl") Wep.Slot = 0 Wep.CrosshairType = "circle" Wep.CrosshairRadius = 12 Wep.Primary.DefaultClip = 6 Wep.Primary.Sound = Sound("Weapon_XM1014.Single") Wep.Primary.Damage = 60 Wep.Primary.Delay = 0.6 Wep.Primary.Recoil = 4 Wep.Primary.Cone = 0.1 Wep.Primary.NumShots = 6 AddNewWeapon(WEAPON_SLOT_PRIMARY, WEAPON_TYPE_GUN, Wep, "weapon_shotgun", {font = "HL2MPTypeDeath", letter = "0"}) Wep = {Primary = {}} Wep.PrintName = "Uzi" Wep.HoldType = "pistol" Wep.ViewModel = Model("models/weapons/cstrike/c_smg_mac10.mdl") Wep.WorldModel = Model("models/weapons/w_smg_mac10.mdl") Wep.Slot = 0 Wep.CrosshairType = "circle" Wep.CrosshairRadius = 8 Wep.Primary.DefaultClip = 30 Wep.Primary.Sound = Sound("Weapon_MAC10.Single") Wep.Primary.Damage = 60 Wep.Primary.Delay = 0.05 Wep.Primary.Recoil = 0.3 Wep.Primary.Cone = 0.05 Wep.Primary.NumShots = 1 AddNewWeapon(WEAPON_SLOT_PRIMARY, WEAPON_TYPE_GUN, Wep, "weapon_uzi", {font = "CSTypeDeath", letter = "l"}) Wep = {Primary = {}} Wep.PrintName = "Pistol" Wep.HoldType = "pistol" Wep.ViewModel = Model("models/weapons/cstrike/c_pist_usp.mdl") Wep.WorldModel = Model("models/weapons/w_pist_usp_silencer.mdl") Wep.Slot = 1 Wep.Primary.DefaultClip = 13 Wep.Primary.Sound = Sound("Weapon_USP.SilencedShot") Wep.Primary.Damage = 60 Wep.Primary.Delay = 0.3 Wep.Primary.Recoil = 1 Wep.Primary.Cone = 0.01 Wep.Primary.NumShots = 1 AddNewWeapon(WEAPON_SLOT_SECONDARY, WEAPON_TYPE_GUN, Wep, "weapon_pistol", {font = "CSTypeDeath", letter = "a"}) Wep = {Primary = {}} Wep.PrintName = "Magnum" Wep.HoldType = "revolver" Wep.ViewModel = Model("models/weapons/c_357.mdl") Wep.WorldModel = Model("models/weapons/w_357.mdl") Wep.Slot = 1 Wep.Primary.DefaultClip = 6 Wep.Primary.Sound = Sound("Weapon_357.Single") Wep.Primary.Damage = 120 Wep.Primary.Delay = 0.5 Wep.Primary.Recoil = 1 Wep.Primary.Cone = 0.01 Wep.Primary.NumShots = 1 AddNewWeapon(WEAPON_SLOT_SECONDARY, WEAPON_TYPE_GUN, Wep, "weapon_magnum", {font = "HL2MPTypeDeath", letter = "."}) Wep = {Primary = {}} Wep.PrintName = "Fists" Wep.HoldType = "fist" Wep.ViewModel = Model("models/weapons/c_hands.mdl") Wep.WorldModel = "" Wep.Slot = 2 Wep.CanDrop = false Wep.Primary.Sound = Sound("Weapon_Knife.Slash") Wep.Primary.SoundMiss = Sound("Weapon_Crowbar.Single") Wep.Primary.Range = 64 Wep.Primary.Damage = 40 Wep.Primary.Delay = 0.4 function Wep:SecondaryAttack() if not self:CanPrimaryAttack() then return end self:SetNextSecondaryFire(CurTime() + 0.6) self.Owner:SetLuaAnimation("kick_right") if not IsValid(self.Owner) then return end if self.Owner.LagCompensation then -- for some reason not always true self.Owner:LagCompensation(true) end local spos = self.Owner:GetShootPos() local sdest = spos + (self.Owner:GetAimVector() * 128) local tr_main = util.TraceLine({start = spos, endpos = sdest, filter = self.Owner, mask = MASK_SHOT_HULL}) local hitEnt = tr_main.Entity if IsValid(hitEnt) or tr_main.HitWorld then self:EmitSound(self.Primary.Sound) self:SendWeaponAnim(ACT_VM_SECONDARYATTACK) if not (CLIENT and (not IsFirstTimePredicted())) then local edata = EffectData() edata:SetStart(spos) edata:SetOrigin(tr_main.HitPos) edata:SetNormal(tr_main.Normal) edata:SetSurfaceProp(tr_main.SurfaceProps) edata:SetHitBox(tr_main.HitBox) edata:SetEntity(hitEnt) if hitEnt:IsPlayer() or hitEnt:GetClass() == "prop_ragdoll" then util.Effect("BloodImpact", edata) self.Owner:LagCompensation(false) self.Owner:FireBullets({Num = 1, Src = spos, Dir = self.Owner:GetAimVector(), Spread = Vector(0, 0, 0), Tracer = 0, Force = 1, Damage = 0}) else util.Effect("Impact", edata) end end else -- miss self:SendWeaponAnim(ACT_VM_PRIMARYATTACK) self:EmitSound(self.Primary.SoundMiss) end if SERVER and hitEnt and hitEnt:IsValid() then -- do another trace that sees nodraw stuff like func_button -- local tr_all = util.TraceLine({start = spos, endpos = sdest, filter = self.Owner}) local dmg = DamageInfo() dmg:SetDamage(80) dmg:SetAttacker(self.Owner) dmg:SetInflictor(self) dmg:SetDamageForce(self.Owner:GetAimVector() * 1500) dmg:SetDamagePosition(self.Owner:GetPos()) dmg:SetDamageType(DMG_SLASH) hitEnt:DispatchTraceAttack(dmg, spos + (self.Owner:GetAimVector() * 3), sdest) end if self.Owner.LagCompensation then self.Owner:LagCompensation(false) end end AddNewWeapon(WEAPON_SLOT_MELEE, WEAPON_TYPE_MELEE, Wep, "weapon_fists", {font = "CSTypeDeath", letter = "H"}) Wep = {Primary = {}} Wep.PrintName = "Knife" Wep.HoldType = "knife" Wep.ViewModel = Model("models/weapons/cstrike/c_knife_t.mdl") Wep.WorldModel = Model("models/weapons/w_knife_t.mdl") Wep.Slot = 2 Wep.Primary.Sound = Sound("Weapon_Knife.Slash") Wep.Primary.SoundMiss = Sound("Weapon_Crowbar.Single") Wep.Primary.Range = 64 Wep.Primary.Damage = 120 Wep.Primary.Delay = 0.4 AddNewWeapon(WEAPON_SLOT_MELEE, WEAPON_TYPE_MELEE, Wep, "weapon_knife", {font = "CSTypeDeath", letter = "j"}) Wep = {Primary = {}} Wep.PrintName = "Crowbar" Wep.HoldType = "melee" Wep.ViewModel = Model("models/weapons/c_crowbar.mdl") Wep.WorldModel = Model("models/weapons/w_crowbar.mdl") Wep.Slot = 2 Wep.Primary.Sound = Sound("Weapon_Knife.Slash") Wep.Primary.SoundMiss = Sound("Weapon_Crowbar.Single") Wep.Primary.Range = 128 Wep.Primary.Damage = 120 Wep.Primary.Delay = 0.8 AddNewWeapon(WEAPON_SLOT_MELEE, WEAPON_TYPE_MELEE, Wep, "weapon_crowbar", {font = "HL2MPTypeDeath", letter = "6"})
-- This is a part of uJIT's testing suite. The script is tuned to reproduce -- following situation: During running the timeout function, the JIT compiler -- starts recording a trace and aborts. The platform must not re-enable -- timeout checks for the coroutine in these cirsumstances. -- Copyright (C) 2015-2019 IPONWEB Ltd. See Copyright Notice in COPYRIGHT jit.on() -- Ensures that JIT recorder will be started when trace_me is called 2nd time. jit.opt.start("hotloop=1", "-jitcat") timeout_handler_called = 0 local function trace_me() print("print") -- to abort tracing return "x" end function timeout_handler() timeout_handler_called = timeout_handler_called + 1 local str = trace_me() local _ = "" -- This loop must will run uninterrupted because we are already in -- a timeout function. for i = 1, 1e5 do _ = str .. i -- ensures the loop is never compiled end end function coroutine_payload() local i = 0 local s = 0 local _ while true do s = s + i i = i + 1 _ = "str " .. i -- ensures the loop is never compiled end end trace_me()
--[=[ @class IKAimPositionPriorites ]=] local require = require(script.Parent.loader).load(script) local Table = require("Table") return Table.readonly({ DEFAULT = 0; LOW = 1000; MEDIUM = 3000; HIGH = 4000; })
ghc_fs_include_dir = "$(projectdir)/thirdparty/ghc_fs/include" ghc_fs_source_dir = "$(projectdir)/thirdparty/ghc_fs" table.insert(include_dir_list, ghc_fs_include_dir) table.insert(deps_list, "ghc_fs") target("ghc_fs") set_kind("static") add_files(ghc_fs_source_dir.."/filesystem.cpp") if is_os("windows") then add_links("shell32") end add_includedirs(ghc_fs_include_dir) add_cxflags(project_cxflags, {public = true})
-- Transition easing functions. -- -- Copyright (c) 2010-present Bifrost Entertainment AS and Tommy Nguyen -- Distributed under the MIT License. -- (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) local function cubic(t) return t * t * t end local function ease(a, b, t) return a + (b - a) * t end local function easeinout(f, a, b, t) return t < 0.5 and ease(a, b, f(t * 2.0) * 0.5) or ease(a, b, 1 - f((1 - t) * 2.0) * 0.5) end local function flip(f, t) return 1.0 - f(1.0 - t) end local function quadratic(t) return t * t end local function quartic(t) return t * t * t * t end local function quintic(t) return t * t * t * t * t end return { linear = ease, easein_cubic = function(a, b, t) return ease(a, b, cubic(t)) end, easein_quadratic = function(a, b, t) return ease(a, b, quadratic(t)) end, easein_quartic = function(a, b, t) return ease(a, b, quartic(t)) end, easein_quintic = function(a, b, t) return ease(a, b, quintic(t)) end, easeout_cubic = function(a, b, t) return ease(a, b, flip(cubic, t)) end, easeout_quadratic = function(a, b, t) return ease(a, b, flip(quadratic, t)) end, easeout_quartic = function(a, b, t) return ease(a, b, flip(quartic, t)) end, easeout_quintic = function(a, b, t) return ease(a, b, flip(quintic, t)) end, easeinout_cubic = function(a, b, t) return easeinout(cubic, a, b, t) end, easeinout_quadratic = function(a, b, t) return easeinout(quadratic, a, b, t) end, easeinout_quartic = function(a, b, t) return easeinout(quartic, a, b, t) end, easeinout_quintic = function(a, b, t) return easeinout(quintic, a, b, t) end, }
-- -- Copyright 2010-2014 Branimir Karadzic. All rights reserved. -- License: http://www.opensource.org/licenses/BSD-2-Clause -- solution "bgfx" configurations { "Debug", "Release", } platforms { "x32", "x64", "Xbox360", "Native", -- for targets where bitness is not specified } language "C++" BGFX_DIR = (path.getabsolute("..") .. "/") local BGFX_BUILD_DIR = (BGFX_DIR .. ".build/") local BGFX_THIRD_PARTY_DIR = (BGFX_DIR .. "3rdparty/") BX_DIR = (BGFX_DIR .. "../bx/") defines { "BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS=1" } dofile (BX_DIR .. "premake/toolchain.lua") toolchain(BGFX_BUILD_DIR, BGFX_THIRD_PARTY_DIR) function copyLib() end function exampleProject(_name, _uuid) project ("example-" .. _name) uuid (_uuid) kind "WindowedApp" configuration {} debugdir (BGFX_DIR .. "examples/runtime/") includedirs { BX_DIR .. "include", BGFX_DIR .. "include", BGFX_DIR .. "3rdparty", BGFX_DIR .. "examples/common", } files { BGFX_DIR .. "examples/" .. _name .. "/**.cpp", BGFX_DIR .. "examples/" .. _name .. "/**.h", } links { "bgfx", "example-common", } configuration { "vs*" } linkoptions { "/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll } links { -- this is needed only for testing with GLES2/3 on Windows with VS2008 "DelayImp", } configuration { "vs2010" } linkoptions { -- this is needed only for testing with GLES2/3 on Windows with VS201x "/DELAYLOAD:\"libEGL.dll\"", "/DELAYLOAD:\"libGLESv2.dll\"", } configuration { "android*" } kind "ConsoleApp" targetextension ".so" linkoptions { "-shared", } links { "EGL", "GLESv2", } configuration { "nacl or nacl-arm" } kind "ConsoleApp" targetextension ".nexe" links { "ppapi", "ppapi_gles2", "pthread", } configuration { "pnacl" } kind "ConsoleApp" targetextension ".pexe" links { "ppapi", "ppapi_gles2", "pthread", } configuration { "asmjs" } kind "ConsoleApp" targetextension ".bc" configuration { "linux-*" } links { "X11", "GL", "pthread", } configuration { "osx" } files { BGFX_DIR .. "examples/common/**.mm", } links { "Cocoa.framework", "OpenGL.framework", -- "SDL2", } configuration { "ios*" } kind "ConsoleApp" files { BGFX_DIR .. "examples/common/**.mm", } linkoptions { "-framework CoreFoundation", "-framework Foundation", "-framework OpenGLES", "-framework UIKit", "-framework QuartzCore", } configuration { "qnx*" } targetextension "" links { "EGL", "GLESv2", } configuration {} strip() end dofile "bgfx.lua" dofile "example-common.lua" exampleProject("00-helloworld", "ff2c8450-ebf4-11e0-9572-0800200c9a66") exampleProject("01-cubes", "fec3bc94-e1e5-11e1-9c59-c7eeec2c1c51") exampleProject("02-metaballs", "413b2cb4-f7db-11e1-bf5f-a716de6a022f") exampleProject("03-raymarch", "1cede802-0220-11e2-91ba-e108de6a022f") exampleProject("04-mesh", "546bbc76-0c4a-11e2-ab09-debcdd6a022f") exampleProject("05-instancing", "5d3da660-1105-11e2-aece-71e4dd6a022f") exampleProject("06-bump", "ffb23e6c-167b-11e2-81df-94c4dd6a022f") exampleProject("07-callback", "acc53bbc-52f0-11e2-9781-ad8edd4b7d02") exampleProject("08-update", "e011e246-5862-11e2-b202-b7cb257a7926") exampleProject("09-hdr", "969a4626-67ee-11e2-9726-9023267a7926") exampleProject("10-font" , "ef6fd5b3-b52a-41c2-a257-9dfe709af9e1") exampleProject("11-fontsdf", "f4e6f96f-3daa-4c68-8df8-bf2a3ecd9092") exampleProject("12-lod", "0512e9e6-bfd8-11e2-8e34-0291bd4c8125") exampleProject("13-stencil", "d12d6522-37bc-11e3-b89c-e46428d43830") exampleProject("14-shadowvolumes", "d7eb4bcc-37bc-11e3-b7a4-e46428d43830") exampleProject("15-shadowmaps-simple", "a10f22ab-e0ee-471a-b2b6-2f6cb1c63fdc") exampleProject("16-shadowmaps", "f9a91cb0-7b1b-11e3-981f-0800200c9a66") exampleProject("17-drawstress", "9aeea4c6-80dc-11e3-b3ca-4da6db0f677b") exampleProject("18-ibl", "711bcbb0-9531-11e3-a5e2-0800200c9a66") exampleProject("19-oit", "d7eca4fc-96d7-11e3-a73b-fcafdb0f677b") dofile "makedisttex.lua" dofile "shaderc.lua" dofile "texturec.lua" dofile "geometryc.lua"
--[[ example file from sluacurses. File shows a simple example of creating a single window through sluacurses. --]] local Curses = require("sluacurses") --load sluacurses into program initscr() --start ncurses noecho() --dont display keystrokes to screen curs_set(0) --dont display cursor refresh() --refresh screen --create a new window and save its hashed name to 'w' --args: name,height,width,starting y, starting x local w = newwin(15,25,5,5) --args: window, left,right,bottom,top,tl,tr,bl,br wborder(w,"|","|","-","-","+","+","+","+") --create border around window 'w' wmove(w,4,2) --move cursor to positon y:4 x:2 in window 'w' wprintw(w,"hello world!") --print string to window 'w' mvwprintw(w,5,2,"enter char") wrefresh(w) --refreesh window 'w' local c = wgetch(w) --get input from window 'w' mvwprintw(w,6,2,c) --move to y:6 x:2 in window 'w' then print char 'c' mvwprintw(w,7,2,"press any key to exit") wrefresh(w) getch() endwin() --shut down ncurses
object_tangible_quest_tatooine_reeyees_jabbas_ledger = object_tangible_quest_shared_tatooine_reeyees_jabbas_ledger:new { } ObjectTemplates:addTemplate(object_tangible_quest_tatooine_reeyees_jabbas_ledger, "object/tangible/quest/tatooine_reeyees_jabbas_ledger.iff")
local fuzzy_match = require "utilities.fuzzy.fuzzy_match" local M = fuzzy_match describe("fuzzy_match:", function() describe("allCaseInsensitiveSplits()", function() it("should return the correct splits", function() assert.same( { {before = "abc", chr = "d", after = "efgdhij"}, {before = "abcdefg", chr = "d", after = "hij"}, }, M.allCaseInsensitiveSplits("abcdefgdhij", "d") ) end) end) describe("htmlEscape()", function() it("should return escaped html", function() assert.equal( "escaped &lt;b&gt;html&lt;/b&gt; &amp; stuff", M.htmlEscape("escaped <b>html</b> & stuff") ) assert.equal( "plain text", M.htmlEscape("plain text") ) end) end) describe("fuzzyMatch()", function() setup(function() doors = "There are so <b>many</b> doors to open" doors_esc = "There are so &lt;b&gt;many&lt;/b&gt; doors to open" end) it("should, on an empty string and an empty abbr, return score SCORE_CONTINUE_MATCH", function() assert.same( {score=M.SCORE_CONTINUE_MATCH, html=''}, M.fuzzyMatch("", "") ) end ) it("should, on an empty abbr, return score PENALTY_NOT_COMPLETE", function() assert.same( {score=M.PENALTY_NOT_COMPLETE, html=doors_esc}, M.fuzzyMatch(doors, "") ) end) it("should, on no match, return score 0", function() assert.same( {score=0, html=doors_esc}, M.fuzzyMatch(doors, "Q") ) end) it("should, on a complete match, return score SCORE_CONTINUE_MATCH^(len+1)", function() assert.same( {score=M.SCORE_CONTINUE_MATCH^5, html="<b>t</b><b>h</b><b>i</b><b>s</b>"}, M.fuzzyMatch("this", "this") ) end) it("should, on a matching first character, return score SCORE_CONTINUE_MATCH \z * PENALTY_NOT_COMPLETE", function() assert.same( {score=M.PENALTY_NOT_COMPLETE, html="<b>t</b>his"}, M.fuzzyMatch("this", "t") ) end ) it("should, on matching first two characters, return score SCORE_CONTINUE_MATCH^2 \z * PENALTY_NOT_COMPLETE", -- TODO: matching more characters should get a higher score function() assert.same( {score=M.PENALTY_NOT_COMPLETE, html="<b>t</b><b>h</b>is"}, M.fuzzyMatch("this", "th") ) end ) it("should, on the matching first character of the second word,\z return score PENALTY_NOT_COMPLETE*SCORE_START_WORD*PENALTY_SKIPPED^before", function() assert.same( { score=M.PENALTY_NOT_COMPLETE*M.SCORE_START_WORD*M.PENALTY_SKIPPED^5, html="this <b>g</b>oat" }, M.fuzzyMatch("this goat", "g") ) end ) describe("for a bunch of other matches...", function() fix = { { 'Harry', 'ry', M.SCORE_CONTINUE_MATCH*M.SCORE_OK*M.PENALTY_SKIPPED^3}, { 'Harry', 'rr', M.PENALTY_NOT_COMPLETE*M.SCORE_CONTINUE_MATCH*M.SCORE_OK*M.PENALTY_SKIPPED^2}, { 'Harry', 'arr', M.PENALTY_NOT_COMPLETE*M.SCORE_CONTINUE_MATCH^2*M.SCORE_OK*M.PENALTY_SKIPPED^1}, { 'Harry', 'Har', M.PENALTY_NOT_COMPLETE*M.SCORE_CONTINUE_MATCH^2}, { 'Harry', 'har', M.PENALTY_NOT_COMPLETE*M.PENALTY_CASE_MISMATCH*M.SCORE_CONTINUE_MATCH^2}, { 'Harry', 'rry', M.SCORE_CONTINUE_MATCH^2*M.SCORE_OK*M.PENALTY_SKIPPED^2}, { 'Harry and', ' ', M.PENALTY_NOT_COMPLETE*M.SCORE_OK*M.PENALTY_SKIPPED^5}, { 'Harry or', 'y or', M.SCORE_CONTINUE_MATCH^3*M.SCORE_OK*M.PENALTY_SKIPPED^4}, { 'Original window: Tab Two', 'Two', M.SCORE_CONTINUE_MATCH^3*M.SCORE_START_WORD*M.PENALTY_SKIPPED^21}, } for _,v in pairs(fix) do it("should, for '"..v[1].."' with '"..v[2].."', return the score "..v[3], function() assert.equal(v[3], M.fuzzyMatch(v[1], v[2]).score) end) end end) end) describe("fuzzySort()", function() setup(function() list = { { name = "Lucius", role = "Mastermind", level = 10 }, { name = "Harry", role = "Hero", level = 3 }, { name = "Hermione", role = "Brain", level = 7 }, } sorted_list = M.fuzzySort(list, 'name', 'rr') end) it("should decorate the list with scores", function() assert.is_true(type(sorted_list[1]._score) == 'number') end) end) end)
-- -- Quick Export Script to Swap Red and Blue Channels in Gimp -- by Stu Fisher http://q3f.org -- -- modified to use ImageMagick -- by Chris McClanahan http://mcclanahoochie.com -- return { LrSdkVersion = 4.0, LrSdkMinimumVersion = 3.0, LrToolkitIdentifier = 'com.adobe.lightroom.export.rbswap', LrPluginName = LOC "$$$/YAPB/PluginName=Red Blue Swap", LrExportServiceProvider = { title = LOC "$$$/YAPB/YAPB-title=RBSwap", file = 'RBSwapExportServiceProvider.lua', builtInPresetsDir = 'presets', }, VERSION = { major=1, minor=1, revision=0, build=2, }, }
-- Anti compiller -- Anti compiller local CSGSecurity = {{{{{ {}, {}, {} }}}}} GUIEditor = { label = {} } vehiclesWindow = guiCreateWindow(102, 133, 539, 330, "Aurora ~ Vehicles", false) guiWindowSetSizable(vehiclesWindow, false) vehiclesGrid = guiCreateGridList(10, 27, 356, 289, false, vehiclesWindow) vehicleName = guiGridListAddColumn(vehiclesGrid, " Vehiclename:", 0.5) vehicleMaxV = guiGridListAddColumn(vehiclesGrid, "Max Velocity", 0.2) vehicleMaxP = guiGridListAddColumn(vehiclesGrid, "Max Passenger", 0.2) spawnVehicleSystemButton = guiCreateButton(383, 66, 146, 33, "Spawn Vehicle", false, vehiclesWindow) guiSetProperty(spawnVehicleSystemButton, "NormalTextColour", "FF3AEE10") closeWindowButton = guiCreateButton(383, 286, 146, 30, "Close Window", false, vehiclesWindow) guiSetProperty(closeWindowButton, "NormalTextColour", "FFFEFEFE") GUIEditor.label[1] = guiCreateLabel(383, 31, 146, 25, "Options", false, vehiclesWindow) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) guiGridListSetSortingEnabled ( vehiclesGrid, false )addEventHandler("onClientGUIClick", closeWindowButton, function() guiSetVisible(vehiclesWindow, false) showCursor( false, false ) guiGridListClear ( vehiclesGrid ) end, false) setTimer(function() if getElementDimension(localPlayer) ~= 0 then guiSetVisible(vehiclesWindow, false) showCursor( false, false ) guiGridListClear ( vehiclesGrid ) end if getElementHealth(localPlayer) < 1 then guiSetVisible(vehiclesWindow, false) showCursor( false, false ) guiGridListClear ( vehiclesGrid ) end end,500,0) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(vehiclesWindow,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(vehiclesWindow,x,y,false) guiWindowSetMovable (vehiclesWindow, true) guiWindowSetSizable (vehiclesWindow, false) guiSetVisible (vehiclesWindow, false) ---------------------------- MTA VEHICLES IDS/NAMES------------------------------ --SSG local ssgheli = { ------------------------------------------------------------------------ [447] = {"Seasparrow",0, 0, 0, 0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [487] = {"Maverick",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [519] = {"Shamal",0, 0, 0, 0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, } local ssgCars ={ [528] = {"FBI Truck",0,0,0,0,r=0,g=170,b=0,r2=0,g2=0,b2=0}, [427] = {"Enforcer",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [596] = {"Police Car (LS)",0,0,0,0,r=0,g=0,b=0,r2=0,g2=170,b2=0}, [599] = {"Police Ranger",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [490] = {"FBI Rancher",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [601] = {"S.W.A.T.",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [560] = {"Sultan",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [409] = {"Stretch",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [415] = {"Cheetah",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [500] = {"Mesa",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [451] = {"Turismo",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [494] = {"Hotring Racer",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [522] = {"NRG-500",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [411] = {"Infernus",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [541] = {"Bullet", 0,0,0,0,r=22,g=22,b=22,r2=0,g2=170,b2=0}, } local ssgwater = { [452] = {"Speeder",0, 0, 0, 0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [446] = {"Squalo",0, 0, 0, 0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [472] = {"Coast Guard",0, 0, 0, 0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ --The Smurfs local dcFly = { ------------------------------------------------------------------------ [487] = {"DreamChasers Maverick",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, } local dcCars = { [411] = {"Infernus",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, [434] = {"Hotknife",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, [451] = {"Turismo",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, [522] = {"NRG-500",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, [541] = {"Bullet",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, [560] = {"Sultan",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, [480] = {"Comet",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, [431] = {"Bus",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, [495] = {"Sandking",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, [502] = {"Hotring Racer A",0,0,0,0,r=66,g=161,b=244,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ --HolyCrap ------------------------------------------------------------------------ local hcFly = { [487] = {"Maverick",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [447] = {"Seasparrow",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, } local hcAir = { [519] = {"Shamal",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [476] = {"Rustler",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [520] = {"Hydra",0, 0, 0, 0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [487] = {"Maverick",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [447] = {"Seasparrow",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, } local hcCars = { [451] = {"Turismo",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [411] = {"Infernus",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [522] = {"NRG-500",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [541] = {"Bullet",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [489] = {"Rancher",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [560] = {"Sultan",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [437] = {"Coach",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [495] = {"Sandking",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [415] = {"Cheetah",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [494] = {"Hotring Racer",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [504] = {"Bloodring Banger",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [506] = {"Super GT",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [556] = {"Monster truck",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [571] = {"Kart",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [409] = {"Limousine",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [424] = {"BF Injection",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [434] = {"Hotknife",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [463] = {"Freeway",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [468] = {"Sanchez",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [471] = {"Quadbike",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [480] = {"Comet",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [486] = {"Dozer",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [500] = {"Mesa",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [535] = {"Slamvan",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [562] = {"Elegy",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [568] = {"Bandito",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, [567] = {"Savanna",0,0,0,0,r=0,g=0,b=102,r2=0,g2=0,b2=0}, } local hcWater = { [452] = {"Speeder",0, 0, 0, 0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [446] = {"Squalo",0, 0, 0, 0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ -- GIGN local GIGN2019_vehicles = { [598] = {"Police LV", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [599] = {"Police Ranger", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [522] = {"NRG-500", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [523] = {"HPV-1000", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [427] = {"Enforcer", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [470] = {"Patriot", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [411] = {"Infernus", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [579] = {"Huntley", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [560] = {"Sultan", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [551] = {"Merit", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [541] = {"Bullet", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [490] = {"FBI Rancher", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [528] = {"FBI Truck", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [437] = {"Coach", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [601] = {"S.W.A.T.", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [433] = {"Barracks", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, } local GIGN2019_helicopters = { [497] = {"Police Maverick", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [447] = {"Seasparrow", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, } local GIGN2019_planes = { [519] = {"Shamal", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, } local GIGN2019_boats = { [493] = {"Jetmax", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, [446] = {"Squalo", 131,131,131,131,r=0,g=0,b=100,r2=255,g2=255,b2=255}, } ------------------------------------------------------------------------ --Delta Force local DFCars = { ------------------------------------------------------------------------ [490] = {"FBI Rancher",0,0,0,0,r=0,g=128,b=128,r2=0,g2=0,b2=0}, [522] = {"NRG-500",0,0,0,0,r=0,g=128,b=128,r2=0,g2=0,b2=0}, [427] = {"Enforcer",0,0,0,0,r=0,g=128,b=128,r2=0,g2=0,b2=0}, [411] = {"Infernus",0,0,0,0,r=0,g=128,b=128,r2=0,g2=0,b2=0}, [495] = {"Sandking",0,0,0,0,r=0,g=128,b=128,r2=0,g2=0,b2=0}, [560] = {"Sultan",0,0,0,0,r=0,g=128,b=128,r2=0,g2=0,b2=0}, [500] = {"Mesa",0,0,0,0,r=0,g=128,b=128,r2=0,g2=0,b2=0}, } local DFFly = { [519] = {"Shamal",0,0,0,0,r=0,g=128,b=128,r2=0,g2=0,b2=0}, } local DFHeli = { [497] = {"Police Maverick",0,0,0,0,r=0,g=128,b=128,r2=0,g2=0,b2=0}, [447] = {"Seasparrow",0,0,0,0,r=0,g=128,b=128,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ --The Cobras local CobCars = { ------------------------------------------------------------------------ [482] = {"Burrito",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, [522] = {"NRG-500",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, [427] = {"Enforcer",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, [411] = {"Infernus",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, [580] = {"Stafford",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, [560] = {"Sultan",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, [541] = {"Bullet",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, [409] = {"The Very Loooooooong Car",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, } local CobFly = { [519] = {"Shamal",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, [593] = {"Dodo",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, } local CobHeli = { [487] = {"Maverick",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, [465] = {"Cobras Little Drone",0,0,0,0,r=0,g=90,b=0,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ --FBI local FBICars = { ------------------------------------------------------------------------ [490] = {"FBI Rancher",0,0,0,0,r=0,g=118,b=240,r2=0,g2=0,b2=0}, [522] = {"NRG-500",0,0,0,0,r=0,g=118,b=240,r2=0,g2=0,b2=0}, [427] = {"Enforcer",0,0,0,0,r=0,g=118,b=240,r2=0,g2=0,b2=0}, [411] = {"Infernus",0,0,0,0,r=0,g=118,b=240,r2=0,g2=0,b2=0}, [528] = {"FBI Truck",0,0,0,0,r=0,g=118,b=240,r2=0,g2=0,b2=0}, [541] = {"Bullet",0,0,0,0,r=0,g=118,b=240,r2=0,g2=0,b2=0}, [596] = {"Police LS",0,0,0,0,r=0,g=118,b=240, r2=0,g2=0,b2=0}, [597] = {"Police SF",0,0,0,0,r=0,g=118,b=240, r2=0,g2=0,b2=0}, [598] = {"Police LV",0,0,0,0,r=0,g=118,b=240, r2=0,g2=0,b2=0}, [599] = {"Police Ranger",0,0,0,0,r=0,g=118,b=240, r2=0,g2=0,b2=0}, } local FBIFly = { [519] = {"Shamal",0,0,0,0,r=0,g=118,b=240,r2=0,g2=0,b2=0}, } local FBIHeli = { [497] = {"Police Maverick",0,0,0,0,r=0,g=118,b=240,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ --Military Forces local affVehicles = { ------------------------------------------------------------------------ [470] = {"Patriot", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [490] = {"FBI Rancher", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [598] = {"Police (LVPD)", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [500] = {"Mesa", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [495] = {"Sandking", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [560] = {"Sultan", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [409] = {"Stretch", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [411] = {"Infernus", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [468] = {"Sanchez", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [579] = {"Huntley", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [427] = {"Enforcer", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [433] = {"Barracks", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [434] = {"Hotknife", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [541] = {"Bullet", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [522] = {"NRG-500", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [528] = {"FBI Truck", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [428] = {"Securicar", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [601] = {"S.W.A.T.", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [559] = {"Jester", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [565] = {"Flash", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, } local aafVehicles_Aircraft_Plane = { [519] = {"Shamal", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [511] = {"Beagle", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [593] = {"Dodo", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, } local aafVehicles_Aircraft_Copter = { [497] = {"Police Maverick", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, } local aafVehicles_Aircraft_Copter1= { [497] = {"Police Maverick", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [519] = {"Shamal", 0,0,0,0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, } local mfBoat = { [446] = {"Squallo",44, 44 , 44, 44}, [430] = {"Predator",44, 44 , 44, 44 }, [595] = {"Launch",44, 44 , 44, 44 }, } ------------------------------------------------------------------------ -- Special PoliceForce local spfCars = { [560] = {"Sultan",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [415] = {"Cheetah",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [522] = {"NRG-500",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [451] = {"Turismo",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [495] = {"Sandking",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [429] = {"Banshee",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [489] = {"Rancher",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [411] = {"Infernus",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [579] = {"Huntley",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [434] = {"Hotknife",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [521] = {"FCR-900 ",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [468] = {"Sanchez",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [463] = {"Freeway",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [471] = {"Quad",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [572] = {"Mower",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [506] = {"Super GT",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [560] = {"Sultan",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [561] = {"Stratum",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [568] = {"Bandito",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [475] = {"Sabre",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [409] = {"Stretch",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [587] = {"Euros",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [467] = {"Oceanic",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [545] = {"Hustler",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [500] = {"Mesa",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [580] = {"Stafford",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [575] = {"Broadway",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [400] = {"Landstalker",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [482] = {"Burrito",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [552] = {"Utility Van",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [418] = {"Moonbeam",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [486] = {"Dozer",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [557] = {"Monster Truck",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [443] = {"Packer",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [431] = {"Bus",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [573] = {"Dune",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [524] = {"Cement Truck",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [578] = {"DFT-30",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [455] = {"Flatbed",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [498] = {"Boxville",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [525] = {"Towtruck",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [478] = {"Walton",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [531] = {"Tractor",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, } local spfAir = { [519] = {"Shamal",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [593] = {"Dodo",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [553] = {"Nevada",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [513] = {"Stuntplane",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [512] = {"Cropduster",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [476] = {"Rustler",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, } local spfChoppers = { [487] = {"Maverick",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [563] = {"Raindance",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [417] = {"Leviathan",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [548] = {"Cargobob",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [488] = {"News chopper",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [447] = {"Seasparrow",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, } local spfBoats = { [473] = {"Dinghy",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [595] = {"Launch",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [452] = {"Speeder",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [446] = {"Squallo",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [493] = {"Jetmax",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [484] = {"Marquis",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [539] = {"Vortex",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [454] = {"Tropic",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, [453] = {"Reefer",0, 0, 0, 0,r=40,g=0,b=80,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ local terrVehs = { [411] = {"Infernus",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [580] = {"Stafford",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [560] = {"Sultan",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [522] = {"Terrorists NRG-500",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [490] = {"Terrorists Rancher",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [468] = {"Sanchez",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [515] = {"Roadtrain",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [495] = {"Sandking",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [494] = {"Hotring Racer",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [489] = {"Rancher",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [457] = {"Caddy",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, [449] = {"Tram",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, } local terrChop = { [487] = {"Terrorists Maverick",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, } local terrAir = { [519] = {"Shamal",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, } local terrWater = { [446] = {"Squallo",0, 0, 0, 0,r=0,g=0,b=0,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ local b13Vehs = { [560] = {"Sultan",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [411] = {"Infernus",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [522] = {"NRG-500",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [541] = {"Bullet",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [429] = {"Banshee",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [495] = {"Sandking",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [437] = {"Coach",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [451] = {"Turismo",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [506] = {"Super GT",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [479] = {"Regina",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [521] = {"FCR-900 ",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [463] = {"Freeway",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [561] = {"Stratum",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [568] = {"Bandito",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [409] = {"Stretch",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [482] = {"Burrito",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [556] = {"Monster A",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [443] = {"Packer",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [471] = {"Quadbike",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [535] = {"Slamvan",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [605] = {"damaged Sadler",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [504] = {"Bloodring Banger",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [503] = {"Hotring Racer B",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [502] = {"Hotring Racer A",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, } ------------------------------------------------------------------------ local b13Choppers = { [487] = {"Maverick",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [488] = {"News chopper",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [447] = {"Seasparrow",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [563] = {"Raindance",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, } ------------------------------------------------------------------------ local b13Air = { [519] = {"Shamal",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [513] = {"Stuntplane",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [476] = {"Rustler",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [511] = {"Beagle",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, } ------------------------------------------------------------------------ local b13Water = { [595] = {"Launch",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [460] = {"Skimmer",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [539] = {"Vortex",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [473] = {"Dinghy",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, [484] = {"Marquis",0, 0, 0, 0,r=128,g=0,b=128,r2=255,g2=255,b2=255}, } ------------------------------------------------------------------------ local fairyCaptain = { [453] = {"Reefer", 0, 0, 0, 0,r=255,g=255,b=0,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ local pinoyVehs = { [560] = {"Sultan",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [411] = {"Infernus",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [522] = {"NRG-500",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [541] = {"Bullet",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [578] = {"DFT-30",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [495] = {"Sandking",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [437] = {"Coach",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [451] = {"Turismo",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [506] = {"Super GT",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [479] = {"Regina",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, } ------------------------------------------------------------------------ local pinoyAir = { [487] = {"Maverick",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [519] = {"Shamal",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, [447] = {"Seasparrow",0, 0, 0, 0,r=121,g=121,b=121,r2=255,g2=255,b2=255}, } ------------------------------------------------------------------------ local SpecialVehs = { [560] = {"Sultan",0, 0, 0, 0,r=100,g=0,b=100,r2=0,g2=0,b2=0}, [411] = {"Infernus",0, 0, 0, 0,r=100,g=0,b=100,r2=0,g2=0,b2=0}, [522] = {"NRG-500",0, 0, 0, 0,r=100,g=0,b=100,r2=0,g2=0,b2=0}, [451] = {"Turismo",0, 0, 0, 0,r=100,g=0,b=100,r2=255,g2=255,b2=255}, } ------------------------------------------------------------------------ local SpecialChoppers = { [487] = {"Maverick",0, 0, 0, 0,r=100,g=0,b=100,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ local SpecialAir = { [519] = {"Shamal",0, 0, 0, 0,r=100,g=0,b=100,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ --SAT local satheli = { ------------------------------------------------------------------------ [487] = {"Maverick",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ local satCars ={ [528] = {"FBI Truck",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [427] = {"Enforcer",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [596] = {"Police Car (LS)",0,0,0,0,r=0,g=0,b=255,r2=0,g2=170,b2=0}, [599] = {"Police Ranger",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [490] = {"FBI Rancher",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [601] = {"S.W.A.T.",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [560] = {"Sultan",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [415] = {"Cheetah",0,0,0,0,r=22,g=22,b=22,r2=0,g2=0,b2=0}, [500] = {"Mesa",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [451] = {"Turismo",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [522] = {"NRG-500",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [411] = {"Infernus",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [541] = {"Bullet", 0,0,0,0,r=0,g=0,b=255,r2=0,g2=170,b2=0}, } local satwater = { [452] = {"Speeder",0, 0, 0, 0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [446] = {"Squalo",0, 0, 0, 0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [472] = {"Coast Guard",0, 0, 0, 0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, } local satAir = { ------------------------------------------------------------------------ [487] = {"Maverick",0,0,0,0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, [519] = {"Shamal",0, 0, 0, 0,r=0,g=0,b=255,r2=0,g2=0,b2=0}, } ------------------------------------------------------------------------ local vehicleMarkers = { --GIGN --{ 1991.32, -102.63, 35.47,0,0,100,gignCars,"GIGN","nil",90,"aGroup",nil,nil,nil,"GIGN"}, --{ 2063.62, -180.36, 36.6,0,0,100,gignFly,"GIGN","nil",270,"aGroup",nil,nil,nil,"GIGN"}, --{2005.98, -181.6, 58.84,0,0,100,gignheli,"GIGN","nil",0,"aGroup",nil,nil,nil,"GIGN"}, --{-27.799999237061, 244.5, 8.6999998092651, 0, 0, 100, GIGN2019_vehicles, "Government","GIGN", 240.002746, "aGroup",nil,nil,nil,"GIGN"}, --{-22.89999961853, 253.30000305176, 8.6999998092651, 0, 0, 100, GIGN2019_vehicles, "Government","GIGN", 240.002746, "aGroup",nil,nil,nil,"GIGN"}, --{-17.89999961853, 262, 8.6999998092651, 0, 0, 100, GIGN2019_vehicles, "Government","GIGN", 240.002746, "aGroup",nil,nil,nil,"GIGN"}, --{44.299999237061, 192.69999694824, 1.6000000238419, 0, 0, 100, GIGN2019_vehicles, "Government","GIGN", 59.2526245, "aGroup",nil,nil,nil,"GIGN"}, --{39.599998474121, 214.69999694824, 1.6000000238419, 0, 0, 100, GIGN2019_vehicles, "Government","GIGN", 242.252288, "aGroup",nil,nil,nil,"GIGN"}, --{49.099998474121, 247.5, 1.6000000238419, 0, 0, 100, GIGN2019_vehicles, "Government","GIGN", 240, "aGroup",nil,nil,nil,"GIGN"}, --{-43.200000762939, 304.70001220703, 8.8000001907349, 0, 0, 100, GIGN2019_planes, "Government","GIGN", 330.002746, "aGroup",nil,nil,nil,"GIGN"}, --{64.7, 261.4, 34.2, 0, 0, 100, GIGN2019_helicopters, "Government","GIGN", 180, "aGroup",nil,nil,nil,"GIGN"}, --{112.80000305176, 328.70001220703, 0.60000002384186, 0, 0, 100, GIGN2019_boats, "Government","GIGN", 328.002593, "aGroup",nil,nil,nil,"GIGN"}, ------------------------------------------------------------------------------------------------ --The Exorcist --{ 2675.26, 513.73, 27.63,118,8,215,exocars,"Criminals","nil",360,"aGroup",nil,nil,nil,"The Exorcist"}, --{ 2669.62,513.73,27.63,118,8,215,exocars,"Criminals","nil",360,"aGroup",nil,nil,nil,"The Exorcist"}, --{ 2664.25,513.16,27.63,118,8,215,exocars,"Criminals","nil",360,"aGroup",nil,nil,nil,"The Exorcist"}, --{ 2690.22,478.82,27.61,118,8,215,exoFly,"Criminals","nil",90,"aGroup",nil,nil,nil,"The Exorcist"}, --{ 2633.46,479.2,27.54,118,8,215,exoAir,"Criminals","nil",90,"aGroup",nil,nil,nil,"The Exorcist"}, ------------------------------------------------------------------------------------------------ --DreamChacers --{ 1956.69, 506.45, 21.98,66, 161, 244,dcCars,"Criminals","nil",360,"aGroup",nil,nil,nil,"DreamChacers"}, --{ 1966.23, 506.45, 21.98,66, 161, 244,dcCars,"Criminals","nil",360,"aGroup",nil,nil,nil,"DreamChacers"}, --{ 1975.5, 506.45, 21.98,66, 161, 244,dcCars,"Criminals","nil",360,"aGroup",nil,nil,nil,"DreamChacers"}, --{ 1961.81, 586.33, 24.52,66, 161, 244,dcFly,"Criminals","nil",90,"aGroup",nil,nil,nil,"DreamChacers"}, ------------------------------------------------------------------------------------------------ --HolyCrap --{ 2153.44, 3113.71, 46.69,0,0,102,hcCars,"HolyCrap","nil",0,"aGroup",nil,nil,nil,"HolyCrap"}, --{ 1983.48, 3260.84, 46.61,0,0,102,hcAir,"HolyCrap","nil",270,"aGroup",nil,nil,nil,"HolyCrap"}, --{ 2243.47, 3115.08, -0.56,0,0,102,hcWater,"HolyCrap","nil",360,"aGroup",nil,nil,nil,"HolyCrap"}, --{ 2148.99, 3114.86, 46.69,hcCars,"HolyCrap","nil",0,"aGroup",nil,nil,nil,"HolyCrap"}, --{ 2175.18, 3124.69, 49.22,0,0,0,102,hcFly,"HolyCrap","nil",0,"aGroup",nil,nil,nil,"HolyCrap"}, ------------------------------------------------------------------------------------------------ --SSG Position: --{ 152.45, 320.51, 2.82 ,22,22,22,ssgheli,"Government","nil",90,"aGroup",nil,nil,nil,"SSG"}, --{ 85.15, 297.69, 4.52 ,22,22,22,ssgheli,"Government","nil",270,"aGroup",nil,nil,nil,"SSG"}, --{ 182.46, 378.87, 1.93 ,22,22,22,ssgheli,"Government","nil",270,"aGroup",nil,nil,nil,"SSG"}, --{ 150.46, 462.63, 1.96 ,22,22,22,ssgCars,"Government","nil",90,"aGroup",nil,nil,nil,"SSG"}, --{ 150.75, 477.28, 1.97 ,22,22,22,ssgCars,"Government","nil",90,"aGroup",nil,nil,nil,"SSG"}, --{ 151.03, 492.41, 1.98 ,22,22,22,ssgCars,"Government","nil",90,"aGroup",nil,nil,nil,"SSG"}, --{ -112.43, 385.79, -0.56 ,22,22,22,ssgwater,"Government","nil",90,"aGroup",nil,nil,nil,"SSG"}, ------------------------------------------------------------------------------------------------ --DF --{ 1954.09, -751.93, 138.44,0,128,128,DFCars,"Government","nil",288,"aGroup",nil,nil,nil,"Delta Force"}, --{ 1957.76, -766.93, 138.44,0,128,128,DFCars,"Government","nil",288,"aGroup",nil,nil,nil,"Delta Force"}, --{ 1984, -814.19, 141.32,0,128,128,DFHeli,"Government","nil",288,"aGroup",nil,nil,nil,"Delta Force"}, --{ 2033.53, -701.43, 132.69,0,128,128,DFFly,"Government","nil",17,"aGroup",nil,nil,nil,"Delta Force"}, ------------------------------------------------------------------------------------------------ --Cobras { 992.49, 1382.58, 21.79,0,90,0,CobCars,"Criminals","nil",90,"aGroup",nil,nil,nil,"The Cobras"}, { 992.49, 1377.65, 21.79,0,90,0,CobCars,"Criminals","nil",90,"aGroup",nil,nil,nil,"The Cobras"}, { 901.84, 1422.04, 38.96,0,90,0,CobFly,"Criminals","nil",0,"aGroup",nil,nil,nil,"The Cobras"}, { 852.21, 1491.96, 51.14,0,90,0,CobHeli,"Criminals","nil",270,"aGroup",nil,nil,nil,"The Cobras"}, --{ 1984, -814.19, 141.32,0,128,128,DFHeli,"Criminals","nil",288,"aGroup",nil,nil,nil,"The Cobras"}, --{ 2033.53, -701.43, 132.69,0,128,128,DFFly,"Criminals","nil",17,"aGroup",nil,nil,nil,"The Cobras"}, --------------------------------------------------------------------------------------------------- --FBI { 2868.81, -343.45, 8.75,0,118,240,FBICars,"Government","nil",108.47,"aGroup",nil,nil,nil,"Federal Bureau Of Investigations"}, { 2875.2, -355.4, 8.75,0,118,240,FBICars,"Government","nil",124.65,"aGroup",nil,nil,nil,"Federal Bureau Of Investigations"}, { 2931.25, -373.97, 15.64,0,118,240,FBIFly,"Government","nil",336.62,"aGroup",nil,nil,nil,"Federal Bureau Of Investigations"}, { 2886.27, -301.1, 30.34,0,118,240,FBIHeli,"Government","nil",69.4,"aGroup",nil,nil,nil,"Federal Bureau Of Investigations"}, { 2890.59, -288.89, 30.34,0,118,240,FBIHeli,"Government","nil",69.4,"aGroup",nil,nil,nil,"Federal Bureau Of Investigations"}, --------------------------------------------------------------------------------------------------- -- Advanced Assault Forces {227.59, 1877.49, 17.64, 84, 107, 46, affVehicles, "Government","Advanced Assault Forces", 356.49185180664, "aGroup",nil,nil,nil,"Advanced Assault Forces"}, {203.04, 1877.49, 17.64, 84, 107, 46, affVehicles, "Government","Advanced Assault Forces", 356.49185180664, "aGroup",nil,nil,nil,"Advanced Assault Forces"}, {308.39, 2037.74, 17.64, 84, 107, 46, aafVehicles_Aircraft_Plane, "Government","Advanced Assault Forces", 179.96197509766, "aGroup",nil,nil,nil,"Advanced Assault Forces"}, {235.82, 1969.28, 18.53, 84, 107, 46, aafVehicles_Aircraft_Copter, "Government","Advanced Assault Forces", 90, "aGroup",nil,nil,nil,"Advanced Assault Forces"}, ------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Government Agency --{309.67, 181.12, 5.62 , 60,60,60, fbiCars, "Government", nil, 307.34185791016, "aGroup",nil,nil,nil,"Government Agency" }, --{303.58, 188.55, 5.62 , 60,60,60, fbiCars, "Government", nil, 309.518280029, "aGroup",nil,nil,nil,"Government Agency" }, --{285.77, 128.68, 5.77 , 60,60,60, spfFly, "Government", nil, 38.878753662109, "aGroup",nil,nil,nil,"Government Agency" }, --{302.88, 181.2, 27.03 , 60,60,60, spfAir, "Government", nil, 217.56965637207, "aGroup",nil,nil,nil,"Government Agency" }, --{225.21, 242.79, -0.56 , 60,60,60, spfWater, "Government", nil, 23.88241577148, "aGroup",nil,nil,nil,"Government Agency" }, ------------------------------------------------------------------------------------------------ --SPF --{ 3072.46, -100.41, 21.53, 40,0,80,spfCars,"Government","nil",0,"aGroup",nil,nil,nil,"Special PoliceForce"}, --{ 3062.69, -100.41, 21.54, 40,0,80,spfCars,"Government","nil",0,"aGroup",nil,nil,nil,"Special PoliceForce"}, --{ 3127.7, 23.93, 39.83, 40,0,80,spfCars,"Government","nil",0,"aGroup",nil,nil,nil,"Special PoliceForce"}, --{ 3170.49, -48.38, 39.88, 40,0,80,spfAir,"Government","nil",0,"aGroup",nil,nil,nil,"Special PoliceForce"}, --{ 3151.92, -93.88, 43.06, 40,0,80,spfChoppers,"Government","nil",0,"aGroup",nil,nil,nil,"Special PoliceForce"}, --{ 3119.73, 191.23, -0.56, 40,0,80,spfBoats,"Government","nil",0,"aGroup",nil,nil,nil,"Special PoliceForce"}, ------------------------------------------------------------------------------------------------ -- The Terrorists { 2567.39, 539.81, 12.66,255,255,0,terrVehs,"Criminals","nil",267,"aGroup",nil,nil,nil,"The Terrorists"}, { 2575.57, 539.77, 12.66,255,255,0,terrVehs,"Criminals","nil",90,"aGroup",nil,nil,nil,"The Terrorists"}, { 2663.06, 500.42, 33.26,255,255,0,terrChop,"Criminals","nil",360,"aGroup",nil,nil,nil,"The Terrorists"}, { 2565.72, 492.12, 30.6,255,255,0,terrAir,"Criminals","nil",90,"aGroup",nil,nil,nil,"The Terrorists"}, { 2571.64, 418.51, -0.56,255,255,0,terrWater,"Criminals","nil",175,"aGroup",nil,nil,nil,"The Terrorists"}, ------------------------------------------------------------------------------------------------ -- Kilo Tray Crips -- { 2140.87, 544.74, 13.6, 0, 0, 150,b13Vehs,"Criminals","nil",0,"aGroup",nil,nil,nil,"Kilo Tray Crips"}, -- { 2131.93, 544.74, 13.6, 0, 0, 150,b13Vehs,"Criminals","nil",0,"aGroup",nil,nil,nil,"Kilo Tray Crips"}, -- { 1894.01, 569.27, 34.72, 0, 0, 150,b13Choppers,"Criminals","nil",270,"aGroup",nil,nil,nil,"Kilo Tray Crips"}, -- { 1962.4, 586.95, 31.88, 0, 0, 150,b13Air,"Criminals","nil",270,"aGroup",nil,nil,nil,"Kilo Tray Crips"}, -- { 1882.97, 492.38, -0.56, 0, 0, 150,b13Water,"Criminals","nil", 180,"aGroup",nil,nil,nil,"Kilo Tray Crips"}, ------------------------------------------------------------------------------------------------ -- Pinoy's Pride -- { 876.99, 2071, 19.26, 0, 0, 0,pinoyVehs,"Criminals","nil",0,"aGroup",nil,nil,nil,"Pinoy Pride"}, -- { 884.3, 2071, 19.26, 0, 0, 0,pinoyVehs,"Criminals","nil",0,"aGroup",nil,nil,nil,"Pinoy Pride"}, -- { 891.48, 2071, 19.26, 0, 0, 0,pinoyVehs,"Criminals","nil",0,"aGroup",nil,nil,nil,"Pinoy Pride"}, -- { 881.68, 2174.96, 20.82, 0, 0, 0,pinoyAir,"Criminals","nil",90,"aGroup",nil,nil,nil,"Pinoy Pride"}, -- { 866.4, 2231.32, 19.08, 0, 0, 0,pinoyAir,"Criminals","nil",0,"aGroup",nil,nil,nil,"Pinoy Pride"}, ------------------------------------------------------------------------------------------------ -- Special Mafia -- { 3204.9, 2115.51, 13.13, 0, 0, 0,SpecialVehs,"Criminals","nil",90,"aGroup",nil,nil,nil,"Special Mafia"}, -- { 3204.76, 2124.52, 13.13, 0, 0, 0,SpecialVehs,"Criminals","nil",90,"aGroup",nil,nil,nil,"Special Mafia"}, -- { 3242.68, 2207.6, 13.11, 0, 0, 0,SpecialChoppers,"Criminals","nil",270,"aGroup",nil,nil,nil,"Special Mafia"}, -- { 3243.49, 2154.86, 12.94, 0, 0, 0,SpecialAir,"Criminals","nil",0,"aGroup",nil,nil,nil,"Special Mafia"}, ------------------------------------------------------------------------------------------------ --SAT -- { 302.75, 181.47, 27.03 ,0,0,255,satheli,"Government","nil",90,"aGroup",nil,nil,nil,"Special Assault Team"}, -- { 312.94, 169.47, 27.03 ,0,0,255,satheli,"Government","nil",270,"aGroup",nil,nil,nil,"Special Assault Team"}, -- { 309.86, 181.26, 5.62 ,0,0,255,satCars,"Government","nil",310,"aGroup",nil,nil,nil,"Special Assault Team"}, -- { 304.01, 188.22, 5.62 ,0,0,255,satCars,"Government","nil",310,"aGroup",nil,nil,nil,"Special Assault Team"}, -- { 278.75, 136.67, 6.14, 0, 0, 255,satAir,"Government","nil",40,"aGroup",nil,nil,nil,"Special Assault Team"}, -- { 239.36, 244.35, 0.17, 0, 0, 255,satwater,"Government","nil",90,"aGroup",nil,nil,nil,"Special Assault Team"}, ------------------------------------------------------------------------------------------------ --Job {2490.24, -2737.72, -0.56 , 255,255,0, fairyCaptain, "Civilian Workers", "Fairy Captain", 180, "aGroup",nil,nil,nil,nil }, } ------------------------------------------------------------------------------------------------- -------------- CHANGE ONLY STUFF BETWEEN THIS AND ABOVE ------------ -------------------------------------------------------------------- --SCRIPT-- local JobsToTables = { } local asdmarkers = {} local workingWithTable=false for i,v in pairs(vehicleMarkers) do if getPlayerTeam ( localPlayer ) then local overRide=false if v[8] ~= nil and v[8] == "Government" then if getTeamName(getPlayerTeam ( localPlayer )) == "Police" or getTeamName(getPlayerTeam ( localPlayer )) == "Government" or getTeamName(getPlayerTeam ( localPlayer )) == "GIGN" or getTeamName(getPlayerTeam ( localPlayer )) == "Military Forces" then -- overRide=true end end if overRide==false and getTeamName(getPlayerTeam ( localPlayer )) == v[8] and getElementData(localPlayer, "Occupation") == v[9] or getTeamName(getPlayerTeam ( localPlayer )) == v[8] and v[11] == "noOccupation" or getTeamName(getPlayerTeam ( localPlayer )) == v[8] and getElementData(localPlayer,"Group") == v[15] or getTeamName(getPlayerTeam ( localPlayer )) == v[11] or getTeamName(getPlayerTeam ( localPlayer )) == v[12] or v[8] == nil and v[9] == nil then elref = createMarker(v[1], v[2], v[3] -1, "cylinder", 2.2, v[4], v[5], v[6]) asdmarkers [elref ] = v[7] setElementData(elref, "freeVehiclesSpawnRotation", v[10]) setElementData(elref, "isMakerForFreeVehicles", true) if ( v[11] == "aGroup" ) then setElementData(elref, "groupMarkerName", v[15] ) end if ( v[11] == "aBusiness" ) then setElementData(elref, "businessMarkerName", v[15] ) end end end end local workingWith = {} local proWith = {} local modWith = {} local count = 0 HydraRow = 0 RustlerRow = 0 HunterRow = 0 SeasparrowRow = 0 RhinoRow = 0 addEventHandler("onClientMarkerHit", root, function(hitElement, matchingDimension) if getElementType ( hitElement ) == "player" and getElementData(source, "isMakerForFreeVehicles") == true and hitElement == localPlayer then guiGridListClear ( vehiclesGrid ) if not isPedInVehicle(localPlayer) then if (asdmarkers [source] ) then workingWithTable=asdmarkers [source] HydraRow = 0 RustlerRow = 0 HunterRow = 0 SeasparrowRow = 0 RhinoRow = 0 for i,v in pairs( asdmarkers [source] ) do if hitElement == localPlayer then if i then local px,py,pz = getElementPosition ( hitElement ) local mx, my, mz = getElementPosition ( source ) if ( pz-3 < mz ) and ( pz+3 > mz ) then if (( getElementData( source, "groupMarkerName" ) ) and ( getElementData( localPlayer, "Group" ) ~= "None" ) and not ( getElementData( source, "groupMarkerName" ) == getElementData( localPlayer, "Group" ) ) ) or ( getElementData( source, "businessMarkerName" ) ) and ( getElementData( localPlayer, "Business" ) ~= "None" ) and not ( getElementData( source, "businessMarkerName" ) == getElementData( localPlayer, "Business" ) ) then exports.NGCdxmsg:createNewDxMessage("You are not allowed to use this vehicle marker!", 225 ,0 ,0) else if (( getElementData( source, "groupMarkerName" ) ) and (getElementData(localPlayer, "Group") == "None")) or (( getElementData( source, "businessMarkerName" ) ) and (getElementData(localPlayer, "Business") == "None")) then exports.NGCdxmsg:createNewDxMessage("You are not allowed to use this vehicle marker!", 225 ,0 ,0) return end local row = guiGridListAddRow ( vehiclesGrid ) workingWith[tostring(v[1])] = tonumber(i) tbl = getOriginalHandling(i) guiGridListSetItemText ( vehiclesGrid, row, vehicleName, tostring(v[1]), false, false ) guiGridListSetItemData ( vehiclesGrid, row, vehicleName, tostring(i) ) guiGridListSetItemText ( vehiclesGrid, row, vehicleMaxV, tbl["maxVelocity"]-35, false, false ) guiGridListSetItemText ( vehiclesGrid, row, vehicleMaxP, getVehicleMaxPassengers(i), false, false ) if isVehicleAV(tonumber(i)) then if not row or row == 0 or row < 0 then local selectedVehicle = guiGridListGetItemText ( vehiclesGrid,0, 1 ) if selectedVehicle == getVehicleNameFromModel(i) then row = 0 end end guiGridListSetItemData(vehiclesGrid,row,vehicleMaxV,0) guiGridListSetItemColor( vehiclesGrid, row, 1, 225, 0, 0 ) --outputDebugString(count.." with "..row.." with "..i) if getVehicleNameFromModel(i) == "Hydra" then HydraRow = row elseif getVehicleNameFromModel(i) == "Rustler" then RustlerRow = row elseif getVehicleNameFromModel(i) == "Hunter" then HunterRow = row elseif getVehicleNameFromModel(i) == "Seasparrow" then SeasparrowRow = row elseif getVehicleNameFromModel(i) == "Rhino" then RhinoRow = row end triggerServerEvent("callGroupSpawnAccess",localPlayer) end guiSetVisible (vehiclesWindow, true) showCursor(true,true) theVehicleRoation = getElementData(source, "freeVehiclesSpawnRotation") theMarker = source end end end end end end end end end) addEvent("avList",true) addEventHandler("avList",root,function(t) -- if HydraRow == 0 and RustlerRow == 0 and HunterRow == 0 and SeasparrowRow == 0 and RhinoRow == 0 then return false end for k=1,#t do if t[k][1] == "Hydra" then if t[k][2] == 1 then local selectedVehicle = guiGridListGetItemText ( vehiclesGrid,HydraRow, 1 ) if selectedVehicle == t[k][1] then guiGridListSetItemColor( vehiclesGrid, HydraRow, 1, 0,225, 0 ) guiGridListSetItemData ( vehiclesGrid, HydraRow, vehicleMaxV, 1 ) end end elseif t[k][1] == "Rustler" then if t[k][2] == 1 then local selectedVehicle = guiGridListGetItemText ( vehiclesGrid,RustlerRow, 1 ) if selectedVehicle == t[k][1] then guiGridListSetItemColor( vehiclesGrid, RustlerRow, 1, 0,225, 0 ) guiGridListSetItemData ( vehiclesGrid, RustlerRow, vehicleMaxV, 1 ) end end elseif t[k][1] == "Hunter" then if t[k][2] == 1 then local selectedVehicle = guiGridListGetItemText ( vehiclesGrid,HunterRow, 1 ) if selectedVehicle == t[k][1] then guiGridListSetItemColor( vehiclesGrid, HunterRow, 1, 0,225, 0 ) guiGridListSetItemData ( vehiclesGrid, HunterRow, vehicleMaxV, 1 ) end end elseif t[k][1] == "Seasparrow" then if t[k][2] == 1 then local selectedVehicle = guiGridListGetItemText ( vehiclesGrid,SeasparrowRow, 1 ) if selectedVehicle == t[k][1] then outputDebugString(SeasparrowRow.." seasp") guiGridListSetItemColor( vehiclesGrid, SeasparrowRow, 1, 0,225, 0 ) guiGridListSetItemData ( vehiclesGrid, SeasparrowRow, vehicleMaxV, 1 ) end end elseif t[k][1] == "Rhino" then if t[k][2] == 1 then local selectedVehicle = guiGridListGetItemText ( vehiclesGrid,RhinoRow, 1 ) if selectedVehicle == t[k][1] then guiGridListSetItemColor( vehiclesGrid, RhinoRow, 1, 0,225, 0 ) guiGridListSetItemData ( vehiclesGrid, RhinoRow, vehicleMaxV, 1 ) end end end end end) function isVehicleAV(md) if tonumber(md) == 520 then return true elseif tonumber(md) == 476 then return true elseif tonumber(md) == 447 then return true elseif tonumber(md) == 432 then return true elseif tonumber(md) == 425 then return true else return false end end-- Reload the markers function reloadFreeVehicleMarkers () for i,v in pairs( asdmarkers ) do destroyElement(i) end asdmarkers = {} for i,v in pairs(vehicleMarkers) do if getTeamName(getPlayerTeam ( localPlayer )) == v[8] and getElementData(localPlayer, "Occupation") == v[9] or getTeamName(getPlayerTeam ( localPlayer )) == v[8] and v[11] == "noOccupation" or getTeamName(getPlayerTeam ( localPlayer )) == v[8] and getElementData(localPlayer,"Group") == v[15] or getTeamName(getPlayerTeam ( localPlayer )) == v[11] or getTeamName(getPlayerTeam ( localPlayer )) == v[12] or v[8] == nil and v[9] == nil or v[8] == "Military Forces" and getTeamName(getPlayerTeam(localPlayer)) == "Government" then elref = createMarker(v[1], v[2], v[3] -1, "cylinder", 2.2, v[4], v[5], v[6]) asdmarkers [elref ] = v[7] setElementData(elref, "freeVehiclesSpawnRotation", v[10]) setElementData(elref, "isMakerForFreeVehicles", true) if ( v[11] == "aGroup" ) then setElementData(elref, "groupMarkerName", v[15] ) end if ( v[11] == "aBusiness" ) then setElementData(elref, "businessMarkerName", v[15] ) end end end end addEvent("reloadFreeVehicleMarkers", true) addEventHandler("reloadFreeVehicleMarkers", root, reloadFreeVehicleMarkers ) function spawnTheVehicle () if getElementDimension(localPlayer) ~= 0 then return false end local x,y,z = getElementPosition(theMarker) local selectedVehicle = guiGridListGetItemText ( vehiclesGrid, guiGridListGetSelectedItem ( vehiclesGrid ), 1 ) if selectedVehicle == "" or selectedVehicle == " " then exports.NGCdxmsg:createNewDxMessage("You didnt select a vehicle!", 225 ,0 ,0) else local selectedRow, selectedColumn = guiGridListGetSelectedItem(vehiclesGrid) local theVehicleID = workingWith[tostring(selectedVehicle)] --local theVehicleID = tonumber(guiGridListGetItemData ( vehiclesGrid, selectedRow, selectedColumn )) local access = tonumber(guiGridListGetItemData ( vehiclesGrid, selectedRow,2 )) if access == 0 then exports.NGCdxmsg:createNewDxMessage("You don't have access to spawn this vehicle",255,0,0) return false end ---if ( tonumber( theVehicleID) == 481 ) or ( tonumber( theVehicleID) == 510 ) or ( tonumber( theVehicleID) == 509 ) or ( tonumber( theVehicleID) == 462 ) or ( getElementData( localPlayer, "Occupation" ) == "Drugs farmer" ) then if ( getElementData( localPlayer, "Occupation" ) == "Drugs farmer" ) then exports.NGCdxmsg:createNewDxMessage("You are drugs farmer! you can't spawn from here!!", 225 ,0 ,0) return false end if ( getElementData( localPlayer, "wantedPoints" ) >= 200 ) then exports.NGCdxmsg:createNewDxMessage("You can't spawn vehicles when you have more than 200 wanted points!", 225 ,0 ,0) return else local getTable = workingWithTable --JobsToTables[getElementData(localPlayer, "Occupation")] or JobsToTables[getTeamName(getPlayerTeam ( localPlayer ))] local vehicle,color1,color2,color3,color4 = getTable[theVehicleID][1],getTable[theVehicleID][2],getTable[theVehicleID][3],getTable[theVehicleID][4],getTable[theVehicleID][5]--unpack( getTable[tonumber( theVehicleID )] ) local r,g,b=nil,nil,nil local r2,g2,b2=nil,nil,nil if getTable[theVehicleID].r ~= nil then r,g,b=getTable[theVehicleID].r,getTable[theVehicleID].g,getTable[theVehicleID].b end if getTable[theVehicleID].r2 ~= nil then r2,g2,b2=getTable[theVehicleID].r2,getTable[theVehicleID].g2,getTable[theVehicleID].b2 end triggerServerEvent("spawnVehicleSystem", localPlayer, x, y, z, theVehicleID, color1, color2, color3, color4, theVehicleRoation,r,g,b,r2,g2,b2) guiSetVisible (vehiclesWindow, false) showCursor(false,false) guiGridListClear ( vehiclesGrid ) end end end addEventHandler("onClientGUIClick", spawnVehicleSystemButton, spawnTheVehicle, false) function doesPlayerHaveLiceForVehicle (vehicleID) local playtime = getElementData(localPlayer,"playTime") if getVehicleType ( vehicleID ) == "Automobile" or getVehicleType ( vehicleID ) == "Monster Truck" or getVehicleType ( vehicleID ) == "Quad" or getVehicleType ( vehicleID ) == "Trailer" then if playtime == false or playtime==nil then return true end if math.floor((tonumber(playtime)/60)) < 10 then return true end if getElementData(localPlayer, "carLicence") then return true else return false end elseif getVehicleType ( vehicleID ) == "Plane" then if getElementData(localPlayer, "planeLicence") then return true else return false end elseif getVehicleType ( vehicleID ) == "Helicopter" then if getElementData(localPlayer, "chopperLicence") then return true else return false end elseif getVehicleType ( vehicleID ) == "Bike" or getVehicleType ( vehicleID ) == "BMX" then if getElementData(localPlayer, "bikeLicence") then return true else return false end elseif getVehicleType ( vehicleID ) == "Boat" then if getElementData(localPlayer, "boatLicence") then return true else return false end end end --[[400: Landstalker 401: Bravura 402 : Buffalo 403 : Linerunner 404 : Perenail 405 : Sentinel 406 : Dumper 407 : Firetruck 408 : Trashmaster 409 : Stretch 410 : Manana 411 : Infernus 412 : Voodoo 413 : Pony 414 : Mule 415 : Cheetah 416 : Ambulance 417 : Levetian 418 : Moonbeam 419 : Esperanto 420 : Taxi 421 : Washington 422 : Bobcat 423 : Mr Whoopee 424 : BF Injection 425 : Hunter 426 : Premier 427 : Enforcer 428 : Securicar 429 : Banshee 430 : Predator 431 : Bus 432 : Rhino 433 : Barracks 434 : Hotknife 435 : Artic trailer 1 436 : Previon 437 : Coach 438 : Cabbie 439 : Stallion 440 : Rumpo 441 : RC Bandit 442 : Romero 443 : Packer 444 : Monster 445 : Admiral 446 : Squalo 447 : Seasparrow 448 : Pizza boy 449 : Tram 450 : Artic trailer 2 451 : Turismo 452 : Speeder 453 : Reefer 454 : Tropic 455 : Flatbed 456 : Yankee 457 : Caddy 458 : Solair 459 : Top fun 460 : Skimmer 461 : PCJ 600 462 : Faggio 463 : Freeway 464 : RC Baron 465 : RC Raider 466 : Glendale 467 : Oceanic 468 : Sanchez 469 : Sparrow 470 : Patriot 471 : Quad 472 : Coastgaurd 473 : Dinghy 474 : Hermes 475 : Sabre 476 : Rustler 477 : ZR 350 478 : Walton 479 : Regina 480 : Comet 481 : BMX 482 : Burriro 483 : Camper 484 : Marquis 485 : Baggage 486 : Dozer 487 : Maverick 488 : VCN Maverick 489 : Rancher 490 : FBI Rancher 491 : Virgo 492 : Greenwood 493 : Jetmax 494 : Hotring 495 : Sandking 496 : Blistac 497 : Government maverick 498 : Boxville 499 : Benson 500 : Mesa 501 : RC Goblin 502 : Hotring A 503 : Hotring B 504 : Blood ring banger 505 : Rancher (lure) 506 : Super GT 507 : Elegant 508 : Journey 509 : Bike 510 : Mountain bike 511 : Beagle 512 : Cropduster 513 : Stuntplane 514 : Petrol 515 : Roadtrain 516 : Nebula 517 : Majestic 518 : Buccaneer 519 : Shamal 520 : Hydra 521 : FCR 900 522 : NRG 500 523 : HPV 1000 524 : Cement 525 : Towtruck 526 : Fortune 527 : Cadrona 528 : FBI Truck 529 : Williard 530 : Fork lift 531 : Tractor 532 : Combine 533 : Feltzer 534 : Remington 535 : Slamvan 536 : Blade 537 : Freight 538 : Streak 539 : Vortex 540 : Vincent 541 : Bullet 542 : Clover 543 : Sadler 544 : Firetruck LA 545 : Hustler 546 : Intruder 547 : Primo 548 : Cargobob 549 : Tampa 550 : Sunrise 551 : Merit 552 : Utility van 553 : Nevada 554 : Yosemite 555 : Windsor 556 : Monster A 557 : Monster B 558 : Uranus 559 : Jester 560 : Sultan 561 : Stratum 562 : Elegy 563 : Raindance 564 : RC Tiger 565 : Flash 566 : Tahoma 567 : Savanna 568 : Bandito 569 : Freight flat 570 : Streak 571 : Kart 572 : Mower 573 : Duneride ID : Actual name 574 : Sweeper 575 : Broadway 576 : Tornado 577 : AT 400 578 : DFT 30 579 : Huntley 580 : Stafford 581 : BF 400 582 : News van 583 : Tug 584 : Petrol tanker 585 : Emperor 586 : Wayfarer 587 : Euros 588 : Hotdog 589 : Club 590 : Freight box 591 : Artic trailer 3 592 : Andromada 593 : Dodo 594 : RC Cam 595 : Launch 596 : Cop car LS 597 : Cop car SF 598 : Cop car LV 599 : Ranger 600 : Picador 601 : Swat tank 602 : Alpha 603 : Phoenix 604 : Glendale (damage) 605 : Sadler (damage) 606 : Bag box A 607 : Bag box B 608 : Stairs 609 : Boxville (black) 610 : Farm trailer 611 : Utility van trailer ]]
vim.g.vista_disable_statusline = 1 vim.g.vista_icon_indent = { "╰─▸ ", "├─▸ " } vim.g.vista_default_executive = 'nvim_lsp'
slot2 = "TrackManager" TrackManager = class(slot1) TRACK_HALL_GRZX = 10001 TRACK_HALL_YH = 10002 TRACK_HALL_CZ = 10003 TRACK_HALL_JB = 10004 TRACK_HALL_YYDB = 10005 TRACK_HALL_XYDZP = 10006 TRACK_HALL_KF = 10007 TRACK_HALL_XX = 10008 TRACK_HALL_PHB = 10009 TRACK_HALL_SZ = 10010 TRACK_HALL_PMD = 10011 TRACK_HALL_DH = 10012 TRACK_HALL_WZ = 10013 TRACK_HALL_JJJ = 10014 TRACK_MEMBER_BDYHK = 11001 TRACK_MEMBER_GGTX = 11002 TRACK_MEMBER_FZID = 11003 TRACK_MEMBER_BDSJ = 11004 TRACK_MEMBER_BDZFB = 11005 TRACK_BANKER_CQ = 12001 TRACK_BANKER_ZS = 12002 TRACK_BANKER_JL = 12003 TRACK_RECHARGE_ZFB = 13001 TRACK_RECHARGE_QQ = 13002 TRACK_RECHARGE_WX = 13003 TRACK_RECHARGE_YL = 13004 TRACK_RECHARGE_CZK = 13005 TRACK_RECHARGE_JD = 13006 TRACK_RECHARGE_PGNG = 13007 TRACK_RECHARGE_DLCZ = 13008 TRACK_REPORT_FZWXH = 14001 TRACK_YYDB_LJCJ = 15001 TRACK_XYDZP_CJ = 16001 TRACK_KEFU_CKCJWT = 17001 TRACK_KEFU_FK = 17002 TRACK_SETTING_XZCJMS = 18001 TRACK_SETTING_XZQHZH = 18002 TRACK_SETTING_XZYYSZ = 18003 TRACK_SETTING_XZYXSZ = 18004 TRACK_GAME_DNTG1 = 19001 TRACK_GAME_DNTG2 = 19002 TRACK_GAME_DDZ = 19003 TRACK_GAME_ZJH = 19004 TRACK_GAME_ERMJ = 19005 TRACK_GAME_HHDZ = 19006 TRACK_GAME_ERDN = 19007 TRACK_GAME_BRNN = 19008 TRACK_GAME_QZNN = 19009 TRACK_GAME_JDNN = 19010 TRACK_GAME_BJL = 19011 TRACK_EXCHANGE_GB = 11101 TRACK_EXCHANGE_ZFBDH = 11102 TRACK_EXCHANGE_YHKDH = 11103 TRACK_LOGIN_YKDL = 11201 TRACK_LOGIN_ZHDL = 11202 TRACK_LOGIN_KF = 11203 TRACK_HLDBZ_GB = 20001 TRACK_HLDBZ_QCZ = 20002 TRACK_HLDBZ_QYH = 20003 TRACK_JRYX_DNTG1_KSKS = 30001 TRACK_JRYX_DNTG1_DFJ = 30002 TRACK_JRYX_DNTG2_KSKS = 31001 TRACK_JRYX_DNTG2_DFJ = 31002 TRACK_JRYX_DDZ_KSKS = 32001 TRACK_JRYX_DDZ_DFJ = 32002 TRACK_JRYX_ZJH_KSKS = 33001 TRACK_JRYX_ZJH_DFJ = 33002 TRACK_JRYX_ERMJ_KSKS = 34001 TRACK_JRYX_ERMJ_DFJ = 34002 TRACK_JRYX_HHDZ_KSKS = 35001 TRACK_JRYX_HHDZ_DFJ = 35002 TRACK_JRYX_ERDN_KSKS = 36001 TRACK_JRYX_ERDN_DFJ = 36002 TRACK_JRYX_BRNN_KSKS = 37001 TRACK_JRYX_BRNN_DFJ = 37002 TRACK_JRYX_QZNN_KSKS = 38001 TRACK_JRYX_QZNN_DFJ = 38002 TRACK_JRYX_JDNN_KSKS = 39001 TRACK_JRYX_JDNN_DFJ = 39002 TRACK_JRYX_BJL_KSKS = 31101 TRACK_JRYX_BJL_DFJ = 31102 TRACK_TYC_POPUP_GB = 40001 TRACK_TYC_POPUP_QCZ = 40002 TRACK_TYC_POPUP_JXW = 40003 TRACK_GAME_HHDZ_XY = 50001 TRACK_GAME_HHDZ_SZ = 50002 TRACK_GAME_HHDZ_QZ = 50003 TRACK_GAME_HHDZ_QK = 50004 TRACK_GAME_BRNN_XY = 51001 TRACK_GAME_BRNN_SZ = 51002 TRACK_GAME_BRNN_QZ = 51003 TRACK_GAME_BRNN_QK = 51004 TRACK_GAME_BJL_XY = 52001 TRACK_GAME_BJL_SZ = 52002 TRACK_GAME_BJL_QZ = 52003 TRACK_GAME_BJL_QK = 52004 TRACK_GAME_DNTG1_ZDDP = 60001 TRACK_GAME_DNTG1_SD = 60002 TRACK_GAME_DNTG2_ZDDP = 70001 TRACK_GAME_DNTG2_SD = 70002 TRACK_GAME_DNTG2_BJS = 70003 TRACK_GAME_DNTG2_2BS = 70004 TRACK_GAME_DNTG2_4BJS = 70005 TRACK_SJB_GUESS = 80001 TRACK_SJB_MY_BET = 80002 TRACK_SJB_MATCH_OUTS = 80003 TRACK_SJB_MATCH_RESULT = 80004 TRACK_SJB_SHOWING_RULE = 80005 TRACK_SJB_SHOWING_BANK = 80006 TRACK_SJB_EXIT = 80007 TrackManager.ctor = function (slot0) slot4 = 300000 slot0.startTimer(slot2, slot0) end TrackManager.recordTracks = function (slot0, slot1) if not slot1 then return end slot0._tracksData = slot0._tracksData or {} if not slot0._tracksData[slot1] then slot0._tracksData[slot1] = { count = 1, trackId = slot1 } else slot0._tracksData[slot1].count = slot0._tracksData[slot1].count + 1 end end TrackManager.formatTracksData = function (slot0) if slot0._tracksData then slot1 = { userId = Hero.getDwUserID(slot3), machineCode = bridgeMgr.getPhoneUUId(slot3), deviceId = PACKAGE_DEVICE_TYPE } slot4 = Hero slot2 = {} slot5 = slot0._tracksData for slot6, slot7 in pairs(bridgeMgr) do slot10 = slot6 slot2[tostring(slot9)] = slot7.count end slot1.infos = slot2 return slot1 else return nil end end TrackManager.requestTrackInfoHttp = function (slot0) function slot1(slot0) slot0._tracksData = nil slot3 = "请求埋点成功返回" print(nil) slot3 = slot0 print_r(nil) end function slot2(slot0) slot3 = "请求埋点失败返回" print(slot2) slot3 = slot0 print_r(slot2) end function slot3() slot2 = "请求埋点超时返回" print(slot1) slot2 = data print_r(slot1) end slot7 = slot0.formatTracksData(slot5) if not TableUtil.isEmpty(slot0) then slot7 = TRACK_ACT_URL if StringUtil.isStringValid(slot6) then slot8 = slot4 slot9 = TRACK_ACT_URL print(slot7, "请求埋点的url和数据是") slot8 = { data = cjson.encode(slot7) } print_r(slot7) slot13 = true requestHttpSign4Php(slot7, TRACK_ACT_URL, , slot1, slot2, slot3) end end end TrackManager.startTimer = function (slot0, slot1) if not slot0._timer then slot4 = TRACK_ACT_URL if StringUtil.isStringValid(slot3) then slot8 = slot0.requestTrackInfoHttp slot7 = -1 slot0._timer = tickMgr.delayedCall(slot3, tickMgr, handler(slot6, slot0), slot1) end end end TrackManager.stopTimer = function (slot0) if slot0._timer then slot3 = slot0._timer slot0._timer.destroy(slot2) slot0._timer = nil end end trackMgr = TrackManager.new() return
-- Sand Monster by PilzAdam --The MIT License (MIT) (for sand monster) --Copyright (c) 2016 TenPlus1 (for sand monster) local S = mobs.intllib local dirt_types = { { nodes = {"ethereal:dry_dirt"}, skins = {"mobs_dirt_monster3.png"}, drops = { {name = "ethereal:dry_dirt", chance = 1, min = 0, max = 2}, {name = "alchemy:eye_of_earth",chance=23,min = 1, max = 3} } } } local tree_types = { { nodes = {"ethereal:sakura_leaves", "ethereal:sakura_leaves2"}, skins = {"mobs_tree_monster5.png"}, drops = { {name = "default:stick", chance = 1, min = 1, max = 3}, {name = "ethereal:sakura_leaves", chance = 1, min = 1, max = 2}, {name = "ethereal:sakura_trunk", chance = 2, min = 1, max = 2}, {name = "ethereal:sakura_tree_sapling", chance = 2, min = 0, max = 2}, {name = "alchemy:arboreal_tooth", chance = 30, min = 0, max = 1} } }, { nodes = {"ethereal:frost_leaves"}, skins = {"mobs_tree_monster3.png"}, drops = { {name = "default:stick", chance = 1, min = 1, max = 3}, {name = "ethereal:frost_leaves", chance = 1, min = 1, max = 2}, {name = "ethereal:frost_tree", chance = 2, min = 1, max = 2}, {name = "ethereal:crystal_spike", chance = 4, min = 0, max = 2}, {name = "alchemy:arboreal_tooth", chance = 30, min = 0, max = 1} } }, { nodes = {"ethereal:yellowleaves"}, skins = {"mobs_tree_monster4.png"}, drops = { {name = "default:stick", chance = 1, min = 1, max = 3}, {name = "ethereal:yellowleaves", chance = 1, min = 1, max = 2}, {name = "ethereal:yellow_tree_sapling", chance = 2, min = 0, max = 2}, {name = "ethereal:golden_apple", chance = 3, min = 0, max = 2}, {name = "alchemy:arboreal_tooth", chance = 30, min = 0, max = 1} } }, { nodes = {"default:acacia_bush_leaves"}, skins = {"mobs_tree_monster6.png"}, drops = { {name = "tnt:gunpowder", chance = 1, min = 0, max = 2}, {name = "default:iron_lump", chance = 5, min = 0, max = 2}, {name = "default:coal_lump", chance = 3, min = 0, max = 3}, {name = "alchemy:arboreal_tooth", chance = 30, min = 0, max = 1} }, explode = true }, } mobs:register_mob("alchemy:sand_monster", { type = "monster", passive = false, attack_type = "dogfight", pathfinding = true, --specific_attack = {"player", "mobs_npc:npc"}, --ignore_invisibility = true, reach = 2, damage = 1, hp_min = 4, hp_max = 20, armor = 100, collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4}, visual = "mesh", mesh = "mobs_sand_monster.b3d", textures = { {"mobs_sand_monster.png"}, {"mobs_sand_monster2.png"}, }, blood_texture = "default_desert_sand.png", makes_footstep_sound = true, sounds = { random = "mobs_sandmonster", }, walk_velocity = 1.5, run_velocity = 4, view_range = 8, --15 jump = true, floats = 0, drops = { {name = "default:dirt", chance = 1, min = 3, max = 5}, {name = "alchemy:eye_of_sand", chance = 20, min = 1, max = 3}, }, water_damage = 3, lava_damage = 4, light_damage = 0, fear_height = 4, animation = { speed_normal = 15, speed_run = 15, stand_start = 0, stand_end = 39, walk_start = 41, walk_end = 72, run_start = 74, run_end = 105, punch_start = 74, punch_end = 105, }, immune_to = { {"default:shovel_wood", 3}, -- shovels deal more damage to sand monster {"default:shovel_stone", 3}, {"default:shovel_bronze", 4}, {"default:shovel_steel", 4}, {"default:shovel_mese", 5}, {"default:shovel_diamond", 7}, }, --[[ custom_attack = function(self, p) local pos = self.object:get_pos() minetest.add_item(pos, "default:sand") end, ]] on_die = function(self, pos) pos.y = pos.y + 0.5 mobs:effect(pos, 30, "mobs_sand_particles.png", .1, 2, 3, 5) pos.y = pos.y + 0.25 mobs:effect(pos, 30, "mobs_sand_particles.png", .1, 2, 3, 5) end, --[[ on_rightclick = function(self, clicker) local tool = clicker:get_wielded_item() local name = clicker:get_player_name() if tool:get_name() == "default:sand" then self.owner = name self.type = "npc" mobs:force_capture(self, clicker) end end, ]] }) -- Dirt Monster by PilzAdam mobs:register_mob("alchemy:dirt_monster", { type = "monster", passive = false, attack_type = "dogfight", pathfinding = true, reach = 2, damage = 2, hp_min = 3, hp_max = 27, armor = 100, collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4}, visual = "mesh", mesh = "mobs_stone_monster.b3d", textures = { {"mobs_dirt_monster.png"}, {"mobs_dirt_monster2.png"}, }, blood_texture = "default_dirt.png", makes_footstep_sound = true, sounds = { random = "mobs_dirtmonster", }, view_range = 15, walk_velocity = 1, run_velocity = 3, jump = true, drops = { {name = "default:dirt", chance = 1, min = 0, max = 2}, {name = "alchemy:eye_of_earth", chance = 23, min = 1, max = 3} }, water_damage = 1, lava_damage = 5, light_damage = 3, fear_height = 4, animation = { speed_normal = 15, speed_run = 15, stand_start = 0, stand_end = 14, walk_start = 15, walk_end = 38, run_start = 40, run_end = 63, punch_start = 40, punch_end = 63, }, -- check surrounding nodes and spawn a specific monster on_spawn = function(self) local pos = self.object:get_pos() ; pos.y = pos.y - 1 local tmp for n = 1, #dirt_types do tmp = dirt_types[n] if minetest.find_node_near(pos, 1, tmp.nodes) then self.base_texture = tmp.skins self.object:set_properties({textures = tmp.skins}) if tmp.drops then self.drops = tmp.drops end return true end end return true -- run only once, false/nil runs every activation end }) mobs:register_mob("alchemy:tree_monster", { type = "monster", passive = false, attack_type = "dogfight", attack_animals = true, --specific_attack = {"player", "mobs_animal:chicken"}, reach = 2, damage = 2, hp_min = 20, hp_max = 40, armor = 100, collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4}, visual = "mesh", mesh = "mobs_tree_monster.b3d", textures = { {"mobs_tree_monster.png"}, {"mobs_tree_monster2.png"}, }, blood_texture = "default_wood.png", makes_footstep_sound = true, sounds = { random = "mobs_treemonster", }, walk_velocity = 1, run_velocity = 3, jump = true, view_range = 15, drops = { {name = "default:stick", chance = 1, min = 0, max = 2}, {name = "default:sapling", chance = 2, min = 0, max = 2}, {name = "default:junglesapling", chance = 3, min = 0, max = 2}, {name = "default:apple", chance = 4, min = 1, max = 2}, {name = "alchemy:arboreal_tooth", chance = 30, min = 0, max = 1} }, water_damage = 0, lava_damage = 0, light_damage = 2, fall_damage = 0, immune_to = { {"default:axe_wood", 0}, -- wooden axe doesnt hurt wooden monster {"default:axe_stone", 4}, -- axes deal more damage to tree monster {"default:axe_bronze", 5}, {"default:axe_steel", 5}, {"default:axe_mese", 7}, {"default:axe_diamond", 9}, {"default:sapling", -5}, -- default and jungle saplings heal {"default:junglesapling", -5}, -- {"all", 0}, -- only weapons on list deal damage }, animation = { speed_normal = 15, speed_run = 15, stand_start = 0, stand_end = 24, walk_start = 25, walk_end = 47, run_start = 48, run_end = 62, punch_start = 48, punch_end = 62, }, -- check surrounding nodes and spawn a specific tree monster on_spawn = function(self) local pos = self.object:get_pos() ; pos.y = pos.y - 1 local tmp for n = 1, #tree_types do tmp = tree_types[n] if tmp.explode and math.random(2) == 1 then return true end if minetest.find_node_near(pos, 1, tmp.nodes) then self.base_texture = tmp.skins self.object:set_properties({textures = tmp.skins}) if tmp.drops then self.drops = tmp.drops end if tmp.explode then self.attack_type = "explode" self.explosion_radius = 3 self.explosion_timer = 3 self.damage = 21 self.reach = 3 self.fear_height = 4 self.water_damage = 2 self.lava_damage = 15 self.light_damage = 0 self.makes_footstep_sound = false self.runaway_from = {"mobs_animal:kitten"} self.sounds = { attack = "tnt_ignite", explode = "tnt_explode", fuse = "tnt_ignite" } end return true end end return true -- run only once, false/nil runs every activation end }) -- Lava Flan by Zeg9 (additional textures by JurajVajda) mobs:register_mob("alchemy:lava_flan", { type = "monster", passive = false, attack_type = "dogfight", reach = 2, damage = 3, hp_min = 10, hp_max = 35, armor = 80, collisionbox = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5}, visual = "mesh", mesh = "zmobs_lava_flan.x", textures = { {"zmobs_lava_flan.png"}, {"zmobs_lava_flan2.png"}, {"zmobs_lava_flan3.png"}, }, blood_texture = "fire_basic_flame.png", makes_footstep_sound = false, sounds = { random = "mobs_lavaflan", war_cry = "mobs_lavaflan", }, walk_velocity = 0.5, run_velocity = 2, jump = true, view_range = 10, floats = 1, drops = { {name = "alchemy:essense_of_fire", chance = 10, min = 1, max = 1}, }, water_damage = 8, lava_damage = 0, fire_damage = 0, light_damage = 0, immune_to = { {"mobs:pick_lava", -2}, -- lava pick heals 2 health }, fly_in = {"default:lava_source", "default:lava_flowing"}, animation = { speed_normal = 15, speed_run = 15, stand_start = 0, stand_end = 8, walk_start = 10, walk_end = 18, run_start = 20, run_end = 28, punch_start = 20, punch_end = 28, }, on_die = function(self, pos) local cod = self.cause_of_death or {} local def = cod.node and minetest.registered_nodes[cod.node] if minetest.get_node(pos).name == "air" then minetest.set_node(pos, {name = "fire:basic_flame"}) end mobs:effect(pos, 40, "fire_basic_flame.png", 2, 3, 2, 5, 10, nil) self.object:remove() end, glow = 10, }) if not mobs.custom_spawn_monster then mobs:spawn({ name = "mobs_monster:dirt_monster", nodes = {"default:dirt_with_grass", "ethereal:gray_dirt", "ethereal:dry_dirt"}, min_light = 0, max_light = 7, chance = 6000, active_object_count = 2, min_height = 0, day_toggle = false, }) mobs:spawn({ name = "alchemy:sand_monster", nodes = {"default:desert_sand"}, chance = 7000, active_object_count = 2, min_height = 0, }) mobs:spawn({ name = "alchemy:tree_monster", nodes = {"group:leaves"}, --{"default:leaves", "default:jungleleaves"}, max_light = 7, chance = 7000, min_height = 0, day_toggle = false, }) mobs:spawn({ name = "alchemy:lava_flan", nodes = {"default:lava_source"}, chance = 1500, active_object_count = 1, max_height = 0, }) end mobs:register_egg("alchemy:sand_monster", S("Sand Monster"), "default_desert_sand.png", 1) mobs:register_egg("alchemy:tree_monster", S("Tree Monster"), "default_tree_top.png", 1) mobs:register_egg("alchemy:lava_flan", S("Lava Flan"), "default_lava.png", 1) mobs:register_egg("alchemy:dirt_monster", S("Dirt Monster"), "default_dirt.png", 1) --ironically removed alias for compatability ---thank you to TenPlus1 for this source code. Im sorry i pretty much ripped off your source, its only temporary ---until i am able to finish up my own custom mobs. Ive included the copyrite to the original code below. --- --- ---The MIT License (MIT) ---Copyright (c) 2016 TenPlus1 ---Permission is hereby granted, free of charge, to any person obtaining a copy ---of this software and associated documentation files (the "Software"), to deal ---in the Software without restriction, including without limitation the rights ---to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ---copies of the Software, and to permit persons to whom the Software is ---furnished to do so, subject to the following conditions: ---The above copyright notice and this permission notice shall be included in ---all copies or substantial portions of the Software. ---THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ---IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ---FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ---AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ---LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ---OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ---THE SOFTWARE. ---mobs.fireball.png was originally made by Sapier and edited by Benrob: -- Animals Mod by Sapier -- -- You may copy, use, modify or do nearly anything except removing this -- copyright notice. -- And of course you are NOT allow to pretend you have written it. -- -- (c) Sapier -- Contact sapier a t gmx net
--- a test module -- @module test local M = {} --- -- @tparam string a First argument -- @param[out] b Second argument -- @param[optional] c Third argument -- @return a -- @return b -- @return c function M.foo2(a, b, c) return a, b, c end return M
ra_options = {} SLASH_SAYRES1, SLASH_SAYRES2 = '/sayres', '/sr' function SlashCmdList.SAYRES(msg, editbox) local cmd, opt = strsplit(" ", msg) local chatformat_cmd = "|cFFFF8080rA |\124|cffffff55" local chatformat_info = "|cFFFF8080rA |\124|cffff0000" if cmd == "chat" then if opt == "0" then DEFAULT_CHAT_FRAME:AddMessage(chatformat_cmd.."Chat Output set to: |cff00ff00DYNAMIC") ra_options.chat = "0" elseif opt == "1" then DEFAULT_CHAT_FRAME:AddMessage(chatformat_cmd.."Chat Output set to: |cffff7d00RAID") ra_options.chat = "1" elseif opt == "2" then DEFAULT_CHAT_FRAME:AddMessage(chatformat_cmd.."Chat Output set to: |rSAY") ra_options.chat = "2" else DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."Unknown Chat Option") return end ra_options[cmd] = opt elseif msg == "help" or "" then if msg ~= "help" then DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."Unkown Command") DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."----") end DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."About:|cffffff55 Announces when you resurrect a player in your Raid/Party") DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."Usage:|cffffff55 /sayres {chat\124|help}") DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."chat {number}:|cffffff55 0, Dynamic (Party/Raid); 1, Party; 2, Say") DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."help:|cffffff55 Shows this message") return end end
object_tangible_deed_vehicle_deed_tcg_hk47_jetpack_deed = object_tangible_deed_vehicle_deed_shared_tcg_hk47_jetpack_deed:new { } ObjectTemplates:addTemplate(object_tangible_deed_vehicle_deed_tcg_hk47_jetpack_deed, "object/tangible/deed/vehicle_deed/tcg_hk47_jetpack_deed.iff")
vim.cmd"command! -bang -nargs=+ -range=0 -complete=file AsyncRun packadd asyncrun.vim | call asyncrun#run('<bang>', '', <q-args>, <count>, <line1>, <line2>)" vim.cmd"command! -bang -nargs=* Make AsyncRun<bang> -strip -post=copen -program=make <args>"