Veteran66 Posted May 9, 2021 Posted May 9, 2021 Hi all i need a "Unit in Zone Scripts" (no MIST or MOOSE) Zone1 + ZoneA + Flag1 = Flag100 after Flag100, Zone1 and ZoneA are active again. so i can make a Coordinate grid with the new quard Trigger Zones, after send a F10 Call (Flag1) and the player plane is in Zone1 and ZoneA it fire a position Radio message German WW2 Radio calls Mod: https://www.digitalcombatsimulator.com/en/files/2161798/
Veteran66 Posted August 1, 2021 Author Posted August 1, 2021 hi all i find this script, it work fine for "Player", how i can add "Groups with Name"? -- Advanced Tools for Mission Editor -- Generic Areas sound module local thisModule local moduleName = "SoundInAreas" -- Sound player of area, can be a blanck sound file (no noise, but here squelsh) -- if duration <= 0 just played once -- Necessary local outOfArea = { file = "squelsh.ogg", duration = -1, } -- List of sounds one per area, indexed by dcs zone name (in that mission Z1 and Z2) -- if duration <= 0 just played once local myAreas = { ["Z1"] = { file = "fifteen.ogg", duration = 2, }, ["Z2"] = { file = "thousand.ogg", duration = 2, }, } local function outOfAreaPlay(player) if outOfArea.duration > 0 then player:soundStart(outOfArea.file, outOfArea.duration) else player:soundStop() player:soundOnce(outOfArea.file) end end local function onTimer(events) for _id, _ in events:pairs() do if events:isCoreEvent(_id) == true then local typeEvent = events:getCoreEventType(_id) if typeEvent == "AREA_AIRCRAFT_ENTERS" then local datas = events:getCoreEventDatas(_id) if myAreas[datas.area:getName()].duration > 0 then datas.unit:soundStart(myAreas[datas.area:getName()].file, myAreas[datas.area:getName()].duration) else datas.unit:soundStop() datas.unit:soundOnce(myAreas[datas.area:getName()].file) end elseif typeEvent == "AREA_AIRCRAFT_LEAVES" then local datas = events:getCoreEventDatas(_id) outOfAreaPlay(datas.unit) end end end end local function onCreatePlayer(player) -- Add tracking to new player local found = false for _zoneName, _myArea in pairs(myAreas) do _myArea.area:setAircraftTracking(player) if player:isInArea(_myArea.area) == true then found = true end end if found == false then outOfAreaPlay(player) end end local function onStart(areUnitsAndPlayersInitialized) if areUnitsAndPlayersInitialized == false then for _zoneName, _myArea in pairs(myAreas) do if ATME.getDCSZone(_zoneName) ~= nil then _myArea.area = thisModule:createNamedArea(_zoneName) _myArea.area:add(_zoneName) end end end end -- MAIN do local newHandlers = { onCreatePlayerHandler = onCreatePlayer, onDeletePlayerHandler = nil, onUpdatePlayerHandler = nil, onTakeoffPlayerHandler = nil, onLandingPlayerHandler = nil, onStartEnginePlayerHandler = nil, onStopEnginePlayerHandler = nil, onCreateAIUnitHandler = nil, onDeleteAIUnitHandler = nil, onDisableAIUnitHandler = nil, onTakeoffAIUnitHandler = nil, onLandingAIUnitHandler = nil, onStartEngineAIUnitHandler = nil, onStopEngineAIUnitHandler = nil, onCreateGroupHandler = nil, onDeleteGroupHandler = nil, onDisableGroupHandler = nil, onCreateStaticObjectHandler = nil, onDeleteStaticObjectHandler = nil, onTimerHandler = onTimer, onModuleStartHandler = onStart, } thisModule = ATME.C_Module(moduleName, newHandlers, true) end Link: German WW2 Radio calls Mod: https://www.digitalcombatsimulator.com/en/files/2161798/
Recommended Posts