-Painter- Posted March 28, 2017 Posted March 28, 2017 Hello everybody, is there any way to play an environmental sound effect at a certain location? E.g. play sound "air raid siren" at an specific location (e.g. airfield, city, farp, unit, etc.) if hostile aircraft is in zone? The sound I have in mind is not an sound you hear over the radio comms, but an sound of the environment at a fixed location. Regards REAPER 31 | Painter [sIGPIC][/sIGPIC]
Isegrim Posted March 28, 2017 Posted March 28, 2017 Hello everybody, is there any way to play an environmental sound effect at a certain location? E.g. play sound "air raid siren" at an specific location (e.g. airfield, city, farp, unit, etc.) if hostile aircraft is in zone? The sound I have in mind is not an sound you hear over the radio comms, but an sound of the environment at a fixed location. Asked for this Years ago its only possible via script. "Blyat Naaaaa" - Izlom
BaD CrC Posted March 28, 2017 Posted March 28, 2017 Available with ATME here. I was so excited about it but this tool is so advanced that I couldn't make any sense of it even with all the doc. I am not really a computer guy. Would love to see some day a simple script that I can integrate into my missions to have ambiant sounds.:cry: https://www.blacksharkden.com http://discord.gg/blacksharkden
Chump Posted March 28, 2017 Posted March 28, 2017 ATME uses trigger.action.outSoundForGroup(). I would love it if we could put ambient sounds in the actual world instead of over the radio.
sunski34 Posted March 30, 2017 Posted March 30, 2017 (edited) Hi, ATME uses trigger.action.outSoundForGroup(). I would love it if we could put ambient sounds in the actual world instead of over the radio. Yes but trigger.action.outSoundForGroup is for real sounds, not sounds over radio. ATME can send messages over radio too but it's another function. One of my friend made a mission with birds on floor and traffic radio messages when in air. That works fine. You can create playlist too. Another guy made a misson with differents sounds depending on context. I was so excited about it but this tool is so advanced that I couldn't make any sense of it even with all the doc. I am not really a computer guy. Would love to see some day a simple script that I can integrate into my missions to have ambiant sounds. ATME can be used with only few functions and basics approach. But of course you have to know basics of lua and have to understand ATME basic approach. The biggest advantage of ATME is its multiplayer simple management : Player enters a mission : module function assigned to onCreatePlayerHandler is called by ATME Player changes slot : module function assigned to onDeletePlayerHandler then onCreatePlayerHandler are called by ATME Player is dead : module function assigned to onDeletePlayerHandler is called by ATME For a regular update (1 per second) : module function assigned to onUpdatePlayerHandler is called by ATME To assign a function to an handler you just have to replace nil by function name like in this example : (see line with onCreatePlayerHandler = onCreatePlayer), onCreatePlayer is the module function. -- Advanced Tools for Mission Editor local thisModule local function onCreatePlayer(player) player:display("Hello World ... " .. player:getPseudo(), 10) 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, onSpawnGroupHandler = nil, onDeleteGroupHandler = nil, onDisableGroupHandler = nil, onCreateStaticObjectHandler = nil, onDeleteStaticObjectHandler = nil, onTimerHandler = nil, onModuleStartHandler = nil, } thisModule = ATME.C_Module("HelloWorld", newHandlers, true) end In that example, the only specific function is : local function onCreatePlayer(player) player:display("Hello World ... " .. player:getPseudo(), 10) end So if you want to use only onUpdatePlayerHandler (update every second), replace handlers initialisation with : ... onCreatePlayerHandler = nil, onDeletePlayerHandler = nil, onUpdatePlayerHandler = onUpdatePlayer, ... then rename specific function local function onCreatePlayer(player) into : local function onUpdatePlayer(player) than each second, for each player, a new message is display for 10 seconds Then, if you replace ATME display function by a sound function , and add a sound file in your mission with the mission editor and triggers you can have your first sound. You can use or add : player:soundOnce("myfile.ogg") so your function becomes : local function onUpdatePlayerPlayer(player) player:display("Hello World ... " .. player:getPseudo(), 10) player:soundOnce("myFile.ogg") end where myFile.ogg is the sound file (replace name with your file name). Of course, in that case, be sure that play duration is less than 1 second ;) This is a first simple approach. See documentation to have informations about the trigger creation to start ATME in ME. You just have to load ATME_CoreV111.lua file script first, then this lua file script and your sound ogg file (associate to country Urkraine if you don't use it in your mission, another country not used is good too), then add and enter ATME.run("EN") in execute script trigger in ME. ATME have modules approach, so you've right, a way can be the creation of a generic sounds module like rescue exists to embark/disembark troops. I know that english documentation isn't very clear sometimes and I work on it. I have to add more examples and videos with a logic of progress. If you want informations about ATME or help, ask me. Sunski Edited March 30, 2017 by sunski34
BaD CrC Posted March 30, 2017 Posted March 30, 2017 Thanks Sunski. No worry about the English doc as I can read French too. I am pretty sure ATME is awesome, it's just that I have very poor capabilities to understand the whole ATME approach. I am comfortable with Lua as along as it consists in loading a lua module at mission start and calling a function in the trigger panel of the ME. Like, "play_ambient_sound("sound.ogg","name of trigger zone") and nothing more. https://www.blacksharkden.com http://discord.gg/blacksharkden
sunski34 Posted March 30, 2017 Posted March 30, 2017 Ok, here is a little mission and its script. Birds when on floor, squelsh when take off. As you see in lua file, just 6 lines of code, and sound of birds are repeated every 85s. Sunski.ATME_module1a.mizATME_HelloWorld.lua
BaD CrC Posted March 31, 2017 Posted March 31, 2017 (edited) Thanks Sunski34. So I started to study how you did that. I am just starting to see some light, but I am still far from programing myself. Sounds in your user module are triggered on take off and on landing, no matter where you are on the map. On the other hand, your pal snowsniper created an ambiant sounds user module that takes into account the zones to trigger different sounds, but he added those playlists to play randomly anytime anywhere. So it becomes much more complicated when I tried to make sense of his work. I still can't find a way to simply trigger a given sound when in a specific trigger zone because your user module is working but it's a bit too simplistic, and the one created by snowsniper is way too complicated for me, and I don't want this random radio chatter. Can you help? I just would like to have a user module where I can edit the trigger zones names and the associated sound files. Then load the ATME.core, this ATME user module, run the whole stuff and have my ambient sounds for each given zone. Sorry for being so helpless with this. Edited March 31, 2017 by BaD CrC https://www.blacksharkden.com http://discord.gg/blacksharkden
sunski34 Posted March 31, 2017 Posted March 31, 2017 Hi, I understand... I will send you a such a module and write in comments where to modify. Regards Sunski
sunski34 Posted April 1, 2017 Posted April 1, 2017 Hi, sorry I worked on new version of ATME... As promise, the lua example and the mission. https://forums.eagle.ru/showpost.php?p=3098546&postcount=64 Sunski 2
BaD CrC Posted April 2, 2017 Posted April 2, 2017 sunski34, you are my hero. Rep inbound. https://www.blacksharkden.com http://discord.gg/blacksharkden
Recommended Posts