How to link certain deformGroup to LUA

Discussion in 'Programming' started by Skwerly1, Apr 22, 2022.

  1. Skwerly1

    Skwerly1
    Expand Collapse

    Joined:
    Nov 9, 2017
    Messages:
    20
    So in my infinite wisdom, I decided to mess with the blinkers.

    Is it possible to direct an LUA to a certain deformGroup?

    Eg.: {"deformGroup":"headlightglass_R_break","deformationTriggerRatio":0.02},

    What I am trying to do is something like this:

    Code:
    local blinkPulse = false
    local blinkTimerThreshold = 0.4
    local blinkTimerThreshold1 = 0.15 --To make the blinker pulse rapidly after headlight/taillight breaks
    local blinkTimer = 0
    local blinkTimer1 = 0
    
    local generateBlinkPulse = nop
    local function generateBlinkPulseFun(dt)
      blinkTimer = blinkTimer + dt
       if blinkTimer > blinkTimerThreshold then
        if blinkPulse then
          sounds.playSoundSkipAI(indLoopSnd1)
        else
          sounds.playSoundSkipAI(indLoopSnd2)
        end
        blinkPulse = not blinkPulse
        blinkTimer = 0
      end
    end
    How would I add a global command?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice