Jump to content

Ambient/ Environmental Sound e.g. Siren at location


-Painter-

Recommended Posts

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]

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by sunski34
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by BaD CrC
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...