Ravenfield

Ravenfield

62 ratings
Capture Point Sounds
   
Award
Favorite
Favorited
Unfavorite
Content Type: Mutators
File Size
Posted
Updated
297.623 KB
7 Oct, 2023 @ 10:20pm
7 Oct, 2023 @ 10:49pm
2 Change Notes ( view )

Subscribe to download
Capture Point Sounds

Description
Adds sounds when a point is captured, entered or exited. Sounds are from Rising Storm 2: Vietnam


Works in RavenM!


Best paired with the Capture Point UI mutator: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3071478132


Source code:

behaviour("CapturePointSounds")

local instance

function CapturePointSounds:Start()
instance = self

self.volume = self.script.mutator.GetConfigurationRange("volume")

self.enterSound = self.targets.enterSound
self.exitSound = self.targets.exitSound
self.pointWon = self.targets.pointWon
self.pointLost = self.targets.pointLost

self.player = Player.actor
self.inPoint = false
self.outOfPoint = true

self.targets.AudioSource.SetOutputAudioMixer(AudioMixer.FirstPerson)
local vol = self.volume / 100;
self.targets.AudioSource.volume = vol

GameEvents.onCapturePointCaptured.AddListener(self, "OnCapturePointCaptured")

print("Capture Point Sounds Active - have fun!")
end

function CapturePointSounds:Update()
if self.player ~= nil then
currentCapturePoint = self.player.currentCapturePoint
if currentCapturePoint ~= nil then
if not self.inPoint then
-- Entered point
self.inPoint = true
self.outOfPoint = false
self.targets.AudioSource.PlayOneShot(self.enterSound)
end
else
-- Left point
self.inPoint = false
if self.outOfPoint == false then
self.outOfPoint = true
self.targets.AudioSource.PlayOneShot(self.exitSound)
end
end
end
end

function CapturePointSounds:OnCapturePointCaptured(capturePoint, team)
if team == self.player.team then
self.targets.AudioSource.PlayOneShot(self.pointWon)
else
self.targets.AudioSource.PlayOneShot(self.pointLost)
end
end
7 Comments
Joyous 13 Oct, 2023 @ 1:12am 
make this with the vine boom
Lithuanian Dude 11 Oct, 2023 @ 3:35pm 
Unix out with another banger
Lmao Zebong 11 Oct, 2023 @ 5:07am 
Can you make this but with tf2 sfx?
Niko226 9 Oct, 2023 @ 12:51pm 
sigma
[TBL] Whizzbang 9 Oct, 2023 @ 10:41am 
atack the d point 🗣️🔥
Titanus 8 Oct, 2023 @ 10:27am 
Noice
bluedream 8 Oct, 2023 @ 2:12am 
cooooooollll