Jump to content

Recommended Posts

Posted

I have been in a couple of servers where they have audio like "FOX One" when you fire off an AIM 7 or FOX TWO for AIM 9. I have been trying to get it to work and I have an audio file from a F14 shooting down mig-23's. I can get it to work only if I set the trigger to once or repeat and then set Event to on shot. That works but it works with anything you shoot like the gun. I also could only get the "Good Kill" audio file to play if the event is set for on crash. Nothing else seems to work. I am a total noob to this and am just feeling around in the dark right now.

 

Any help would great. I would like to make a fun mission for the guys I fly with and have more atmosphere in the game to make it feel more real.

System Specs: 13900K, Strix Z790 Gaming E, MSI 4090 Sprim Liquid X  OC'd, 64gb Gskill Trident Z DDR5, Samsung 980 PRO M.2 SSD,. Winwing throttle, Winwing panels/MIPs and VKB GF3/MCGU stick, MFG Crosswind V2, HP REVERB G2.

 

 

Posted

You can create a large trigger zone that covers the whole engagement area and then use the MISSILE IN ZONE condition, for detecting the specific missiles you want.

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar

Mobile: iPad Pro 12.9" of 256 GB

Posted
You can create a large trigger zone that covers the whole engagement area and then use the MISSILE IN ZONE condition, for detecting the specific missiles you want.

 

I did make a giant trigger zone and then I did use that missile in zone. The issue was if I put no event then it just loops and never stops the audio. If I put On Shot then it works for any missile and the gun.

System Specs: 13900K, Strix Z790 Gaming E, MSI 4090 Sprim Liquid X  OC'd, 64gb Gskill Trident Z DDR5, Samsung 980 PRO M.2 SSD,. Winwing throttle, Winwing panels/MIPs and VKB GF3/MCGU stick, MFG Crosswind V2, HP REVERB G2.

 

 

Posted

I'm not sure I understand but I have a trigger for what it seems to me that you want to achieve ..

EventHandler = {}
function EventHandler:onEvent(event)
if event.id == world.event.S_EVENT_SHOT and event.initiator == Unit.getByName('Player') then
local arma = event.weapon:getDesc().guidance
local categoria = event.weapon:getDesc().category
if arma == 4 then
trigger.action.outTextForCoalition(coalition.side.BLUE, "FOX 1", 8)
trigger.action.outSoundForCoalition(coalition.side.BLUE, 'radio click.ogg')
end
if arma == 2 then
trigger.action.outTextForCoalition(coalition.side.BLUE, "FOX 2", 8)
trigger.action.outSoundForCoalition(coalition.side.BLUE, 'radio click.ogg')
end
if arma == 3 then
trigger.action.outTextForCoalition(coalition.side.BLUE, "FOX 3", 8)
trigger.action.outSoundForCoalition(coalition.side.BLUE, 'radio click.ogg')
end
if categoria == 3 then
trigger.action.outTextForCoalition(coalition.side.BLUE, "PICKLE", 8)
trigger.action.outSoundForCoalition(coalition.side.BLUE, 'radio click.ogg')
end		
 end
end
world.addEventHandler(EventHandler)

  • Like 1

PC: i7-13700K - Gigabyte RTX 5080 GAMING OC - 64GB DDR5 6400 - VPC MongoosT-50CM3 - VKB GF pro - MFG Crosswind - Msi MPG321UR-QD + LG OLED 32GS95UE - TrackIR5 - Quest 3

Posted

Well I am trying to get audio to play to only my group or coalition when a specific type of missile is launched. Then get another audio clip I have to play when the enemy plane is hit by any missile or weapon.

 

I am not sure how I would use your script to work for me. Do I have to make a .lua file first and I assume I would also need the correct audio file for each of your triggers.

System Specs: 13900K, Strix Z790 Gaming E, MSI 4090 Sprim Liquid X  OC'd, 64gb Gskill Trident Z DDR5, Samsung 980 PRO M.2 SSD,. Winwing throttle, Winwing panels/MIPs and VKB GF3/MCGU stick, MFG Crosswind V2, HP REVERB G2.

 

 

Posted (edited)
Well I am trying to get audio to play to only my group or coalition when a specific type of missile is launched. Then get another audio clip I have to play when the enemy plane is hit by any missile or weapon.

 

I am not sure how I would use your script to work for me. Do I have to make a .lua file first and I assume I would also need the correct audio file for each of your triggers.

 

I cant try the script at the moment but you can try:

Trigger: once time more do script:

In red the group name

EventHandler = {}
function EventHandler:onEvent(event)
 if event.id == world.event.S_EVENT_SHOT then 
local TGroup = Group.getByName('[color="Red"]PlayerGroup[/color]')
local TGroupid = TGroup:getID()
local unit = event.initiator               
   if unit and unit:getGroup(TGroup) then                      
	local arma = event.weapon:getDesc().guidance
	local categoria = event.weapon:getDesc().category
	if arma == 4 then
	trigger.action.outTextForGroup(TGroupid, "FOX 1", 8)
	end
	if arma == 2 then
	trigger.action.outTextForGroup(TGroupid, "FOX 2", 8)
	end
	if arma == 3 then
	trigger.action.outTextForGroup(TGroupid, "FOX 3", 8)
	end
	if categoria == 3 then
	trigger.action.outTextForGroup(TGroupid, "PICKLE", 8)
