VE Lua Documentation

Press F to search!

playSFXOnceCT

Definition


-- @/=[C]:-1
function playSFXOnceCT(...)

Callers

@/lua/vehicle/controller/sound/linearMovement.lua
    --color == 1 is the trigger for fmod to play the segment part on top of the noise part
    obj:playSFXOnceCT(segmentSoundEvent, soundNode, volume, pitch, 0, 0)
  end
    --trigger the start sound
    obj:playSFXOnceCT(minPositionSoundEvent, soundNode, volume, pitch, 0, 0)
    --prevent further start sounds from playing
    --trigger the end sound
    obj:playSFXOnceCT(maxPositionSoundEvent, soundNode, volume, pitch, 0, 0)
    --prevent further end sounds from playing
@/lua/vehicle/controller/couplings/fifthwheel.lua
    if fithwheelAttachSoundEvent then
      obj:playSFXOnceCT(fithwheelAttachSoundEvent, nodeId, fithwheelAttachSoundVolume, 0.5, aggressionCoef, 0)
    end
    if fithwheelDetachSoundEvent then
      obj:playSFXOnceCT(fithwheelDetachSoundEvent, nodeId, fithwheelDetachSoundVolume, 0.5, 0, 0)
    end
@/lua/vehicle/beamstate.lua
    local tireBurstColor = wheels.wheels[wheelid] and linearScale(wheels.wheels[wheelid].tireVolume, 0, 1, 0, 5) or 0
    obj:playSFXOnceCT("event:>Vehicle>Failures>tire_burst", wheel.node1, tireBurstVolume, 1, tireBurstColor, 0)
@/lua/vehicle/sounds.lua
  if volume >= 0.01 and pitch >= 0.0039 then
    obj:playSFXOnceCT(soundName, nodeID, volume, pitch, color or 0, texture or 0)
  end
        local speedPitch = clamp(abs(wd.angularVelocity) / 200, 0, 1)
        obj:playSFXOnceCT(wd.flatTireSound, wd.node1, downForceVolume, speedPitch, wd.tireVolume * 5, max(M.scrapeLoosenessMap[mat] or 0, M.scrapeLoosenessMap[mat2] or 0))
        wd.deflatedTireAngle = wd.deflatedTireAngle - twoPi * sign(wd.deflatedTireAngle)
@/lua/vehicle/controller/propAnimation/hPattern.lua
          hasPlayedSound = true
          obj:playSFXOnceCT(shiftSoundEventGearIn, shiftSoundNodeId, shiftSoundVolumeGearIn, 1, shiftAggression, 0)
        end
          hasPlayedSound = true
          obj:playSFXOnceCT(shiftSoundEventGearOut, shiftSoundNodeId, shiftSoundVolumeGearOut, 1, shiftAggression, 0)
        end
@/lua/vehicle/powertrain/combustionEngineThermals.lua
          if exhaustAudioEndFuel > afterFire.audibleThresholdInstant then --Single bang
            obj:playSFXOnceCT(afterFire.instantAudioSample, n.finish, n.afterFireVolumeCoef * afterFire.instantVolumeCoef, 1.0, 1 - n.afterFireMufflingCoef, 0)
          -- Audio Debug
          if exhaustAudioEndFuel > afterFire.audibleThresholdShift then
            obj:playSFXOnceCT(afterFire.shiftAudioSample, n.finish, n.afterFireVolumeCoef * afterFire.shiftVolumeCoef, 1.0, 1 - n.afterFireMufflingCoef, 0)
          -- Audio Debug
          if exhaustAudioEndFuel > afterFire.audibleThresholdSustained then --popcorn single bang
            obj:playSFXOnceCT(afterFire.sustainedAudioSample, n.finish, n.afterFireVolumeCoef * afterFire.sustainedVolumeCoef, 1.0, 1 - n.afterFireMufflingCoef, 0)
          --print (string.format(" AF Trig Sustd %.3f/%.3f Eng InstVolCoef %.2f Exh VolCoef %.2f EngExh Vol TOTL %.2f Exh Color %.2f", parentEngine.sustainedAfterFireCoef, parentEngine.sustainedAfterFireCoef * n.afterFireAudioCoef, afterFire.sustainedVolumeCoef, n.afterFireVolumeCoef, afterFire.sustainedVolumeCoef * n.afterFireVolumeCoef, 1 - n.afterFireMufflingCoef))
@/lua/vehicle/controller/propAnimation/singleAxisLever.lua
      hasPlayedSound = true
      obj:playSFXOnceCT(shiftSoundEvent, shiftSoundNodeId, shiftSoundVolume, 1, 0, 0)
    end
@/lua/vehicle/controller/propAnimation/dualAxisLever.lua
      gearModeState = gearModeStates.none
      obj:playSFXOnceCT(moveSoundEvent, moveSoundNodeId, moveSoundVolume, 1, 0, 0)
    end
@/lua/vehicle/controller/propAnimation/sequentialLever.lua
  if shiftImpulse ~= previousShiftImpulse then
    obj:playSFXOnceCT(event, shiftSoundNodeId, volume, 1, shiftAggression, 0)
  end
@/lua/vehicle/controller/advancedCouplerControl.lua
      local aggressionCoef = linearScale(attachForce, 0.1, 1, 0, 1)
      obj:playSFXOnceCT(couplerGroup.attachSoundEvent, couplerGroup.soundNode, couplerGroup.attachSoundVolume, 0.5, aggressionCoef, 0)
    end
    if isCorrectPastState and isCorrectCurrentState then
      obj:playSFXOnceCT(couplerGroup.detachSoundEvent, couplerGroup.soundNode, couplerGroup.detachSoundVolume, 0.5, 1, 0)
    end