VE Lua Documentation

Press F to search!

playSoundOnceAtNode

Definition


-- @/lua/vehicle/sounds.lua:162

local function playSoundOnceAtNode(soundName, nodeID, volume, pitch, color, texture)
  pitch = pitch or 1
  if volume >= 0.01 and pitch >= 0.0039 then
    obj:playSFXOnceStaticCT(soundName, nodeID, volume, pitch, color or 0, texture or 0)
  end
end

Callers

@/lua/vehicle/controller/esc.lua
local function toggleESCMode()
  --sounds.playSoundOnceAtNode("event:>fabian_test", 0, 1)
  local key = currentESCConfigurationKey + 1
@/lua/vehicle/sounds.lua
    -- volume = linearScale(volume,0.25,0.95,0,1)
    -- sounds.playSoundOnceAtNode("event:>Vehicle>Interior>Rattles>car>multi_test", 0, volume)
    -- print (volume)
        local kickupVolume = min(1, wheelPeripherySpeedKickup * 0.01 * wheelSound.tirePropertiesKickup)
        playSoundOnceAtNode("event:>Surfaces>kickup_asphalt", wd.node1, kickupVolume * wd.tireSoundVolumeCoef, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, 1)
        wheelSound.looseSurfaceKickupLimit = randomGauss3() * 8 / wheelSound.tirePropertiesKickup
        local kickupVolume = min(1, wheelPeripherySpeedKickup * 0.002 * wheelSound.tirePropertiesKickup)
        playSoundOnceAtNode("event:>Surfaces>kickup_dirt", wd.node1, kickupVolume * wd.tireSoundVolumeCoef, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, 1)
        wheelSound.looseSurfaceKickupLimit = randomGauss3() * 8 / wheelSound.tirePropertiesKickup
        local kickupVolume = min(1, wheelPeripherySpeedKickup * 0.002 * wheelSound.tirePropertiesKickup)
        playSoundOnceAtNode("event:>Surfaces>kickup_dirtDusty", wd.node1, kickupVolume * wd.tireSoundVolumeCoef, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, 1)
        wheelSound.looseSurfaceKickupLimit = wheelSound.looseSurfaceKickupLimit + randomGauss3() * 20 / wheelSound.tirePropertiesKickup
        local kickupVolume = min(1, wheelPeripherySpeedKickup * 0.0024 * wheelSound.tirePropertiesKickup)
        playSoundOnceAtNode("event:>Surfaces>kickup_grass", wd.node1, kickupVolume * wd.tireSoundVolumeCoef, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, 1)
        wheelSound.looseSurfaceKickupLimit = randomGauss3() * 12 / wheelSound.tirePropertiesKickup
        local kickupVolume = min(1, wheelPeripherySpeedKickup * 0.0003 * wheelSound.tirePropertiesKickup)
        playSoundOnceAtNode("event:>Surfaces>kickup_gravel", wd.node1, kickupVolume * wd.tireSoundVolumeCoef, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, 1)
        wheelSound.looseSurfaceKickupLimit = wheelSound.looseSurfaceKickupLimit + randomGauss3() * 16 / wheelSound.tirePropertiesKickup
        local kickupVolume = min(1, wheelPeripherySpeedKickup * 0.0024 * wheelSound.tirePropertiesKickup)
        playSoundOnceAtNode("event:>Surfaces>kickup_mud", wd.node1, kickupVolume * wd.tireSoundVolumeCoef, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, 1)
        wheelSound.looseSurfaceKickupLimit = randomGauss3() * 8 / wheelSound.tirePropertiesKickup
        local kickupVolume = min(1, wheelPeripherySpeedKickup * 0.0024 * wheelSound.tirePropertiesKickup)
        playSoundOnceAtNode("event:>Surfaces>kickup_rock", wd.node1, kickupVolume * wd.tireSoundVolumeCoef, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, 1)
        wheelSound.looseSurfaceKickupLimit = randomGauss3() * 8 / wheelSound.tirePropertiesKickup
        local kickupVolume = min(1, wheelPeripherySpeedKickup * 0.0010 * wheelSound.tirePropertiesKickup)
        playSoundOnceAtNode("event:>Surfaces>kickup_sand", wd.node1, kickupVolume * wd.tireSoundVolumeCoef, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, 1)
        wheelSound.looseSurfaceKickupLimit = randomGauss3() * 4 / wheelSound.tirePropertiesKickup
        local pitch = vehicleSpeed * 0.0175
        playSoundOnceAtNode("event:>Surfaces>roll_rumblestrip", wd.node1, volume * wd.tireSoundVolumeCoef, pitch, wheelSound.tirePropertiesVolRoll)
      -- if wd.name == "FL" then playSoundOnceAtNode("event:>Surfaces>roll_rumblestrip", wd.node1, volume, pitch, wheelSound.tirePropertiesVolRoll);end
        playSoundOnceAtNode("event:>Surfaces>roll_rumblestrip", wd.node1, volume * wd.tireSoundVolumeCoef, pitch, wheelSound.tirePropertiesVolRoll)
      -- if wd.name == "FL" then playSoundOnceAtNode("event:>Surfaces>roll_rumblestrip", wd.node1, volume, pitch, wheelSound.tirePropertiesVolRoll);end
      end
@/lua/vehicle/material.lua
      if dm.deformSound and dm.deformSound ~= "" and not brokenSwitches[msc] then --check if the mesh has a deform sound
        --sounds.playSoundOnceAtNode(dm.deformSound, beam.id1, dm.deformVolume or 1)   --play the deform sound
        sounds.playSoundOnceFollowNode(dm.deformSound, beam.id1, (dm.deformVolume or 1) * 0.5)