end		
  end
 end
end
world.addEventHandler(EventHandler)

 

Forgot sound file add: trigger.action.outSoundForGroup(TGroupid, "soundfile.ogg" )

Edited by Majinbot
Forgot sound file

PC: i7-13700K - Gigabyte RTX 5080 GAMING OC - 64GB DDR5 6400 - VPC MongoosT-50CM3 - VKB GF pro - MFG Crosswind - Msi MPG321UR-QD + LG OLED 32GS95UE - TrackIR5 - Quest 3

Posted (edited)
I cant try the script at the moment but you can try:

Trigger: once time more do script:

In red the group name

EventHandler = {}
function EventHandler:onEvent(event)
 if event.id == world.event.S_EVENT_SHOT then 
local TGroup = Group.getByName('[color="Red"]PlayerGroup[/color]')
local TGroupid = TGroup:getID()
local unit = event.initiator               
   if unit and unit:getGroup(TGroup) then                      
	local arma = event.weapon:getDesc().guidance
	local categoria = event.weapon:getDesc().category
	if arma == 4 then
	trigger.action.outTextForGroup(TGroupid, "FOX 1", 8)
	end
	if arma == 2 then
	trigger.action.outTextForGroup(TGroupid, "FOX 2", 8)
	end
	if arma == 3 then
	trigger.action.outTextForGroup(TGroupid, "FOX 3", 8)
	end
	if categoria == 3 then
	trigger.action.outTextForGroup(TGroupid, "PICKLE", 8)
end		
  end
 end
end
world.addEventHandler(EventHandler)

 

 

Yes that worked for text message, thank you much. How would I go about adding the audio though for each Fox call? I have just one clip for Fox 1 so far. If I add the sound string you suggessted and use the name of the sound file I have in there it doesnt know where to find it I guess. Where do I have to place my sound file so the code string will locate it and play it?

Edited by BMGZ06

System Specs: 13900K, Strix Z790 Gaming E, MSI 4090 Sprim Liquid X  OC'd, 64gb Gskill Trident Z DDR5, Samsung 980 PRO M.2 SSD,. Winwing throttle, Winwing panels/MIPs and VKB GF3/MCGU stick, MFG Crosswind V2, HP REVERB G2.

 

 

Posted
Yes that worked for text message, thank you much. How would I go about adding the audio though for each Fox call? I have just one clip for Fox 1 so far.

 

I forgot to add the sound files, you have to add under every trigger text:

trigger.action.outSoundForGroup(TGroupid, "soundfile.ogg" )

PC: i7-13700K - Gigabyte RTX 5080 GAMING OC - 64GB DDR5 6400 - VPC MongoosT-50CM3 - VKB GF pro - MFG Crosswind - Msi MPG321UR-QD + LG OLED 32GS95UE - TrackIR5 - Quest 3

Posted

Ok if I do that how is going to find the sound file though? I entered the string you posted with the name of the sound file on my PC and I place the sound file where so the code will work with it? I am not seeing how the mission editor will know where to look for it.

System Specs: 13900K, Strix Z790 Gaming E, MSI 4090 Sprim Liquid X  OC'd, 64gb Gskill Trident Z DDR5, Samsung 980 PRO M.2 SSD,. Winwing throttle, Winwing panels/MIPs and VKB GF3/MCGU stick, MFG Crosswind V2, HP REVERB G2.

 

 

Posted

To get that sound file to play, you need to add it into the mission... Set a sound file to play as an action for a flag that will never fire. See example photo below.

 

Flag 6666 is not part of my mission, it will never ever fire. But by adding the sound file this way, you add it into your mission file, and can be played via script after it's been added.

ADDSOUND.thumb.jpg.e44a1ee8d203b691077964d08dedb7ec.jpg

Posted

That works like a charm. Now I just need to find sound files for Fo2 and 3. Also need to figure out how to code the missile hit on the enemy for the sound file to play just for the enemy plane and not any plane that gets hit.

System Specs: 13900K, Strix Z790 Gaming E, MSI 4090 Sprim Liquid X  OC'd, 64gb Gskill Trident Z DDR5, Samsung 980 PRO M.2 SSD,. Winwing throttle, Winwing panels/MIPs and VKB GF3/MCGU stick, MFG Crosswind V2, HP REVERB G2.

 

 

Posted
That works like a charm. Now I just need to find sound files for Fo2 and 3. Also need to figure out how to code the missile hit on the enemy for the sound file to play just for the enemy plane and not any plane that gets hit.

 

In that case you can use the event hit, but I don't know if it works with clients I read somewhere that it is buggy and it only works in singleplayer.

 

...if event.id == world.event.S_EVENT_HIT then
...if event.target == Unit.getByName('[color="Red"]enemy plane name[/color]') then
........

PC: i7-13700K - Gigabyte RTX 5080 GAMING OC - 64GB DDR5 6400 - VPC MongoosT-50CM3 - VKB GF pro - MFG Crosswind - Msi MPG321UR-QD + LG OLED 32GS95UE - TrackIR5 - Quest 3

  • Recently Browsing   0 members

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