VE Lua Documentation

Press F to search!

getMaterialIDByName

Definition


-- @/lua/common/particles.lua:30

local function getMaterialIDByName(mats, s)
    for k,v in pairs(mats) do
        --print(" "..s.." == "..v.name)
        if s == v.name then
            return k
        end
    end

    return math.min(3, #mats)
end

Callers

@/lua/common/jbeam/tableSchema.lua
      if valuePart:sub(1,3) == "NM_" then
        ival = particles.getMaterialIDByName(materials, valuePart:sub(4))
        --log('D', "jbeam.replaceSpecialValues", "replaced "..valuePart.." with "..ival)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamModifierLeakVis.lua
      if valuePart:sub(1,3) == "NM_" then
        ival = particles.getMaterialIDByName(materials, valuePart:sub(4))
        --log('D', "jbeam.replaceSpecialValues", "replaced "..valuePart.." with "..ival)