(SOLVED) How do I use function breakBreakGroup?

Discussion in 'Programming' started by buddylevi03, Oct 22, 2019.

  1. buddylevi03

    buddylevi03
    Expand Collapse

    Joined:
    Dec 19, 2014
    Messages:
    32
    I'm just wanting to break individual groups to inspect damage without destroying the parts i'm removing. I'm no programmer, so it's no surprise i couldn't make it work. How do I use it?

    Full function as it is written in beamstate.lua

    local function breakBreakGroup(g)
    if g == nil then
    return
    end

    -- hide props if they use
    props.hidePropsInBreakGroup(g)

    -- break all beams in that group
    local bg = breakGroupCache[g]
    if bg then
    breakGroupCache[g] = nil
    for _, bcid in ipairs(bg) do
    obj:breakBeam(bcid)
    luaBreakBeam(bcid)
    end
    end

    -- break all couplers
    bg = couplerBreakGroupCache[g]
    if bg then
    couplerBreakGroupCache[g] = nil
    for _, ccid in ipairs(bg) do
    obj:detachCoupler(ccid)
    end
    end

    --break triangle breakgroups matching the beam breakgroup
    bg = triangleBreakGroupCache[g]
    if bg then
    for _, ctid in ipairs(bg) do
    obj:breakCollisionTriangle(ctid)
    collTriState[ctid] = nil
    end
    triangleBreakGroupCache[g] = nil
    end
    end


    EDIT: figured out I was supposed to put beamstate before calling the function
     
    #1 buddylevi03, Oct 22, 2019
    Last edited: Oct 22, 2019
  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