mirror of
https://github.com/spencershepard/RotorOps.git
synced 2025-11-10 15:45:30 +00:00
For users: -Added KA-50 III and AV8BNA Harrier to slot selection -Changed message in mission generated success dialog -Zone protect SAMs now part of 'Advanced Defenses' feature -Late activated friendly/enemy CAP units are placed in mission as a template for Deployed CAP fighters (ie will not be active unless using Advanced Defenses or 'DEPLOY_FIGHTERS' name for radar ground unit) -improve idle troop behavior at bases/FARPs For Mission creators: -Updated pydcs library supports new units such as technicals -Updated pydcs library supports Falklands map -allow troop pickup from HELO_CARRIER -enemy units with radar can be designated to deploy intercept fighters on detection (see RotorOps.fighter options in RotorOps.lua for details) with options for min detection altitude and distance (min detection altitude allows helis to fly 'under the radar') -Insert RotorOpsServer.lua script and trigger actions if option set in scenario config: rotorops_server: true -scenario template triggers should now be 'untouched' after mission generation, allowing previously unsupported triggers and actions to be used, along with color coding -block adding player helicopters if slots locked in scenario config -Added RotorOps.draw_conflict_zones setting to give users the ability to disable or enable displaying of zones on the map. -allow disabling spinboxes in scenario config -mission ends 10 mins after mission success/fail -copy helicopter start type from templates Internal: -github actions workflow to automatically deploy to update server -Startup version check will ignore micro version -bypassing triggers and merging before save (to preserve unsupported triggers in pydcs). Our goal is to leave the trigrules and trig from the source mission untouched -if using random weather, set ice halo to auto and crystals to none -dont put planes at airports without ILS (to avoid putting planes at helicopter airports ie. Syria) -improved guardPosition task -refactored 'coalition' variables to 'coal' to help prevent introducing errors in RotorOps.lua
69 lines
2.7 KiB
Lua
69 lines
2.7 KiB
Lua
RotorOpsServer = {}
|
|
RotorOpsServer.version = "0.3"
|
|
trigger.action.outText("ROTOROPS SERVER SCRIPT: "..RotorOpsServer.version, 5)
|
|
env.info("ROTOROPS SERVER SCRIPT STARTED: "..RotorOpsServer.version)
|
|
|
|
--For SpecialK's DCSServerBot
|
|
RotorOpsServer.dcsbot = {}
|
|
RotorOpsServer.dcsbot.enabled = true
|
|
RotorOpsServer.dcsbot.points = {}
|
|
RotorOpsServer.dcsbot.points.troop_drop = 6
|
|
RotorOpsServer.dcsbot.points.unpack = 5
|
|
RotorOpsServer.dcsbot.points.rearm_repair = 3
|
|
|
|
--Mission Ending
|
|
RotorOpsServer.time_to_end = 600
|
|
|
|
function RotorOpsServer.endMission(secs)
|
|
if secs then
|
|
RotorOpsServer.time_to_end = secs
|
|
end
|
|
|
|
local function countdown()
|
|
local minutes = math.floor(RotorOpsServer.time_to_end / 60)
|
|
local seconds = RotorOpsServer.time_to_end - (minutes * 60) --handle as string
|
|
if seconds < 10 then
|
|
seconds = "0" .. seconds
|
|
end
|
|
trigger.action.outText("RTB now. Mission will end in "..minutes..":"..seconds, 2, true)
|
|
RotorOpsServer.time_to_end = RotorOpsServer.time_to_end - 1
|
|
if RotorOpsServer.time_to_end <= 0 then
|
|
trigger.action.setUserFlag('mission_end', 2)
|
|
else
|
|
timer.scheduleFunction(countdown, {}, timer.getTime() + 1)
|
|
end
|
|
end
|
|
countdown()
|
|
end
|
|
|
|
function RotorOpsServer.registerCtldCallbacks()
|
|
ctld.addCallback(function(_args)
|
|
local action = _args.action
|
|
local unit = _args.unit
|
|
local picked_troops = _args.onboard
|
|
local dropped_troops = _args.unloaded
|
|
--env.info("ctld callback: ".. mist.utils.tableShow(_args))
|
|
|
|
local playername = unit:getPlayerName()
|
|
if RotorOpsServer.dcsbot.enabled and dcsbot and playername then
|
|
if action == "unload_troops_zone" or action == "dropped_troops" then
|
|
if RotorOps.isUnitInZone(unit, RotorOps.active_zone) then
|
|
env.info('RotorOpsServer: adding points (unload troops in active zone) for ' ..playername)
|
|
net.send_chat(playername .. " dropped troops into the active zone. [" .. RotorOpsServer.dcsbot.points.troop_drop .. " points]")
|
|
dcsbot.addUserPoints(playername, RotorOpsServer.dcsbot.points.troop_drop)
|
|
end
|
|
elseif action == "rearm" or action == "repair" then
|
|
env.info('RotorOpsServer: adding points (rearm/repair) for ' ..playername)
|
|
net.send_chat(playername .. " repaired/rearmed our defenses. [" .. RotorOpsServer.dcsbot.points.rearm_repair .. " points]")
|
|
dcsbot.addUserPoints(playername, RotorOpsServer.dcsbot.points.rearm_repair)
|
|
elseif action == "unpack" then
|
|
env.info('RotorOpsServer: adding points (unpack) for ' ..playername)
|
|
net.send_chat(playername .. " unpacked ground units. [" .. RotorOpsServer.dcsbot.points.unpack .. " points]")
|
|
dcsbot.addUserPoints(playername, RotorOpsServer.dcsbot.points.unpack)
|
|
end
|
|
end
|
|
end)
|
|
end
|
|
|
|
RotorOpsServer.registerCtldCallbacks()
|