tonumber
Definition
-- @/=[C]:-1
function tonumber(...)
Callers
@/lua/ge/extensions/gameplay/drag/general.lua
for key, _ in pairs(wheelsByFrontness) do
if math.abs(tonumber(key) - frontness) < 0.2 then
frontness = key
@/lua/ge/extensions/gameplay/rally/snaproad/geoPacenotes.lua
for _, entry in ipairs(cornerSeverityTable) do
local diameter = tonumber(entry.diameter)
if diameter then
if not entry.hp then
local diameter = tonumber(entry.diameter)
if diameter then
@/lua/ge/extensions/flowgraph/nodes/mission/getCustomVehicleData.lua
if veh.routeSpeed and veh.routeSpeed ~= "" then
self.pinOut.routeSpeed.value = tonumber(veh.routeSpeed)
end
if veh.risk and veh.risk ~= "" then
self.pinOut.risk.value = tonumber(veh.risk)
end
@/lua/ge/map.lua
local prefix
if tonumber(decalRoadName) then
prefix = 'DR'..rnum..'_'
if speedLimit then
speedLimit = tonumber(speedLimit)
if speedLimit <= 0 then
if noOfValidEdges > 0 then
log('W', 'map', case.."There are "..tonumber(noOfValidEdges).." valid edges")
end
if noOfInvalidEdges > 0 then
log('W', 'map', case.."There are "..tonumber(noOfInvalidEdges).." invalid edges")
end
if nonManualIsolatedNodes > 0 then
log('W', 'map', case.."There are "..tonumber(nonManualIsolatedNodes).." non manual isolated nodes")
end
obj.states = states or emptyTable
obj.uiState = object.uiState and tonumber(object.uiState)
obj.objectCollisions = objectCollisions or emptyTable
@/lua/ge/extensions/editor/tech/roadArchitect/tunnelMesh.lua
local proc = createObject('ProceduralMesh')
proc:registerObject('Auto_Tunnel_' .. tonumber(meshIdx))
meshIdx = meshIdx + 1
@/lua/ge/extensions/gameplay/rally/notebook/path.lua
local num = string.match(str, "%d+%.?%d*$")
return num and tonumber(num) or nil
end
-- if prefix then
-- local id = tonumber(id)
-- if id then
@/lua/ge/extensions/editor/flowgraph/main.lua
--else
--im.Text("Dirty: " .. tonumber(ui_flowgraph_editor.GetDirtyReason()))
end
if (bit.band(tonumber(ui_flowgraph_editor.GetDirtyReason()), ui_flowgraph_editor.Dirty_Position) ~= 0) then --and im.IsMouseReleased(0) then
if self.mgr._ignoreMove then
@/lua/common/jbeam/sections/events.lua
abo:set(tonumber(ab.idRef), tonumber(ab.idX), tonumber(ab.idY))
abo:set(tonumber(ab.idRef), tonumber(ab.idX), tonumber(ab.idY))
abo:set(tonumber(ab.idRef), tonumber(ab.idX), tonumber(ab.idY))
@/lua/ge/extensions/editor/api/roadRiver.lua
for id in string.gmatch(childIDs, "%d+") do
deleteRoad(tonumber(id))
removeRoadFromList(tonumber(id))
deleteRoad(tonumber(id))
removeRoadFromList(tonumber(id))
end
for decoID in string.gmatch(decorationIDs, "%d+") do
scenetree.findObjectById(tonumber(decoID)):deleteObject()
end
@/lua/ge/extensions/freeroam/specialTriggers.lua
for _, o in ipairs(obj:getObjects()) do
setState(tonumber(o) or scenetree.findObject(o):getID(), state)
end
for _, o in ipairs(obj:getObjects()) do
local obj = scenetree.findObjectById(tonumber(o) or scenetree.findObject(o):getID())
if obj:getGroup():getName() == k and obj:getClassName() ~= 'SimGroup' then
for _, o in ipairs(obj:getObjects()) do
local obj = scenetree.findObjectById(tonumber(o) or scenetree.findObject(o):getID())
if obj:getGroup():getName() == k and obj:getClassName() == 'SimGroup' then
randomOrder = v.randomOrder and true or false,
enterDelay = tonumber(v.enterDelay) or 0,
exitDelay = tonumber(v.exitDelay) or 0,
enterDelay = tonumber(v.enterDelay) or 0,
exitDelay = tonumber(v.exitDelay) or 0,
enterRandomMin = tonumber(v.enterRandomMin) or 0,
exitDelay = tonumber(v.exitDelay) or 0,
enterRandomMin = tonumber(v.enterRandomMin) or 0,
enterRandomMax = tonumber(v.enterRandomMax) or 0,
enterRandomMin = tonumber(v.enterRandomMin) or 0,
enterRandomMax = tonumber(v.enterRandomMax) or 0,
exitRandomMin = tonumber(v.exitRandomMin) or 0,
enterRandomMax = tonumber(v.enterRandomMax) or 0,
exitRandomMin = tonumber(v.exitRandomMin) or 0,
exitRandomMax = tonumber(v.exitRandomMax) or 0
exitRandomMin = tonumber(v.exitRandomMin) or 0,
exitRandomMax = tonumber(v.exitRandomMax) or 0
}
for _, o1 in ipairs(innerObjects) do
local obj1 = scenetree.findObjectById(tonumber(o1) or scenetree.findObject(o1):getID())
if obj1 and obj1:getGroup():getName() == name and obj1:getClassName() == 'SimGroup' then
if o2 then
setState(tonumber(o2) or scenetree.findObject(o2):getID(), v.active)
end
if innerObjects[idx] then -- processes the next object
setState(tonumber(innerObjects[idx]) or scenetree.findObject(innerObjects[idx]):getID(), v.active)
end
@/lua/ge/extensions/flowgraph/nodes/mission/knockAwayCheck.lua
local veh = scenetree.findObjectById(id)
local pts = tonumber(veh:getDynDataFieldbyName("knockAwayPoints", 0)) or self.pinIn.defaultPoints.value or 1
self.vehiclePoints[id] = pts
@/lua/common/jbeam/sections/meshs.lua
v = v:gsub("#","")
return ColorF(tonumber("0x"..v:sub(1,2)) / 255, tonumber("0x"..v:sub(3,4)) / 255, tonumber("0x"..v:sub(5,6)) / 255, tonumber("0x"..v:sub(7,8)) / 255)
end
v = v:gsub("#","")
return ColorF(tonumber("0x"..v:sub(1,2)) / 255, tonumber("0x"..v:sub(3,4)) / 255, tonumber("0x"..v:sub(5,6)) / 255, tonumber("0x"..v:sub(7,8)) / 255)
end
v = v:gsub("#","")
return ColorF(tonumber("0x"..v:sub(1,2)) / 255, tonumber("0x"..v:sub(3,4)) / 255, tonumber("0x"..v:sub(5,6)) / 255, tonumber("0x"..v:sub(7,8)) / 255)
end
v = v:gsub("#","")
return ColorF(tonumber("0x"..v:sub(1,2)) / 255, tonumber("0x"..v:sub(3,4)) / 255, tonumber("0x"..v:sub(5,6)) / 255, tonumber("0x"..v:sub(7,8)) / 255)
end
local idRef, idX, idY = tonumber(prop.idRef), tonumber(prop.idX), tonumber(prop.idY)
local idRef, idX, idY = tonumber(prop.idRef), tonumber(prop.idX), tonumber(prop.idY)
local idRef, idX, idY = tonumber(prop.idRef), tonumber(prop.idX), tonumber(prop.idY)
if flexbody.pos then
pos = vec3(tonumber(flexbody.pos.x), tonumber(flexbody.pos.y), tonumber(flexbody.pos.z))
else
if flexbody.pos then
pos = vec3(tonumber(flexbody.pos.x), tonumber(flexbody.pos.y), tonumber(flexbody.pos.z))
else
if flexbody.pos then
pos = vec3(tonumber(flexbody.pos.x), tonumber(flexbody.pos.y), tonumber(flexbody.pos.z))
else
if flexbody.rot then
rotDeg = vec3(tonumber(flexbody.rot.x), tonumber(flexbody.rot.y), tonumber(flexbody.rot.z))
else
if flexbody.rot then
rotDeg = vec3(tonumber(flexbody.rot.x), tonumber(flexbody.rot.y), tonumber(flexbody.rot.z))
else
if flexbody.rot then
rotDeg = vec3(tonumber(flexbody.rot.x), tonumber(flexbody.rot.y), tonumber(flexbody.rot.z))
else
if flexbody.scale then
scale = vec3(tonumber(flexbody.scale.x), tonumber(flexbody.scale.y), tonumber(flexbody.scale.z))
else
if flexbody.scale then
scale = vec3(tonumber(flexbody.scale.x), tonumber(flexbody.scale.y), tonumber(flexbody.scale.z))
else
if flexbody.scale then
scale = vec3(tonumber(flexbody.scale.x), tonumber(flexbody.scale.y), tonumber(flexbody.scale.z))
else
@/lua/common/libs/lunajson/lunajson/decoder.lua
fixedtonumber = function(s)
return tonumber(gsub(s, '.', radixmark))
end
@/lua/common/libs/copas/copas/http.lua
if err then return nil, err end
local size = base.tonumber(string.gsub(line, ";.*", ""), 16)
if not size then return nil, "invalid chunk size" end
local code = socket.skip(2, string.find(status, "HTTP/%d*%.%d* (%d%d%d)"))
return self.try(base.tonumber(code), status)
end
step = step or ltn12.pump.step
local length = base.tonumber(headers["content-length"])
local t = headers["transfer-encoding"] -- shortcut
if t and t ~= "identity" then mode = "http-chunked"
elseif base.tonumber(headers["content-length"]) then mode = "by-length" end
return self.try(ltn12.pump.all(socket.source(mode, self.c, length),
@/lua/ge/extensions/scenario/busdriver.lua
if hex:len() == 3 then
return (tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255
else
if hex:len() == 3 then
return (tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255
else
if hex:len() == 3 then
return (tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255
else
else
return tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255
end
else
return tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255
end
else
return tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255
end
@/lua/ge/extensions/career/modules/branches/landing.lua
local function changeDarknesssColor(color, addedValue)
local number = tonumber(color:match("(%d+)"))
if number then
@/lua/ge/extensions/editor/dynamicDecals/vehicleColorPalette.lua
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_Metallic_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[1])), 0.0, 1.0, "%.2f") then
local val = string.format("%f %s %s %s", editor.getTempFloat_NumberNumber(), metallicPaintData[2], metallicPaintData[3], metallicPaintData[4])
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_Roughness_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[2])), 0.0, 1.0, "%.2f") then
local val = string.format("%s %f %s %s", metallicPaintData[1], editor.getTempFloat_NumberNumber(), metallicPaintData[3], metallicPaintData[4])
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_ClearCoat_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[3])), 0.0, 1.0, "%.2f") then
local val = string.format("%s %s %f %s", metallicPaintData[1], metallicPaintData[2], editor.getTempFloat_NumberNumber(), metallicPaintData[4])
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_ClearCoatRoughness_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[4])), 0.0, 1.0, "%.2f") then
local val = string.format("%s %s %s %f", metallicPaintData[1], metallicPaintData[2], metallicPaintData[3], editor.getTempFloat_NumberNumber())
@/lua/vehicle/controller/vehicleController/shiftLogic/dctGearbox.lua
if string.find(automaticHandling.mode, "M") then
local gearIndex = tonumber(string.sub(automaticHandling.mode, 2))
gearRatio = gearbox.gearRatios[gearIndex]
end
if tonumber(automaticHandling.mode) then
local gearIndex = tonumber(automaticHandling.mode)
if tonumber(automaticHandling.mode) then
local gearIndex = tonumber(automaticHandling.mode)
gearRatio = gearbox.gearRatios[gearIndex]
if string.find(automaticHandling.mode, "M") then
local gearIndex = tonumber(string.sub(automaticHandling.mode, 2))
gearRatio = gearbox.gearRatios[gearIndex]
if tonumber(automaticHandling.mode) then
local gearIndex = tonumber(automaticHandling.mode)
if tonumber(automaticHandling.mode) then
local gearIndex = tonumber(automaticHandling.mode)
gearRatio = gearbox.gearRatios[gearIndex]
@/lua/common/tech/techCommunication.lua
local received, err = skt:receive(12) -- length used to be encoded in first 16 bytes as a string
local lengthRest = tonumber(received)
if err then
@/lua/ge/extensions/editor/objectTool.lua
local obj = scenetree.findObjectById(id)
parentIds[i] = tonumber(obj:getField("parentGroup", 0))
end
local newGroup = nil
if parentIds and parentIds[i] then newGroup = scenetree.findObjectById(tonumber(parentIds[i])) end
local grp = newGroup or missionGroup
@/lua/ge/extensions/util/trackBuilder/materialUtil.lua
for str in string.gmatch(color, "([^' ']+)") do
t[i] = tonumber(str)
i = i + 1
@/lua/ge/extensions/core/camera.lua
-- sanitization
if type(jbeamConfig.distance) == 'string' then jbeamConfig.distance = tonumber(jbeamConfig.distance) end
if type(jbeamConfig.distanceMin) == 'string' then jbeamConfig.distanceMin = tonumber(jbeamConfig.distanceMin) end
if type(jbeamConfig.distance) == 'string' then jbeamConfig.distance = tonumber(jbeamConfig.distance) end
if type(jbeamConfig.distanceMin) == 'string' then jbeamConfig.distanceMin = tonumber(jbeamConfig.distanceMin) end
@/lua/vehicle/beamstate.lua
if split[2] == "beamDamage" then
table.insert(damageableBeams, tonumber(split[3]))
hasDamageableBeams = true
for cid, node in pairs(save.nodes) do
cid = tonumber(cid) - 1
obj:setNodePosition(cid, vec3(node[1]))
for cid, beam in pairs(save.beams) do
cid = tonumber(cid) - 1
obj:setBeamLength(cid, beam[1])
@/lua/ge/extensions/editor/crawlEditor.lua
for _, missionName in ipairs(missions) do
local number = tonumber(string.match(missionName, "^(%d+)"))
if number and number > maxNumber then
@/lua/ge/extensions/flowgraph/nodes/util/closestRoad.lua
if underscoreIndex and underscoreIndex >= 0 then
local rdId = tonumber(string.sub(short,1,underscoreIndex-1))
if not idId then
end
local rdIdx = tonumber(string.sub(short,underscoreIndex+1,string.len(short)))
return rdId, rdIdx
@/lua/ge/extensions/editor/api/gui.lua
else
newVal = tonumber(val)
end
if value then
local res = tonumber(value)
if res then
if value then
local res = tonumber(value)
if res then
if tblLength == 2 then
tempIntArr2[0] = tonumber(res[1])
tempIntArr2[1] = tonumber(res[2])
tempIntArr2[0] = tonumber(res[1])
tempIntArr2[1] = tonumber(res[2])
else
if value then
local res = tonumber(value)
if res then
if tblLength == 2 then
tempFloatArr2[0] = tonumber(res[1])
tempFloatArr2[1] = tonumber(res[2])
tempFloatArr2[0] = tonumber(res[1])
tempFloatArr2[1] = tonumber(res[2])
else
if tblLength == 4 then
tempFloatArr4[0] = tonumber(res[1])
tempFloatArr4[1] = tonumber(res[2])
tempFloatArr4[0] = tonumber(res[1])
tempFloatArr4[1] = tonumber(res[2])
tempFloatArr4[2] = tonumber(res[3])
tempFloatArr4[1] = tonumber(res[2])
tempFloatArr4[2] = tonumber(res[3])
tempFloatArr4[3] = tonumber(res[4])
tempFloatArr4[2] = tonumber(res[3])
tempFloatArr4[3] = tonumber(res[4])
elseif tblLength == 1 then
elseif tblLength == 3 then
tempFloatArr4[0] = tonumber(res[1])
tempFloatArr4[1] = tonumber(res[2])
tempFloatArr4[0] = tonumber(res[1])
tempFloatArr4[1] = tonumber(res[2])
tempFloatArr4[2] = tonumber(res[3])
tempFloatArr4[1] = tonumber(res[2])
tempFloatArr4[2] = tonumber(res[3])
tempFloatArr4[3] = 1.0
@/lua/ge/extensions/editor/api/valueInspector.lua
if not isDifferent then
self.input4FloatValue[0] = tonumber(fieldValue)
end
if not isDifferent then
self.input4IntValue[0] = tonumber(fieldValue)
end
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[2] = tonumber(vec[3])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[2] = tonumber(vec[3])
if vec[2] == nil then vec[2] = "0" end
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
if vec[4] == nil then vec[4] = "0" end
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[2] = tonumber(vec[3])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[2] = tonumber(vec[3])
self.input4FloatValue[3] = tonumber(vec[4])
self.input4FloatValue[2] = tonumber(vec[3])
self.input4FloatValue[3] = tonumber(vec[4])
if vec[2] == nil then vec[2] = "0" end
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[0] = radToDeg(tonumber(vec[1]) or 0)
self.input4FloatValue[1] = radToDeg(tonumber(vec[2]) or 0)
self.input4FloatValue[0] = radToDeg(tonumber(vec[1]) or 0)
self.input4FloatValue[1] = radToDeg(tonumber(vec[2]) or 0)
self.input4FloatValue[2] = radToDeg(tonumber(vec[3]) or 0)
self.input4FloatValue[1] = radToDeg(tonumber(vec[2]) or 0)
self.input4FloatValue[2] = radToDeg(tonumber(vec[3]) or 0)
if vec[4] == nil then vec[4] = "0" end
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[2] = tonumber(vec[3])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[2] = tonumber(vec[3])
self.input4FloatValue[3] = tonumber(vec[4])
self.input4FloatValue[2] = tonumber(vec[3])
self.input4FloatValue[3] = tonumber(vec[4])
-- editUvRectInfo.uvRect = {}
-- editUvRectInfo.uvRect[0] = tonumber(vec[1])
-- editUvRectInfo.uvRect[1] = tonumber(vec[2])
-- editUvRectInfo.uvRect[0] = tonumber(vec[1])
-- editUvRectInfo.uvRect[1] = tonumber(vec[2])
-- editUvRectInfo.uvRect[2] = tonumber(vec[3])
-- editUvRectInfo.uvRect[1] = tonumber(vec[2])
-- editUvRectInfo.uvRect[2] = tonumber(vec[3])
-- editUvRectInfo.uvRect[3] = tonumber(vec[4])
-- editUvRectInfo.uvRect[2] = tonumber(vec[3])
-- editUvRectInfo.uvRect[3] = tonumber(vec[4])
-- editor.openModalWindow(editUvRectDlg)
if vec[4] == nil then vec[4] = "0" end
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[0] = tonumber(vec[1])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[2] = tonumber(vec[3])
self.input4FloatValue[1] = tonumber(vec[2])
self.input4FloatValue[2] = tonumber(vec[3])
self.input4FloatValue[3] = tonumber(vec[4])
self.input4FloatValue[2] = tonumber(vec[3])
self.input4FloatValue[3] = tonumber(vec[4])
if imgui.Combo1(fieldNameId, self.comboIndex, widgetsBasicComboItems) then
local index = tonumber(self.comboIndex[0])
if 0 == self.comboIndex[0] then
@/lua/ge/extensions/editor/missionEditor.lua
local dateStr = "-"
if scenario.date and tonumber(scenario.date) and tonumber(scenario.date) > 0 then
dateStr = os.date("%Y-%m-%d", tonumber(scenario.date))
local dateStr = "-"
if scenario.date and tonumber(scenario.date) and tonumber(scenario.date) > 0 then
dateStr = os.date("%Y-%m-%d", tonumber(scenario.date))
if scenario.date and tonumber(scenario.date) and tonumber(scenario.date) > 0 then
dateStr = os.date("%Y-%m-%d", tonumber(scenario.date))
end
-- for _, qr in ipairs(scenario_quickRaceLoader.getQuickraceList()) do
-- csvdata:add(translateLanguage(qr.scenarioName, qr.scenarioName, true), tonumber(qr.date), "Time Trial")
-- end
--print(idx, x)
local val = tonumber(x) or x
values[keys[idx]] = val
@/lua/ge/client/postFx/ssao.lua
if quality ~= currentQuality then
currentQuality = tostring(clamp(round(tonumber(quality)), 0, 2))
local ssaoPostFx = scenetree.findObject("SSAOPostFx")
@/lua/ge/extensions/flowgraph/graph.lua
local nodeData = data.nodes[nid]
local node = self:createNode(nodeData.type, tonumber(nid) + self.mgr:getGraphNodeOffset())
if node then
-- create a ghost node with some generic in-/outputs
node = self:createNode('util/ghost', tonumber(nid) + self.mgr:getGraphNodeOffset())
log('W', self.mgr.logTag, 'Created ghost node replacement!')
node:__onDeserialized(nodeData)
--oldNodeIdMap[tonumber(nid)] = node
end
for childId, child in pairs(data.children) do
local cid = tonumber(childId) + self.mgr:getGraphNodeOffset()
local iNode = integratedNodes[tonumber(cid)]
local cid = tonumber(childId) + self.mgr:getGraphNodeOffset()
local iNode = integratedNodes[tonumber(cid)]
if child.macroID then
--local macro = oldNodeIdMap[tonumber(child.macroID)]
--if not macro then
--if not macro then
local macro = self.mgr.macros[tonumber(child.macroID)]
--end
if macro then
cGraph = self.mgr:createInstanceFromMacro(macro, integratedNodes[tonumber(cid)], tonumber(cid) )
else
if macro then
cGraph = self.mgr:createInstanceFromMacro(macro, integratedNodes[tonumber(cid)], tonumber(cid) )
else
--print("Creating macro instance path. "..self.name .. " => " ..child.path)
cGraph = self.mgr:createMacroInstanceFromPath(child.path, integratedNodes[tonumber(cid)] )
else
--print("Deserializing Child "..self.name .. " => " ..child.name)
cGraph = self.mgr:createGraph('for deserializing child',self.type == 'macro', tonumber(cid))
if self.type == 'macro' then
end
--oldNodeIdMap[tonumber(cid)] = cGraph
end
@/lua/ge/extensions/gameplay/speedTraps.lua
local speedLimitTolerance = data.speedLimitTolerance or speedLimit * 0.1
local triggerSpeed = isRedLightCamera and (tonumber(data.triggerSpeed) or defaultRedLightTriggerSpeed) or (speedLimit + speedLimitTolerance)
local overSpeed = vehSpeed - speedLimit
@/lua/common/libs/xlsxlib/tests/tests.lua
for k, v in pairs(t) do
if type(k) == "string" and tonumber(k) then
normalized[tonumber(k)] = v
if type(k) == "string" and tonumber(k) then
normalized[tonumber(k)] = v
else
@/lua/ge/extensions/editor/cosimulationSignalEditor.lua
end
if d[3] == 'posX' then posX = tonumber(d[4]) end
if d[3] == 'posY' then posY = tonumber(d[4]) end
if d[3] == 'posX' then posX = tonumber(d[4]) end
if d[3] == 'posY' then posY = tonumber(d[4]) end
if d[3] == 'posZ' then posZ = tonumber(d[4]) end
if d[3] == 'posY' then posY = tonumber(d[4]) end
if d[3] == 'posZ' then posZ = tonumber(d[4]) end
if d[3] == 'rotX' then rotX = tonumber(d[4]) end
if d[3] == 'posZ' then posZ = tonumber(d[4]) end
if d[3] == 'rotX' then rotX = tonumber(d[4]) end
if d[3] == 'rotY' then rotY = tonumber(d[4]) end
if d[3] == 'rotX' then rotX = tonumber(d[4]) end
if d[3] == 'rotY' then rotY = tonumber(d[4]) end
if d[3] == 'rotZ' then rotZ = tonumber(d[4]) end
if d[3] == 'rotY' then rotY = tonumber(d[4]) end
if d[3] == 'rotZ' then rotZ = tonumber(d[4]) end
if d[3] == 'rotW' then rotW = tonumber(d[4]) end
if d[3] == 'rotZ' then rotZ = tonumber(d[4]) end
if d[3] == 'rotW' then rotW = tonumber(d[4]) end
end
if d[1] == 'connection' then
if d[3] == '3rd Party Computation Time' then compTime3rdParty = im.FloatPtr(tonumber(d[4])) end
if d[3] == 'Ping Time' then pingTime = im.FloatPtr(tonumber(d[4])) end
if d[3] == '3rd Party Computation Time' then compTime3rdParty = im.FloatPtr(tonumber(d[4])) end
if d[3] == 'Ping Time' then pingTime = im.FloatPtr(tonumber(d[4])) end
if d[2] == 'otherUDP' then
if d[3] == 'IP' then sIP = im.ArrayChar(128, d[4]) end
if d[3] == 'port' then sPort = im.IntPtr(tonumber(d[4])) end
end
if d[3] == 'IP' then rIP = im.ArrayChar(128, d[4]) end
if d[3] == 'port' then rPort = im.IntPtr(tonumber(d[4])) end
end
end
if d[3] == 'posX' then posX = tonumber(d[4]) end
if d[3] == 'posY' then posY = tonumber(d[4]) end
if d[3] == 'posX' then posX = tonumber(d[4]) end
if d[3] == 'posY' then posY = tonumber(d[4]) end
if d[3] == 'posZ' then posZ = tonumber(d[4]) end
if d[3] == 'posY' then posY = tonumber(d[4]) end
if d[3] == 'posZ' then posZ = tonumber(d[4]) end
if d[3] == 'rotX' then rotX = tonumber(d[4]) end
if d[3] == 'posZ' then posZ = tonumber(d[4]) end
if d[3] == 'rotX' then rotX = tonumber(d[4]) end
if d[3] == 'rotY' then rotY = tonumber(d[4]) end
if d[3] == 'rotX' then rotX = tonumber(d[4]) end
if d[3] == 'rotY' then rotY = tonumber(d[4]) end
if d[3] == 'rotZ' then rotZ = tonumber(d[4]) end
if d[3] == 'rotY' then rotY = tonumber(d[4]) end
if d[3] == 'rotZ' then rotZ = tonumber(d[4]) end
if d[3] == 'rotW' then rotW = tonumber(d[4]) end
if d[3] == 'rotZ' then rotZ = tonumber(d[4]) end
if d[3] == 'rotW' then rotW = tonumber(d[4]) end
end
if d[1] == 'connection' then
if d[3] == '3rd Party Computation Time' then time3rdParty = tonumber(d[4]) end
if d[3] == 'Ping Time' then roundTripTime = tonumber(d[4]) end
if d[3] == '3rd Party Computation Time' then time3rdParty = tonumber(d[4]) end
if d[3] == 'Ping Time' then roundTripTime = tonumber(d[4]) end
if d[2] == 'otherUDP' then
if d[3] == 'IP' then udpSendIP = ffi.string(im.ArrayChar(128, d[4])) or '127.0.0.1' end
if d[3] == 'port' then udpSendPort = tonumber(d[4]) end
end
if d[3] == 'IP' then udpReceiveIP = ffi.string(im.ArrayChar(128, d[4])) or '127.0.0.1' end
if d[3] == 'port' then udpReceivePort = tonumber(d[4]) end
end
local val = d[4]
if val == 'true' then val = true elseif val == 'false' then val = false elseif val == 'nil' then val = false else val = tonumber(val) end
if d[3] == 'posX' then IMUs[j].pos.x = val
local val = d[4]
if val == 'true' then val = true elseif val == 'false' then val = false elseif val == 'nil' then val = false else val = tonumber(val) end
if d[3] == 'posX' then GPSs[j].pos.x = val
local val = d[4]
if val == 'true' then val = true elseif val == 'false' then val = false elseif val == 'nil' then val = false else val = tonumber(val) end
idealRADARs[j][d[3]] = val
local val = d[4]
if val == 'true' then val = true elseif val == 'false' then val = false elseif val == 'nil' then val = false else val = tonumber(val) end
roadsSensors[j][d[3]] = val
@/lua/ge/extensions/editor/roadUtils.lua
for decoID in string.gmatch(decorationIDs, "%d+") do
local object = scenetree.findObjectById(tonumber(decoID))
if object then
for index, decorationSettings in ipairs(template.decorations) do
local decoID = roadDecorations.decorateProps(road:getID(), decorationSettings.shapeName, tonumber(decorationSettings.distance),
tonumber(decorationSettings.period), quatFromEuler(0,0,(tonumber(decorationSettings.rotation)/360) * 2*math.pi),
local decoID = roadDecorations.decorateProps(road:getID(), decorationSettings.shapeName, tonumber(decorationSettings.distance),
tonumber(decorationSettings.period), quatFromEuler(0,0,(tonumber(decorationSettings.rotation)/360) * 2*math.pi),
tonumber(decorationSettings.zOff), decorationSettings.align == "true")
local decoID = roadDecorations.decorateProps(road:getID(), decorationSettings.shapeName, tonumber(decorationSettings.distance),
tonumber(decorationSettings.period), quatFromEuler(0,0,(tonumber(decorationSettings.rotation)/360) * 2*math.pi),
tonumber(decorationSettings.zOff), decorationSettings.align == "true")
tonumber(decorationSettings.period), quatFromEuler(0,0,(tonumber(decorationSettings.rotation)/360) * 2*math.pi),
tonumber(decorationSettings.zOff), decorationSettings.align == "true")
decorationIDsString = decorationIDsString .. tostring(decoID) .. " "
decorationIDsString = decorationIDsString .. tostring(decoID) .. " "
randomizeDecoration(decoID, tonumber(decorationSettings.randomFactor))
end
for decalID in string.gmatch(decalIDs, "%d+") do
editor.deleteRoad(tonumber(decalID))
end
if not partOfDecal then
partOfDecal = math.random() < tonumber(probability)
actualDecalLength = math.random(minDecalLength,maxDecalLength)
for childID in string.gmatch(childIDs, "%d+") do
editor.deleteRoad(tonumber(childID))
end
else
local horizPosRelative = tonumber(childRoadSettings.dynamicFields.horizPosRelative)
local metres = 0
local width = tonumber(childRoadSettings.dynamicFields.width)
if childRoadSettings.dynamicFields.isWidthRelative == "true" then
@/lua/ge/extensions/c2/panelPlugins/tileManager.lua
elseif msg.type == "getSceneTile" then
local tx, ty = tonumber(msg.tileX), tonumber(msg.tileY)
local data = getCachedTileData(tx, ty)
elseif msg.type == "getSceneTile" then
local tx, ty = tonumber(msg.tileX), tonumber(msg.tileY)
local data = getCachedTileData(tx, ty)
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/path.lua
local c = string.split(getVehicleColor())
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 2 then
local c = string.split(getVehicleColor())
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 2 then
local c = string.split(getVehicleColor())
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 2 then
local c = string.split(getVehicleColorPalette(0))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 3 then
local c = string.split(getVehicleColorPalette(0))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 3 then
local c = string.split(getVehicleColorPalette(0))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 3 then
local c = string.split(getVehicleColorPalette(1))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
end
local c = string.split(getVehicleColorPalette(1))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
end
local c = string.split(getVehicleColorPalette(1))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
end
@/lua/ge/extensions/scenario/scenarios.lua
local drawDebug = tonumber(getConsoleVariable('$isEditorEnabled')) == 1 and settings.getValue("BeamNGRaceDrawDebug")
@/lua/common/libs/slaxml/slaxml.lua
local entityMap = { ["lt"]="<", ["gt"]=">", ["amp"]="&", ["quot"]='"', ["apos"]="'" }
local entitySwap = function(orig,n,s) return entityMap[s] or n=="#" and utf8(tonumber('0'..s)) or orig end
local function unescape(str) return gsub( str, '(&(#?)([%d%a]+);)', entitySwap ) end
@/lua/vehicle/extensions/tech/platooning.lua
local vx = tonumber(vel.x)
local vy = tonumber(vel.y)
local vx = tonumber(vel.x)
local vy = tonumber(vel.y)
local velocity = math.sqrt( vx^2 + vy^2)*3.6
local ax = tonumber(acc.x)
local ay = tonumber(acc.y)
local ax = tonumber(acc.x)
local ay = tonumber(acc.y)
local accel = math.sqrt( ax^2 + ay^2)
for k, v in pairs(mapmgr.getObjects()) do
if k == tonumber(vehicleInfront) then -- for dmpc key
local vxR = tonumber(velR.x)
local vyR = tonumber(velR.y)
local vxR = tonumber(velR.x)
local vyR = tonumber(velR.y)
local velocityR = math.sqrt( vxR^2 + vyR^2)*3.6
lastPos[k], lastVel[k] = posB, velB
local vx = tonumber(velB.x)
local vy = tonumber(velB.y)
local vx = tonumber(velB.x)
local vy = tonumber(velB.y)
local velocityB = math.sqrt( vx^2 + vy^2)*3.6
local ax = tonumber(accB.x)
local ay = tonumber(accB.y)
local ax = tonumber(accB.x)
local ay = tonumber(accB.y)
local accelB = math.sqrt( ax^2 + ay^2)
vel = obj:getVelocity()
local vx = tonumber(vel.x)
local vy = tonumber(vel.y)
local vx = tonumber(vel.x)
local vy = tonumber(vel.y)
local velocity = math.sqrt( vx^2 + vy^2)
for k, v in pairs(mapmgr.getObjects()) do
if k == tonumber(vehicles) then
velocityRelay = math.sqrt(v.vel.x^2 + v.vel.y^2)
vehicleSize = obj:getObjectInitialLength(tonumber(platoonLeaderID))
if type(v2) == "cdata" then
local x = tonumber(v2.x)
local y = tonumber(v2.y)
local x = tonumber(v2.x)
local y = tonumber(v2.y)
local z = tonumber(v2.z)
local y = tonumber(v2.y)
local z = tonumber(v2.z)
local sq2 = math.sqrt( x^2 + y^2)
@/lua/common/libs/luasocket/socket/tp.lua
if string.find(code, v) then
return base.tonumber(code), reply
end
else
if string.find(code, ok) then return base.tonumber(code), reply
else return nil, reply end
end
else return ok(base.tonumber(code), reply) end
end
@/lua/ge/extensions/ui/vehiclePaint.lua
for i,v in ipairs(stringToTable(colorString, '%s')) do
result[i] = tonumber(v)
end
@/lua/ge/extensions/scenario/raceDebug.lua
local drawDebug = tonumber(getConsoleVariable('$isEditorEnabled')) == 1 and settings.getValue("BeamNGRaceDrawDebug")
@/lua/common/libs/luasocket/socket/http.lua
if err then return nil, err end
local size = base.tonumber(string.gsub(line, ";.*", ""), 16)
if not size then return nil, "invalid chunk size" end
local code = socket.skip(2, string.find(status, "HTTP/%d*%.%d* (%d%d%d)"))
return self.try(base.tonumber(code), status)
end
step = step or ltn12.pump.step
local length = base.tonumber(headers["content-length"])
local t = headers["transfer-encoding"] -- shortcut
if t and t ~= "identity" then mode = "http-chunked"
elseif base.tonumber(headers["content-length"]) then mode = "by-length" end
return self.try(ltn12.pump.all(socket.source(mode, self.c, length),
@/lua/ge/extensions/tech/techCore.lua
local _, acquiredPort = serverSocket:getsockname()
tcomParams.port = tonumber(acquiredPort)
end
legacyInit = true
tcomParams.port = tonumber(cmdArgs[i + 1]) or tcomParams.port
elseif v == '-tport' then
legacyInit = false
tcomParams.port = tonumber(cmdArgs[i + 1]) or tcomParams.port
elseif v == '-tcom-debug' then
local point = bbox:getPoint(i)
point = {tonumber(point.x), tonumber(point.y), tonumber(point.z)}
table.insert(points, point)
local point = bbox:getPoint(i)
point = {tonumber(point.x), tonumber(point.y), tonumber(point.z)}
table.insert(points, point)
local point = bbox:getPoint(i)
point = {tonumber(point.x), tonumber(point.y), tonumber(point.z)}
table.insert(points, point)
@/lua/common/libs/xlsxlib/xlsxlib.lua
-- Convert row part to a number
local rowIndex = tonumber(row)
if not rowIndex then
-- Entire row (e.g., "2")
local row = tonumber(range)
return row, nil, row, nil
local startRow, endRow = range:match("^(%d+):(%d+)$")
startRow = tonumber(startRow)
endRow = tonumber(endRow)
startRow = tonumber(startRow)
endRow = tonumber(endRow)
if endRow < startRow then
if getLocalName(rowNode) == "row" then
local rowIndex = tonumber(rowNode.attr.r) -- Row index
sheetData[rowIndex] = sheetData[rowIndex] or {}
if cellType == "s" then
local sstIndex = tonumber(cellValue)
if sstIndex == nil then
-- Assume number
cellValue = tonumber(cellValue) or cellValue
end
@/lua/ge/extensions/ui/liveryEditor/utils.lua
-- local truncated = string.format("%.1f", value)
-- return tonumber(truncated)
return value
local truncated = string.format("%.14f", radians)
return tonumber(truncated)
-- return radians
@/lua/ge/extensions/gameplay/sites/customFields.lua
elseif data.types[name] == 'number' then
self:add(name,'number',tonumber(data.values[name]))
elseif data.types[name] == 'vec3' then
@/lua/ge/extensions/editor/gen/mesh.lua
-- lo('?? inTRI:'..i..':'..k.name..':'..k.attr.offset)
if tonumber(k.attr.offset)>stride then
stride = tonumber(k.attr.offset)
if tonumber(k.attr.offset)>stride then
stride = tonumber(k.attr.offset)
end
for i,v in pairs(av) do
-- lo('?? lifting:'..i..' v.d:'..tonumber(v.d)..':'..csind..'/'..#adist..' ad[ci]:'..tonumber(adist[csind])..':'..N..':'..tostring(tonumber(v.d)>tonumber(adist[csind])))
if adist[csind] and adist[csind-1] then
for i,v in pairs(av) do
-- lo('?? lifting:'..i..' v.d:'..tonumber(v.d)..':'..csind..'/'..#adist..' ad[ci]:'..tonumber(adist[csind])..':'..N..':'..tostring(tonumber(v.d)>tonumber(adist[csind])))
if adist[csind] and adist[csind-1] then
for i,v in pairs(av) do
-- lo('?? lifting:'..i..' v.d:'..tonumber(v.d)..':'..csind..'/'..#adist..' ad[ci]:'..tonumber(adist[csind])..':'..N..':'..tostring(tonumber(v.d)>tonumber(adist[csind])))
if adist[csind] and adist[csind-1] then
for i,v in pairs(av) do
-- lo('?? lifting:'..i..' v.d:'..tonumber(v.d)..':'..csind..'/'..#adist..' ad[ci]:'..tonumber(adist[csind])..':'..N..':'..tostring(tonumber(v.d)>tonumber(adist[csind])))
if adist[csind] and adist[csind-1] then
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/countdownSynced.lua
-- Check if message is just a number (countdown numbers like "3", "2", "1")
if tonumber(msgStr) then
msgForDisplay = "Countdown: " .. msgStr
@/lua/ge/extensions/editor/buildingEditor.lua
for str in string.gmatch(s, "([^"..d.."]+)") do
t[#t + 1] = tonumber(str)
end
@/lua/ge/extensions/editor/rallyEditor/pacenotes.lua
local _, numA = note:nameComponents()
numA = tonumber(numA)
local nextNum = numA
local _, numB = next_note:nameComponents()
numB = tonumber(numB)
nextNum = numA + ((numB - numA) / 2)
-- local currId = self:selectedPacenote().id
-- num = tonumber(num) + 0.01
@/lua/ge/extensions/editor/gen/test.lua
for _,o in pairs(list) do
local om = scenetree.findObjectById(tonumber(o))
lo('?? if_DEL:'..tostring(o)..':'..tostring(om))
for _,o in pairs(list) do
local om = scenetree.findObjectById(tonumber(o))
if om then
@/lua/ge/extensions/core/commandhandler.lua
local hex_to_char = function(x)
return string.char(tonumber(x, 16))
end
@/lua/ge/extensions/util/nodeBeamExport.lua
local n = name and string.match(name, '^export_(%d+)%.nbexport%.json$')
n = n and tonumber(n) or nil
if n and n > maxIdx then maxIdx = n end
@/lua/ge/extensions/core/repository.lua
local parDownloads = tonumber(settings.getValue('modNumParallelDownload', 3))
@/lua/ge/extensions/util/renderComponentsAPI.lua
-- no type means numeric value
TorqueScriptLua.setVar(name, tonumber(value))
else
if settingByKey[key].type == 'bool' then current[key] = current[key] == "1" end
if settingByKey[key].type == nil then current[key] = tonumber(current[key]) end
end
@/lua/ge/extensions/editor/createObjectTool.lua
if string.match(itemName, "^"..classname.."_%d+".."$") then
table.insert(fileNameIndexes, tonumber(string.match(itemName, "[1-9][0-9]*$")))
end
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/brushStroke.lua
local c = string.split(getVehicleColor())
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 2 then
local c = string.split(getVehicleColor())
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 2 then
local c = string.split(getVehicleColor())
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 2 then
local c = string.split(getVehicleColorPalette(0))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 3 then
local c = string.split(getVehicleColorPalette(0))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 3 then
local c = string.split(getVehicleColorPalette(0))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
elseif layer.colorPaletteMapId == 3 then
local c = string.split(getVehicleColorPalette(1))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
end
local c = string.split(getVehicleColorPalette(1))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
end
local c = string.split(getVehicleColorPalette(1))
col = {tonumber(c[1]), tonumber(c[2]), tonumber(c[3]), 1}
end
@/lua/ge/extensions/editor/gen/decal.lua
-- lo('??^^^^^^^^^^^^^^^^^^^^^ for_gl_obj:'..tostring(o))
editor.deleteRoad(tonumber(o))
editor.deleteObject(tonumber(o))
editor.deleteRoad(tonumber(o))
editor.deleteObject(tonumber(o))
-- scenetree.findObjectById(tonumber(o)):delete()
editor.deleteObject(tonumber(o))
-- scenetree.findObjectById(tonumber(o)):delete()
-- o:delete()
@/lua/common/libs/luamqtt/mqtt/client.lua
else
port = tonumber(port)
end
@/lua/ge/extensions/gameplay/missions/missionScreen.lua
filterData.groupTags['all'] = true
filterData.sortingValues['date'] = tonumber(m.date) or 0
@/lua/ge/extensions/career/modules/insurance/insurance.lua
for k, v in pairs(savedPlInsuranceData.invVehs) do
invVehs[tonumber(k) or k] = v
end
if data["Commercial Class"] then
conditionData.commercialClass = tonumber(string.match(data["Commercial Class"], "%d+"))
end
if data.vehicleInfo and data.vehicleInfo["Commercial Class"] then
conditionData.commercialClass = tonumber(string.match(data.vehicleInfo["Commercial Class"], "%d+"))
end
@/lua/ge/extensions/gameplay/rally/notebook/structured.lua
if Schema.schema[fieldName].type == 'number' or Schema.schema[fieldName].type == 'enum' then
self.fields[fieldName] = tonumber(data[fieldName])
else
@/lua/ge/extensions/core/vehicle/manager.lua
-- TODO: FIXME: do not call enterVehicle if the player is already in the vehicle or we reload: "and not reloading"
local player = vehicleObj.autoEnterVehiclePlayer ~= "" and tonumber(vehicleObj.autoEnterVehiclePlayer) or 0
be:enterVehicle(player, vehicleObj) -- will trigger onVehicleSwitched
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
local num = string.gsub(otherInstance.name, name, "")
idx = math.max(idx, tonumber(num) or idx) -- finds the highest number out of all instances with the same prefix
end
@/lua/ge/extensions/gameplay/markers/missionMarker.lua
local function idSort(a,b) return a.id < b.id end
local function dateSort(a,b) return tonumber(a.data.date) > tonumber(b.data.date) end
local function create(...)
local function idSort(a,b) return a.id < b.id end
local function dateSort(a,b) return tonumber(a.data.date) > tonumber(b.data.date) end
local function create(...)
@/lua/ge/extensions/flowgraph/manager.lua
graph.name = data.name or graph.name
--oldIdMap[tonumber(graphId)] = graph
node:__onDeserialized(data.node)
for i = 1, self.selectedNodeCount do
self.selectedNodes[tonumber(selectNodeIdArray[i])] = 1
end
for i = 1, self.selectedLinkCount do
self.selectedLinks[tonumber(selectLinkIdArray[i])] = 1
local isHidden = self:findLinkIdFromHiddenLinkId(tonumber(selectLinkIdArray[i]))
self.selectedLinks[tonumber(selectLinkIdArray[i])] = 1
local isHidden = self:findLinkIdFromHiddenLinkId(tonumber(selectLinkIdArray[i]))
if isHidden then
for _, mID in ipairs(dependencyMap) do
local macroID = self:getGraphNodeOffset() + tonumber(mID)
local macroData = data.macros[mID]
local macroData = data.macros[mID]
local macro = self:createGraph("empty", true, tonumber(macroID))
macro:_onDeserialized(macroData)
--print("Deserialized macro " .. macro.name)
--oldIdMap[tonumber(macroID)] = macro
self.macros[macro.id] = macro
newGraphs[cId] = c
c.parentId = tonumber(gId) + self:getGraphNodeOffset()
doFlatten = true -- continue to flatten
local graphData = data.graphs[graphId]
local grId = tonumber(graphId) + self:getGraphNodeOffset()
if graphData.macroID then
if graphData.macroID then
local cGraph = self:createInstanceFromMacro(self.macros[tonumber(graphData.macroID) + self:getGraphNodeOffset()], nil, tonumber(grId))
cGraph.parentId = graphData.parentId + self:getGraphNodeOffset()
if graphData.macroID then
local cGraph = self:createInstanceFromMacro(self.macros[tonumber(graphData.macroID) + self:getGraphNodeOffset()], nil, tonumber(grId))
cGraph.parentId = graphData.parentId + self:getGraphNodeOffset()
graph:_onDeserialized(graphData)
-- oldIdMap[tonumber(graphId)] = graph
if data.activeGraphId and tonumber(grId) == data.activeGraphId then
-- oldIdMap[tonumber(graphId)] = graph
if data.activeGraphId and tonumber(grId) == data.activeGraphId then
activeGraphSet = true
@/lua/common/libs/lua-websockets/websocket/tools.lua
if not uri or uri == '' then uri = '/' end
return protocol, host, tonumber(port), uri
end
@/gameplay/missionTypes/aiRace/customNodes/autoStartPositionsNode.lua
local index = string.match(sp.name, '%d+') -- gets the number from the name
if index and tonumber(index) == i then
sp:moveResetVehicleTo(vehId, false, true)
@/lua/common/extensions/ui/improfiler.lua
key_stack = key_stack:gsub("%[builtin#(%d+)%]", function(x)
return vmdef.ffnames[tonumber(x)]
end)
if not fl then fl = {}; files[file] = fl; files[#files+1] = file end
line = tonumber(line)
fl[line] = prof_raw and v or pct
prof_min = 3
mode = mode:gsub("m(%d+)", function(s) prof_min = tonumber(s); return "" end)
prof_depth = 10
prof_depth = 10
mode = mode:gsub("%-?%d+", function(s) prof_depth = tonumber(s); return "" end)
local m = {}
@/lua/vehicle/bdebugImpl.lua
if partsSelected[beam.partPath or v.config.partsTree.partPath] then
local val = tonumber(beam[modeName])
if val then
if partsSelected[torbar.partPath or v.config.partsTree.partPath] then
local val = tonumber(torbar[modeName])
@/lua/ge/extensions/editor/scriptAIEditor.lua
-- Rounding functions.
local function round1(n) return tonumber(string.format("%.1f", n)) end
local function round2(n) return tonumber(string.format("%.2f", n)) end
local function round1(n) return tonumber(string.format("%.1f", n)) end
local function round2(n) return tonumber(string.format("%.2f", n)) end
@/lua/ge/extensions/editor/api/preferencesRegistry.lua
then
itemVal = tonumber(itemVal)
elseif item.type == "bool" then
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
local dashIndex = string.find(name,"-")
return tonumber(string.match (name, "%d+",dashIndex)),tonumber(string.match (name, "%d+"))
end
local dashIndex = string.find(name,"-")
return tonumber(string.match (name, "%d+",dashIndex)),tonumber(string.match (name, "%d+"))
end
for str in string.gmatch(color, "([^' ']+)") do
t[i] = tonumber(str)
i = i + 1
local dashIndex = string.find(name,"x")
return tonumber(string.match (name, "%d+")),tonumber(string.match (name, "%d+",dashIndex))
end
local dashIndex = string.find(name,"x")
return tonumber(string.match (name, "%d+")),tonumber(string.match (name, "%d+",dashIndex))
end
@/lua/ge/extensions/core/settings/graphic.lua
if count == 6 then
if tonumber( entries[1] ) then vm.width = tonumber( entries[1] ) end
if tonumber( entries[2] ) then vm.height = tonumber( entries[2] ) end
if count == 6 then
if tonumber( entries[1] ) then vm.width = tonumber( entries[1] ) end
if tonumber( entries[2] ) then vm.height = tonumber( entries[2] ) end
if tonumber( entries[1] ) then vm.width = tonumber( entries[1] ) end
if tonumber( entries[2] ) then vm.height = tonumber( entries[2] ) end
if tonumber( entries[4] ) then vm.bitDepth = tonumber( entries[4] ) end
if tonumber( entries[1] ) then vm.width = tonumber( entries[1] ) end
if tonumber( entries[2] ) then vm.height = tonumber( entries[2] ) end
if tonumber( entries[4] ) then vm.bitDepth = tonumber( entries[4] ) end
if tonumber( entries[2] ) then vm.height = tonumber( entries[2] ) end
if tonumber( entries[4] ) then vm.bitDepth = tonumber( entries[4] ) end
if tonumber( entries[5] ) then vm.refreshRate = tonumber( entries[5] ) end
if tonumber( entries[2] ) then vm.height = tonumber( entries[2] ) end
if tonumber( entries[4] ) then vm.bitDepth = tonumber( entries[4] ) end
if tonumber( entries[5] ) then vm.refreshRate = tonumber( entries[5] ) end
if tonumber( entries[4] ) then vm.bitDepth = tonumber( entries[4] ) end
if tonumber( entries[5] ) then vm.refreshRate = tonumber( entries[5] ) end
if tonumber( entries[6] ) then vm.antialiasLevel = tonumber( entries[6] ) end
if tonumber( entries[4] ) then vm.bitDepth = tonumber( entries[4] ) end
if tonumber( entries[5] ) then vm.refreshRate = tonumber( entries[5] ) end
if tonumber( entries[6] ) then vm.antialiasLevel = tonumber( entries[6] ) end
if tonumber( entries[5] ) then vm.refreshRate = tonumber( entries[5] ) end
if tonumber( entries[6] ) then vm.antialiasLevel = tonumber( entries[6] ) end
if tonumber( entries[5] ) then vm.refreshRate = tonumber( entries[5] ) end
if tonumber( entries[6] ) then vm.antialiasLevel = tonumber( entries[6] ) end
local function getAspectRatio( w, h )
if tonumber(w) and tonumber(h) then
local aspects = {{w=3,h=2}, {w=4,h=3}, {w=5,h=4}, {w=16,h=9}, {w=16,h=10}, {w=21,h=9}}
local function getAspectRatio( w, h )
if tonumber(w) and tonumber(h) then
local aspects = {{w=3,h=2}, {w=4,h=3}, {w=5,h=4}, {w=16,h=9}, {w=16,h=10}, {w=21,h=9}}
o.GraphicDisplayResolutions.width, o.GraphicDisplayResolutions.height = value:match(' *(%d*) +(%d*)')
o.GraphicDisplayResolutions.width = tonumber(o.GraphicDisplayResolutions.width) or 1280
o.GraphicDisplayResolutions.height = tonumber(o.GraphicDisplayResolutions.height) or 720
o.GraphicDisplayResolutions.width = tonumber(o.GraphicDisplayResolutions.width) or 1280
o.GraphicDisplayResolutions.height = tonumber(o.GraphicDisplayResolutions.height) or 720
end,
o.GraphicDisplayResolutions.width, o.GraphicDisplayResolutions.height = value:match(' *(%d*) +(%d*)')
o.GraphicDisplayResolutions.width = tonumber(o.GraphicDisplayResolutions.width) or 1280
o.GraphicDisplayResolutions.height = tonumber(o.GraphicDisplayResolutions.height) or 720
o.GraphicDisplayResolutions.width = tonumber(o.GraphicDisplayResolutions.width) or 1280
o.GraphicDisplayResolutions.height = tonumber(o.GraphicDisplayResolutions.height) or 720
end,
if value then
o.GraphicDisplayRefreshRates.hertz = tonumber(value)
end
get = function ()
local v = tonumber( TorqueScriptLua.getVar('$video::vsync') )
return v == true or (type(v)=="number" and v > 0)
if not FXAA_PostEffect then return end
if tonumber(value) == 0 then
SMAA_PostEffect:disable()
get = function ()
return tonumber( TorqueScriptLua.getVar( '$pref::Video::defaultAnisotropy' ) )
end,
-- log('I','graphic',' setting GraphicOverallQuality = '..tostring(value))
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
end
set = function ( value )
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
end
set = function ( value )
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
end
set = function ( value )
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
end
set = function ( value )
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
end
set = function ( value )
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
if type(value) == 'string' and tonumber(value) then
value = tonumber(value)
end
get = function ()
return tonumber( TorqueScriptLua.getVar( '$pref::BeamNGVehicle::dynamicReflection::facesPerUpdate' ) )
end,
get = function ()
return tonumber( TorqueScriptLua.getVar( '$pref::BeamNGVehicle::dynamicReflection::detail' ) )
end,
get = function ()
return tonumber( TorqueScriptLua.getVar( '$pref::BeamNGVehicle::dynamicReflection::distance' ) )
end,
get = function ()
local value = math.log(tonumber( TorqueScriptLua.getVar( '$pref::BeamNGVehicle::dynamicReflection::textureSize' ) ) )/math.log( 2 )
return value - 7
get = function ()
return tonumber( TorqueScriptLua.getVar( '$pref::BeamNGVehicle::dynamicMirrors::detail' ) )
end,
get = function ()
return tonumber( TorqueScriptLua.getVar( '$pref::BeamNGVehicle::dynamicMirrors::distance' ) )
end,
get = function ()
local value = math.log(tonumber( TorqueScriptLua.getVar( '$pref::BeamNGVehicle::dynamicMirrors::textureSize' ) ) )/math.log( 2 )
return value - 7
get = function ()
return tonumber( TorqueScriptLua.getVar( '$pref::GroundCover::densityScale' ))
end,
get = function ()
return tonumber( TorqueScriptLua.getVar( '$pref::TS::maxDecalCount' ))
end,
@/lua/ge/extensions/editor/mainToolbar.lua
for i, val in pairs(gridSnapWidgetsComboItemsTbl) do
if tonumber(val) == gridSize then gridSnapComboItemCurrent[0] = i - 1 end
end
if im.Combo1("##gridsize", gridSnapComboItemCurrent, gridSnapWidgetsComboItems) then
local size = tonumber(gridSnapWidgetsComboItemsTbl[gridSnapComboItemCurrent[0] + 1])
worldEditorCppApi.setGridSnap(gridSnapEnabled, size)
for i, val in pairs(rotateSnapWidgetsComboItemsTbl) do
if tonumber(val) == rotateSnapSize then rotateSnapComboItemCurrent[0] = i - 1 end
end
if im.Combo1("##rotateSnapSize", rotateSnapComboItemCurrent, rotateSnapWidgetsComboItems) then
local size = tonumber(rotateSnapWidgetsComboItemsTbl[rotateSnapComboItemCurrent[0] + 1])
worldEditorCppApi.setRotateSnap(rotateSnapEnabled, size)
@/lua/ge/extensions/flowgraph/variableStorage.lua
elseif type == 'number' then
self.variables[name].baseValue = tonumber(self.variables[name].baseValue) or 0
self.variables[name].value = tonumber(self.variables[name].value) or 0
self.variables[name].baseValue = tonumber(self.variables[name].baseValue) or 0
self.variables[name].value = tonumber(self.variables[name].value) or 0
elseif type == 'vec3' then
@/lua/ge/extensions/editor/gen/world.lua
if #atkn == 2 then
w,h = atkn[1] and tonumber(atkn[1]) or nil,atkn[2] and tonumber(atkn[2]) or nil
end
if #atkn == 2 then
w,h = atkn[1] and tonumber(atkn[1]) or nil,atkn[2] and tonumber(atkn[2]) or nil
end
for c in tb:getField('position',0):gmatch("%S+") do
apos[#apos+1] = tonumber(c)
end
for _,key in pairs(f) do
if not tonumber(key) then
return desc.aspline[i][key],{i,key}
for id,d in pairs(jdesc) do
lo('?? for_desc:'..id..':'..tostring(adesc[tonumber(id)]))
local cid = tonumber(id)
lo('?? for_desc:'..id..':'..tostring(adesc[tonumber(id)]))
local cid = tonumber(id)
adesc[cid] = U.fromJSON(d)
for j,p in pairs(s) do
if s[j..''] and tonumber(j) then
s[tonumber(j)] = s[j..'']
if s[j..''] and tonumber(j) then
s[tonumber(j)] = s[j..'']
s[j..''] = nil
local desc = W.houseUp(nil, id)
desc.idpersist = tonumber(U.split(nm, '_', true)[2])
desc.idstatic = idstat
for _,o in pairs(list) do
local om = scenetree.findObjectById(tonumber(o))
if om then
-- U.dump(ijmask, '?? mu_ij0:'..scope..':'..ij[1]..':'..ij[2]..':'..tostring(forall))
if not tonumber(ij[2]) then
local H = forHeight(desc.afloor,ij[1]-1)
if not desc then
lo('!! houseUp_NODESC:'..tostring(toedit)..':'..tableSize(adesc)..':'..tostring(adesc[tonumber(toedit)])..':'..tostring(adesc[toedit..'']))
-- for k,d in pairs(adesc) do
for key,p in pairs(list) do
-- lo('?? if_key:'..tostring(key)..':'..tostring(tonumber(key)))
if tonumber(key) then
-- lo('?? if_key:'..tostring(key)..':'..tostring(tonumber(key)))
if tonumber(key) then
list[tonumber(key)] = p
if tonumber(key) then
list[tonumber(key)] = p
-- list[key] = nil
forBuilding(adesc[cedit.mesh], function(w, ij)
if not tonumber(ij[2]) then
local s = adesc[cedit.mesh].aspline[ij[1]][ij[2]]
if iforest then return end
if not tonumber(ij[2]) then
-- w = desc.aspline[ij[1]][ij[2]]
-- lo('?? for_SPLINE:'..i..':'..key..':'.._)
if not tonumber(key) and desc.aspline[i][key] then
lo('??^^^^^^^^^^^^^^^^ for22_SPLINE:'..i..':'..key..':'.._..':'..tostring(cedit.mesh))
forBuilding(adesc[cedit.mesh], function(w,ij)
if not tonumber(ij[2]) then
local s = adesc[cedit.mesh].selection[ij[1] ][ij[2] ]
-- lo('?? if_SPL:'..tostring(s))
if not tonumber(key) and desc.aspline[i] then
local s = desc.aspline[i][key]
-- lo('?? for_IJ:'..ij[2])
if not tonumber(ij[2]) then
if not cedit.cval['DragPos'] then
for _,key in pairs(f) do
if not tonumber(key) then
local s = desc.aspline[i][key]
forBuilding(adesc[cedit.mesh], function(w, ij)
if not tonumber(ij[2]) then
lo('??^^^^^^^^^^^^^^ from_SPLINE:'..tostring(sij)..':'..tostring(dae))
if cij[2] and tonumber(cij[2]) then
if cij[2] <= #desc.afloor[cij[1]].awall then
lo('?? degree:'..tostring(val))
W.onVal('building_ang', tonumber(val))
end
val = atoken[ind+1]
lo('?? floor_num:'..tostring(val)) --..':'..tostring(tonumber(val)))
if val == 'first' then
if ind then
val = tonumber(atoken[ind-1])
lo('?? for_height2:'..tostring(val))
for j,pth in pairs(row) do
-- if not tonumber(j) and j ~= 'len' then
-- lo('?? in_SSS:'..j)
-- if j == 'len' then
if not tonumber(j) then
goto continue
return yes and ({shed=1,gable=1})[floor.top.shape] ~= nil
elseif tp == 'pilaster' and cij and cij[2] and tonumber(cij[2]) then
if scope == 'wall' and not adesc[cedit.mesh].afloor[cij[1]].awall[cij[2]].doorind then
for _,o in pairs(list) do
local om = scenetree.findObjectById(tonumber(o))
lo('?? if_DEL:'..tostring(o)..':'..tostring(om))
local nm = U.split(atoken[#atoken], '.', true)[1]
local id = tonumber(U.split(nm,'_',true)[2])
if not dpos[id] then dpos[id] = {} end
forBuilding(desc, function(w, ij)
if not tonumber(ij[2]) then
local s = desc.aspline[ij[1]][ij[2]]
forBuilding(desc, function(w, ij)
if not tonumber(ij[2]) then
local s = desc.aspline[ij[1]][ij[2]]
forBuilding(desc, function(w, ij)
if not tonumber(ij[2]) then
-- U.dump(desc.aspline,'?? win_bot:'..ij[2])
@/lua/ge/extensions/core/vehicle/colors.lua
for i,v in ipairs(stringToTable(colorString, '%s')) do
result[i] = tonumber(v)
end
@/lua/ge/extensions/editor/objectToSplineEditor.lua
local newIds = {}
local newGroup = scenetree.findObjectById(tonumber(obj:getField("parentGroup", 0)))
local groupId
@/lua/ge/extensions/career/modules/inventory.lua
if inventoryData then
vehicleToEnterId = tonumber(inventoryData.currentVehicle)
lastVehicle = tonumber(inventoryData.lastVehicle)
vehicleToEnterId = tonumber(inventoryData.currentVehicle)
lastVehicle = tonumber(inventoryData.lastVehicle)
favoriteVehicle = tonumber(inventoryData.favoriteVehicle)
lastVehicle = tonumber(inventoryData.lastVehicle)
favoriteVehicle = tonumber(inventoryData.favoriteVehicle)
for inventoryId, transform in pairs(inventoryData.spawnedPlayerVehicles) do
inventoryId = tonumber(inventoryId)
if not saveAnyVehiclePosDEBUG then
local fileNameNoExt = string.sub(filename, 1, -6)
local inventoryId = tonumber(fileNameNoExt)
if not vehicles[inventoryId] then
@/lua/common/libs/lunajson/lunajson/sax.lua
fixedtonumber = function(s)
return tonumber(gsub(s, '.', radixmark))
end
@/lua/ge/extensions/editor/materialEditor.lua
local version = tonumber(mat:getField("version", 0)) or 0
local layers
else
layers = tonumber(mat.activeLayers) or 1
if layers < 1 then layers = 1 end
local layers = tonumber(currentMaterial.activeLayers) or 1
if layers < 1 then layers = 1 end
local isVehicleMat = (string.find(matFile, "/vehicles/", 1, true) ~= nil)
local version = tonumber(currentMaterial:getField("version", 0)) or 0
"TSStatic: %d ForestItemData: %d",
tonumber(data.total or 0) or 0,
tonumber(data.forestTotal or 0) or 0
tonumber(data.total or 0) or 0,
tonumber(data.forestTotal or 0) or 0
))
if im.Combo1("##" .. label .. property .. tostring(layer), editor.getTempInt_StringString(index), cptr) then
setPropertyWithUndo(property, layer, items[tonumber(editor.getTempInt_StringString()) + 1])
end
-- Version
local version = tonumber(currentMaterial:getField('version', 0))
im.TextUnformatted("Version")
local function alphaBlendCombo()
local version = tonumber(currentMaterial:getField('version', 0)) or 1
if im.Combo1("##Alpha Blend Mode_translucent0", editor.getTempInt_StringString(index), cptr) then
local value = items[tonumber(editor.getTempInt_StringString()) + 1]
if value == "None" then
local version = tonumber(currentMaterial:getField("version", 0))
if version then
@/lua/ge/extensions/editor/driftDataEditor.lua
if im.Combo2(stuntZonePreset.absolute and "Points" or "Max points", presetPtr, s) then
elem.score = stuntZonePreset.presets[tonumber(presetPtr[0]) + 1]
end
@/lua/ge/extensions/flowgraph/basenode.lua
im.Separator()
im.Text("Triggered: " .. tonumber(self.triggerCount))
im.Text("Worked: " .. tonumber(self.workCount))
im.Text("Triggered: " .. tonumber(self.triggerCount))
im.Text("Worked: " .. tonumber(self.workCount))
end
@/lua/ge/extensions/ui/gameplaySelector/tileGenerators/scenarioTiles.lua
sourceIcons = {},
order = -tonumber(scenario.date or 0) or 0,
isLegacy = true,
validBackends = {gameplaySelector = true},
date = tonumber(scenario.date),
}
@/lua/ge/client/parseArgs.lua
M.args = {}
local argumentCount = tonumber(getConsoleVariable("$Game::argc"))
-- log('I','parse','$Game::argv = '..getConsoleVariable("$Game::argv")..' argumentCount: '..tostring(argumentCount))
@/lua/ge/client/postFx/dof.lua
local function setFocusParams(dof, nearBlurMax, farBlurMax, minRange, maxRange, nearSlope, farSlope )
dof.nearBlurMax = clamp(tonumber(nearBlurMax), 0.0, 1.0)
dof.farBlurMax = clamp(tonumber(farBlurMax) , 0.0, 1.0)
dof.nearBlurMax = clamp(tonumber(nearBlurMax), 0.0, 1.0)
dof.farBlurMax = clamp(tonumber(farBlurMax) , 0.0, 1.0)
dof.minRange = tonumber(minRange)
dof.farBlurMax = clamp(tonumber(farBlurMax) , 0.0, 1.0)
dof.minRange = tonumber(minRange)
dof.maxRange = tonumber(maxRange)
dof.minRange = tonumber(minRange)
dof.maxRange = tonumber(maxRange)
dof.nearSlope = tonumber(nearSlope)
dof.maxRange = tonumber(maxRange)
dof.nearSlope = tonumber(nearSlope)
dof.farSlope = tonumber(farSlope)
dof.nearSlope = tonumber(nearSlope)
dof.farSlope = tonumber(farSlope)
end
local direction = vec3(core_camera.getForward())
local farDist = tonumber(TorqueScriptLua.getVar("$Param::FarDist"))
local endPoint = camPos + farDist * direction
local m1 = tonumber(TorqueScriptLua.getVar("$TypeMasks::StaticObjectType"))
local m2 = tonumber(TorqueScriptLua.getVar("$TypeMasks::TerrainObjectType"))
local m1 = tonumber(TorqueScriptLua.getVar("$TypeMasks::StaticObjectType"))
local m2 = tonumber(TorqueScriptLua.getVar("$TypeMasks::TerrainObjectType"))
local m3 = tonumber(TorqueScriptLua.getVar("$TypeMasks::VehicleObjectType"))
local m2 = tonumber(TorqueScriptLua.getVar("$TypeMasks::TerrainObjectType"))
local m3 = tonumber(TorqueScriptLua.getVar("$TypeMasks::VehicleObjectType"))
local m4 = tonumber(TorqueScriptLua.getVar("$TypeMasks::DynamicShapeObjectType"))
local m3 = tonumber(TorqueScriptLua.getVar("$TypeMasks::VehicleObjectType"))
local m4 = tonumber(TorqueScriptLua.getVar("$TypeMasks::DynamicShapeObjectType"))
local mask = m1 + m2 + m3 + m4
local hitPos = vec3(tonumber(resultArgs[2]), tonumber(resultArgs[3]), tonumber(resultArgs[4]))
return (hitPos - camPos):length()
local hitPos = vec3(tonumber(resultArgs[2]), tonumber(resultArgs[3]), tonumber(resultArgs[4]))
return (hitPos - camPos):length()
local hitPos = vec3(tonumber(resultArgs[2]), tonumber(resultArgs[3]), tonumber(resultArgs[4]))
return (hitPos - camPos):length()
local farDist = tonumber(TorqueScriptLua.getVar("$Param::FarDist"))
local fd = dofPostEffect.focalDist / farDist
@/lua/ge/extensions/career/modules/marketplace.lua
local function makeNegotiationOffer(price)
return makeOffer(tonumber(price))
end
@/lua/vehicle/jbeam/stage2.lua
if type(beam.beamStrength) == 'string' then
if tostring(beam.beamStrength) ~= tostring(tonumber(beam.beamStrength)) then
log('E', "jbeam.pushToPhysics", "String value used on beamStrength property of beam on nodes: " ..(vehicle.nodes[beam.id1].name or '-')..' and '..(vehicle.nodes[beam.id2].name or '-') .. ': \'' .. tostring(beam.beamStrength) .. '\' = ' .. tonumber(beam.beamStrength))
if tostring(beam.beamStrength) ~= tostring(tonumber(beam.beamStrength)) then
log('E', "jbeam.pushToPhysics", "String value used on beamStrength property of beam on nodes: " ..(vehicle.nodes[beam.id1].name or '-')..' and '..(vehicle.nodes[beam.id2].name or '-') .. ': \'' .. tostring(beam.beamStrength) .. '\' = ' .. tonumber(beam.beamStrength))
else
else
log('W', "jbeam.pushToPhysics", "String value used on beamStrength property of beam on nodes: " ..(vehicle.nodes[beam.id1].name or '-')..' and '..(vehicle.nodes[beam.id2].name or '-') .. ': \'' .. tostring(beam.beamStrength) .. '\' = ' .. tonumber(beam.beamStrength))
end
end
beam.beamStrength = tonumber(beam.beamStrength)
end
if type(beam.beamDamp) == 'string' then
if tostring(beam.beamDamp) ~= tostring(tonumber(beam.beamDamp)) then
log('E', "jbeam.pushToPhysics", "String value used on beamDamp property of beam on nodes: " ..(vehicle.nodes[beam.id1].name or '-')..' and '..(vehicle.nodes[beam.id2].name or '-') .. ': \'' .. tostring(beam.beamDamp) .. '\' = ' .. tonumber(beam.beamDamp))
if tostring(beam.beamDamp) ~= tostring(tonumber(beam.beamDamp)) then
log('E', "jbeam.pushToPhysics", "String value used on beamDamp property of beam on nodes: " ..(vehicle.nodes[beam.id1].name or '-')..' and '..(vehicle.nodes[beam.id2].name or '-') .. ': \'' .. tostring(beam.beamDamp) .. '\' = ' .. tonumber(beam.beamDamp))
else
else
log('W', "jbeam.pushToPhysics", "String value used on beamDamp property of beam on nodes: " ..(vehicle.nodes[beam.id1].name or '-')..' and '..(vehicle.nodes[beam.id2].name or '-') .. ': \'' .. tostring(beam.beamDamp) .. '\' = ' .. tonumber(beam.beamDamp))
end
end
beam.beamDamp = tonumber(beam.beamDamp)
end
if type(beam.beamDeform) == 'string' then
if tostring(beam.beamDeform) ~= tostring(tonumber(beam.beamDeform)) then
log('E', "jbeam.pushToPhysics", "String value used on beamDeform property of beam on nodes: " ..(vehicle.nodes[beam.id1].name or '-')..' and '..(vehicle.nodes[beam.id2].name or '-') .. ': \'' .. tostring(beam.beamDeform) .. '\' = ' .. tonumber(beam.beamDeform))
if tostring(beam.beamDeform) ~= tostring(tonumber(beam.beamDeform)) then
log('E', "jbeam.pushToPhysics", "String value used on beamDeform property of beam on nodes: " ..(vehicle.nodes[beam.id1].name or '-')..' and '..(vehicle.nodes[beam.id2].name or '-') .. ': \'' .. tostring(beam.beamDeform) .. '\' = ' .. tonumber(beam.beamDeform))
else
else
log('W', "jbeam.pushToPhysics", "String value used on beamDeform property of beam on nodes: " ..(vehicle.nodes[beam.id1].name or '-')..' and '..(vehicle.nodes[beam.id2].name or '-') .. ': \'' .. tostring(beam.beamDeform) .. '\' = ' .. tonumber(beam.beamDeform))
end
end
beam.beamDeform = tonumber(beam.beamDeform)
end
if beam.deformationTriggerRatio ~= nil and beam.deformationTriggerRatio ~= "" then
obj:setBeamDeformationTriggerRatio(bid, tonumber(beam.deformationTriggerRatio))
end
@/lua/ge/extensions/editor/missionPlaybook/missionTreeViewer.lua
ui_flowgraph_editor.End()
if (bit.band(tonumber(ui_flowgraph_editor.GetDirtyReason()), ui_flowgraph_editor.Dirty_Position) ~= 0) then
dump("AD")
@/gameplay/missionTypes/evade/customNodes/autoStartPositionsNode.lua
local index = string.match(sp.name, '%d+')
if index and tonumber(index) == i then
sp:moveResetVehicleTo(vehId, false, true)
@/lua/common/libs/LuaIRC/handlers.lua
handlers["333"] = function(o, prefix, me, channel, nick, time)
o:invoke("OnTopicInfo", channel, nick, tonumber(time))
end
@/lua/ge/extensions/gameplay/missions/missions.lua
mission.official = mission.official or isOfficialContentVPath(mission.missionFolder)
mission.date = tonumber(mission.date) or 0
end
table.insert(defaultStarKeys, {tonumber(idx), key})
end
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/rallySuperCountdown.lua
-- Prefix numeric messages with "Countdown: "
local msgForDisplay = tonumber(msgStr) and ("Countdown: " .. msgStr) or msgStr
@/lua/vehicle/powertrain/nitrousOxideInjection.lua
nitrousOxideOverrideTorqueLookup = {}
local addedPower = (tonumber(data.addedPower or 0)) * 1000
cutInRPM = min(max(tonumber(data.cutInRPM) or assignedEngine.idleRPM, 1), assignedEngine.maxRPM * 0.9)
local addedPower = (tonumber(data.addedPower or 0)) * 1000
cutInRPM = min(max(tonumber(data.cutInRPM) or assignedEngine.idleRPM, 1), assignedEngine.maxRPM * 0.9)
local cutInRange = data.cutInRange or 50
noActiveName = data.electricsActiveName or "nitrousOxideActive"
minimumGear = tonumber(data.minimumGear) or 0
volumeCoef = data.volumeCoef or 1.5
@/lua/ge/extensions/scenario/quickRaceLoader.lua
--file.raceFile = "/levels/"..levelName.."/quickrace/"..file.trackName..'.json'
file.difficulty = file.difficulty and tonumber(file.difficulty) or nil
file.prefabs = file.prefabs or {}
@/lua/common/libs/LuLPeg/lulpeg.lua
if d == "%" then return "%" end
d = tonumber(d)
if not cached[d] then
@/lua/ge/extensions/tech/capturePlayer.lua
elseif state == TIMESTAMP then
timestamp = tonumber(line)
elseif state == PAYLOAD then
else
local port = tonumber(ctx)
if not captureState.portToVid[port] then
elseif state == TIMESTAMP then
captureTimestamp = tonumber(line)
local realTimestamp = os.clockhp()
@/lua/ge/extensions/editor/roadSpline/import.lua
material = road.material,
renderPriority = tonumber(road.renderPriority),
isTrackWidth = isTrackWidth,
position = lateralOffset,
texLen = tonumber(road.textureLength),
fadeIn = road.startEndFade.x,
@/lua/ge/extensions/core/input/bindings.lua
-- fix numbers that are sent as strings by UI side (typically md-select widgets are messing this up)
binding.filterType = tonumber(binding.filterType)
binding.lockType = tonumber(binding.lockType)
binding.filterType = tonumber(binding.filterType)
binding.lockType = tonumber(binding.lockType)
if binding.ffb then
if binding.ffb then
binding.ffb.updateType = tonumber(binding.ffb.updateType)
binding.ffb.frequency = tonumber(binding.ffb.frequency)
binding.ffb.updateType = tonumber(binding.ffb.updateType)
binding.ffb.frequency = tonumber(binding.ffb.frequency)
end
binding.deadzone.begin = nil -- remove deprecated field
if binding.deadzone["end"] then binding.deadzone["end"] = tonumber(binding.deadzone["end"]) end
if binding.deadzone["end"] and not binding.deadzoneResting then binding.deadzoneResting = binding.deadzone["end"] end
if binding.deadzone["end"] and not binding.deadzoneResting then binding.deadzoneResting = binding.deadzone["end"] end
if binding.deadzoneResting then binding.deadzoneResting = tonumber(binding.deadzoneResting) end
if binding.deadzoneEnd then binding.deadzoneEnd = tonumber(binding.deadzoneEnd) end
if binding.deadzoneResting then binding.deadzoneResting = tonumber(binding.deadzoneResting) end
if binding.deadzoneEnd then binding.deadzoneEnd = tonumber(binding.deadzoneEnd) end
binding.deadzone = nil -- remove deprecated field
if field ~= "" then
local v = tonumber(field)
if v then
local a, b = s:match("^(%d+)%.(%d+)")
return tonumber(a), tonumber(b)
end
local a, b = s:match("^(%d+)%.(%d+)")
return tonumber(a), tonumber(b)
end
@/lua/common/utils/dateUtils.lua
if ap == "A" and hour == "12" then hour = 0 end
if ap == "P" and hour ~= "12" then hour = tonumber(hour) + 12 end
end
return os.time({
year = tonumber(year),
month = tonumber(month),
year = tonumber(year),
month = tonumber(month),
day = tonumber(day),
month = tonumber(month),
day = tonumber(day),
hour = tonumber(hour),
day = tonumber(day),
hour = tonumber(hour),
min = tonumber(min),
hour = tonumber(hour),
min = tonumber(min),
sec = tonumber(sec),
min = tonumber(min),
sec = tonumber(sec),
isdst = false
@/lua/ge/extensions/gameplay/missions/progress.lua
if col.customValue then
table.insert(row, { text = tonumber(count) })
else
@/lua/common/utils.lua
v = v:gsub("#","")
return color(tonumber("0x"..v:sub(1,2)), tonumber("0x"..v:sub(3,4)), tonumber("0x"..v:sub(5,6)), tonumber("0x"..v:sub(7,8)))
elseif v == nil then
v = v:gsub("#","")
return color(tonumber("0x"..v:sub(1,2)), tonumber("0x"..v:sub(3,4)), tonumber("0x"..v:sub(5,6)), tonumber("0x"..v:sub(7,8)))
elseif v == nil then
v = v:gsub("#","")
return color(tonumber("0x"..v:sub(1,2)), tonumber("0x"..v:sub(3,4)), tonumber("0x"..v:sub(5,6)), tonumber("0x"..v:sub(7,8)))
elseif v == nil then
v = v:gsub("#","")
return color(tonumber("0x"..v:sub(1,2)), tonumber("0x"..v:sub(3,4)), tonumber("0x"..v:sub(5,6)), tonumber("0x"..v:sub(7,8)))
elseif v == nil then
value = trim(value)
if tonumber(value) then
value = tonumber(value)
if tonumber(value) then
value = tonumber(value)
elseif value == "true" then
@/lua/vehicle/extensions/profiling/p.lua
key_stack = key_stack:gsub("%[builtin#(%d+)%]", function(x)
return vmdef.ffnames[tonumber(x)]
end)
if fl then
line = tonumber(line)
fl[line] = prof_raw and v or pct
prof_min = 3
mode = mode:gsub("m(%d+)", function(s) prof_min = tonumber(s); return "" end)
prof_depth = 1
prof_depth = 1
mode = mode:gsub("%-?%d+", function(s) prof_depth = tonumber(s); return "" end)
local m = {}
@/lua/ge/extensions/gameplay/discover/discover_038.lua
for _, vehId in ipairs(scenetree.findClassObjects("BeamNGVehicle")) do
local vehicle = scenetree.findObjectById(tonumber(vehId))
local name = vehicle:getInternalName()
for _, vehId in ipairs(scenetree.findClassObjects("BeamNGVehicle")) do
local vehicle = scenetree.findObjectById(tonumber(vehId))
local name = vehicle:getInternalName()
@/lua/ge/extensions/core/vehicles.lua
if shouldBeNumberLookup[key] and type(value) ~= "number" then
newData[key] = tonumber(value)
if newData[key] == nil then
elseif type(value) == "table" and (type(value.min) ~= "number" or type(value.max) ~= "number") then
newData[key] = {min = tonumber(value.min), max = tonumber(value.max)}
if newData[key].min == nil or newData[key].max == nil then
elseif type(value) == "table" and (type(value.min) ~= "number" or type(value.max) ~= "number") then
newData[key] = {min = tonumber(value.min), max = tonumber(value.max)}
if newData[key].min == nil or newData[key].max == nil then
local colorTable = stringToTable(data)
color.x = tonumber(colorTable[1])
color.y = tonumber(colorTable[2])
color.x = tonumber(colorTable[1])
color.y = tonumber(colorTable[2])
color.z = tonumber(colorTable[3])
color.y = tonumber(colorTable[2])
color.z = tonumber(colorTable[3])
color.w = tonumber(colorTable[4])
color.z = tonumber(colorTable[3])
color.w = tonumber(colorTable[4])
metallicData[1] = tonumber(colorTable[5])
color.w = tonumber(colorTable[4])
metallicData[1] = tonumber(colorTable[5])
metallicData[2] = tonumber(colorTable[6])
metallicData[1] = tonumber(colorTable[5])
metallicData[2] = tonumber(colorTable[6])
metallicData[3] = tonumber(colorTable[7])
metallicData[2] = tonumber(colorTable[6])
metallicData[3] = tonumber(colorTable[7])
metallicData[4] = tonumber(colorTable[8])
metallicData[3] = tonumber(colorTable[7])
metallicData[4] = tonumber(colorTable[8])
-- log('I','convert', name..' colorTable: '..dumps(colorTable)..' color: '..dumps(color)..' metallicData: '..dumps(metallicData))
@/lua/ge/extensions/editor/resourceChecker/resourceUtil.lua
elseif version == "1.5" then
local al = tonumber(mat:getField("activeLayers",0)) or 1
layers = math.max(1, al)
local name = obj:getName()
local version = tonumber(obj:getField('version', 0))
if version and version < 1.5 then
end
table.sort(shapesprepare, function(a,b) return tonumber(a[3]) > tonumber(b[3]) end)
for _,v in pairs(shapesprepare) do
end
table.sort(shapesprepare, function(a,b) return tonumber(a[3]) > tonumber(b[3]) end)
for _,v in pairs(shapesprepare) do
end
table.sort(shapesprepare, function(a,b) return tonumber(a[3]) > tonumber(b[3]) end)
for _,v in pairs(shapesprepare) do
end
table.sort(shapesprepare, function(a,b) return tonumber(a[3]) > tonumber(b[3]) end)
for _,v in pairs(shapesprepare) do
end
table.sort(shapes, function(a,b) return tonumber(a[2]) > tonumber(b[2]) end)
for k,v in pairs(shapes) do
end
table.sort(shapes, function(a,b) return tonumber(a[2]) > tonumber(b[2]) end)
for k,v in pairs(shapes) do
end
table.sort(shapes, function(a,b) return tonumber(a[2]) > tonumber(b[2]) end)
for k,v in pairs(shapes) do
end
table.sort(shapes, function(a,b) return tonumber(a[2]) > tonumber(b[2]) end)
for k,v in pairs(shapes) do
@/lua/ge/extensions/editor/flowgraphEditor.lua
local nodeId = tonumber(ui_flowgraph_editor.GetDoubleClickedNode())
if nodeId ~= 0 then
end
--print(tonumber(ui_flowgraph_editor.GetDirtyReason()))
@/lua/vehicle/controller/vehicleController/shiftLogic/automaticGearbox.lua
local minGearIndex = gearbox.minGearIndex
local numberMode = tonumber(automaticHandling.mode)
if numberMode then
automaticHandling.defaultForwardMode = mode
if automaticHandling.mode == "D" or automaticHandling.mode == "S" or tonumber(automaticHandling.mode) or string.sub(automaticHandling.mode, 1, 1) == "M" then
if mode == "M1" then --we just shifted into M1
if string.find(automaticHandling.mode, "M") then
local gearIndex = tonumber(string.sub(automaticHandling.mode, 2))
gearRatio = gearbox.gearRatios[gearIndex]
end
if tonumber(automaticHandling.mode) then
local gearIndex = tonumber(automaticHandling.mode)
if tonumber(automaticHandling.mode) then
local gearIndex = tonumber(automaticHandling.mode)
gearRatio = gearbox.gearRatios[gearIndex]
if string.find(automaticHandling.mode, "M") then
local gearIndex = tonumber(string.sub(automaticHandling.mode, 2))
gearRatio = gearbox.gearRatios[gearIndex]
end
if tonumber(automaticHandling.mode) then
local gearIndex = tonumber(automaticHandling.mode)
if tonumber(automaticHandling.mode) then
local gearIndex = tonumber(automaticHandling.mode)
gearRatio = gearbox.gearRatios[gearIndex]
@/lua/common/jbeam/slotSystem.lua
for k3, v3 in pairs(section) do
if tonumber(k3) ~= nil then
-- if its an index, append if index > 1
@/lua/ge/extensions/editor/assetDeduplicator.lua
local currentLevelId = jobData.currentLevelId
local mode = tonumber(jobData.mode) or 0
local modLink = (jobData.modLink ~= false)
local key = getKey(curPath, info)
local size = tonumber(info[2]) or 0
elseif compareFilesJob and compareFilesJob.finished and compareFilesJob.matchCount and compareFilesJob.matchSize and compareFilesJob.matches then
im.Text("It's possible to remove "..compareFilesJob.matchCount.." files.\nThis will reduce level file size by "..string.format("%.2f MB", (tonumber(compareFilesJob.matchSize) or 0)/1048576)..".")
local popupData = {}
@/lua/ge/extensions/flowgraph/nodes/util/tonumber.lua
function C:work()
self.pinOut.value.value = tonumber(self.pinIn.value.value)
end
@/lua/common/mathlib.lua
local x, y, z = s:match('([%d.+eE-]+)[,%s]+([%d.+eE-]+)[,%s]+([%d.+eE-]+)')
self.x, self.y, self.z = tonumber(x) or 0, tonumber(y) or 0, tonumber(z) or 0
return self
local x, y, z = s:match('([%d.+eE-]+)[,%s]+([%d.+eE-]+)[,%s]+([%d.+eE-]+)')
self.x, self.y, self.z = tonumber(x) or 0, tonumber(y) or 0, tonumber(z) or 0
return self
local x, y, z = s:match('([%d.+eE-]+)[,%s]+([%d.+eE-]+)[,%s]+([%d.+eE-]+)')
self.x, self.y, self.z = tonumber(x) or 0, tonumber(y) or 0, tonumber(z) or 0
return self
@/lua/common/json-ast.lua
local num_str = ctx.str:match('^[+-]?%d+%.?%d*[eE]?[+-]?%d*', ctx.pos)
local num = tonumber(num_str)
if not num then
@/lua/common/jit/p.lua
key_stack = key_stack:gsub("%[builtin#(%d+)%]", function(x)
return vmdef.ffnames[tonumber(x)]
end)
if not fl then fl = {}; files[file] = fl; files[#files+1] = file end
line = tonumber(line)
fl[line] = prof_raw and v or pct
prof_min = 3
mode = mode:gsub("m(%d+)", function(s) prof_min = tonumber(s); return "" end)
prof_depth = 1
prof_depth = 1
mode = mode:gsub("%-?%d+", function(s) prof_depth = tonumber(s); return "" end)
local m = {}
@/lua/common/lpack.lua
end
r = tonumber(sub(s, seridx + 1, i - 1))
end
@/lua/ge/server/server.lua
if i + 3 <= #cmdArgs then
local x = tonumber(cmdArgs[i + 1])
local y = tonumber(cmdArgs[i + 2])
local x = tonumber(cmdArgs[i + 1])
local y = tonumber(cmdArgs[i + 2])
local z = tonumber(cmdArgs[i + 3])
local y = tonumber(cmdArgs[i + 2])
local z = tonumber(cmdArgs[i + 3])
if x and y and z then
-- working with the server session we think we are.
local sessionCnt = (tonumber(TorqueScriptLua.getVar("$Server::Session")) or 0) +1
TorqueScriptLua.setVar("$Server::Session", sessionCnt)
@/lua/common/json.lua
end
r = tonumber(sub(s, si, i - 1))
if r == nil then
@/lua/ge/extensions/gameplay/rally/notebook/structured/libCompositor.lua
for _,entry in ipairs(valuesList) do
local value = tonumber(entry.value)
local diff = math.abs(value - targetValue)
local targetNum = tonumber(cornerSeverity)
if not targetNum or targetNum < 0 then
@/lua/ge/extensions/core/quickAccess.lua
for key, action in pairs(actions) do
local idx = tonumber(key) -- sometimes the key is a number, sometimes it's a string. stupid json
recentActions[category][idx] = action
@/lua/ge/extensions/editor/gen/terrain.lua
if to then
print('?? to_DEL:'..tostring(to)..':'..tostring(tonumber(to))..':'..to:getID())
to:delete()
@/lua/ge/extensions/util/export.lua
elseif fieldInfo.type == "float" then
local res = tonumber(value)
if res then
elseif fieldInfo.type == "bool" then
local res = tonumber(value)
if res then
local function _exportMaterial(gltfCurrentMaterial, materialObj)
gltfCurrentMaterial.version = tonumber(materialObj:getField('version', 0))
@/lua/vehicle/hydros.lua
if ffbParams.gforceCoef ~= nil then M.GforceCoef = ffbParams.gforceCoef end
if ffbParams.frequency ~= nil then frequency = tonumber(ffbParams.frequency) or 0 end
responseCorrected = ffbParams.responseCorrected == true
@/lua/common/libs/copas/copas/lock.lua
function lock.new(seconds, not_reentrant)
local timeout = tonumber(seconds or DEFAULT_TIMEOUT) or -1
if timeout < 0 then
@/lua/common/libs/luasocket/socket/url.lua
return (string.gsub(s, "%%(%x%x)", function(hex)
return string.char(base.tonumber(hex, 16))
end))
@/lua/ge/ge_utils.lua
local stringValue = getConsoleVariable( name )
local numberValue = tonumber(stringValue) or 0
return string.lower(stringValue) == "true" or numberValue ~= 0
inp = {
hours = tonumber(h) or 0,
mins = tonumber(m) or 0,
hours = tonumber(h) or 0,
mins = tonumber(m) or 0,
secs = tonumber(s) or 0
mins = tonumber(m) or 0,
secs = tonumber(s) or 0
}
local x, y, z = string.match(objPos, "([0-9]*)%s*([0-9]*)%s*([0-9]*)%s*")
objPos = vec3(tonumber(x), tonumber(y), tonumber(z))
end
local x, y, z = string.match(objPos, "([0-9]*)%s*([0-9]*)%s*([0-9]*)%s*")
objPos = vec3(tonumber(x), tonumber(y), tonumber(z))
end
local x, y, z = string.match(objPos, "([0-9]*)%s*([0-9]*)%s*([0-9]*)%s*")
objPos = vec3(tonumber(x), tonumber(y), tonumber(z))
end
local x, y, z = string.match(objScale, "([0-9]*)%s*([0-9]*)%s*([0-9]*)%s*")
objScale = vec3(tonumber(x), tonumber(y), tonumber(z))
end
local x, y, z = string.match(objScale, "([0-9]*)%s*([0-9]*)%s*([0-9]*)%s*")
objScale = vec3(tonumber(x), tonumber(y), tonumber(z))
end
local x, y, z = string.match(objScale, "([0-9]*)%s*([0-9]*)%s*([0-9]*)%s*")
objScale = vec3(tonumber(x), tonumber(y), tonumber(z))
end
metallicData = type(metallicData) == 'table' and metallicData or {}
local metallic = metallicData.metallic or tonumber(metallicData[1]) or 0.2
local roughness = metallicData.roughness or tonumber(metallicData[2]) or 0.5
local metallic = metallicData.metallic or tonumber(metallicData[1]) or 0.2
local roughness = metallicData.roughness or tonumber(metallicData[2]) or 0.5
local clearcoat = metallicData.clearcoat or tonumber(metallicData[3]) or 0.8
local roughness = metallicData.roughness or tonumber(metallicData[2]) or 0.5
local clearcoat = metallicData.clearcoat or tonumber(metallicData[3]) or 0.8
local clearcoatRoughness = metallicData.clearcoatRoughness or tonumber(metallicData[4]) or 0.0
local clearcoat = metallicData.clearcoat or tonumber(metallicData[3]) or 0.8
local clearcoatRoughness = metallicData.clearcoatRoughness or tonumber(metallicData[4]) or 0.0
end
local metallic = tonumber(colorTable[5]) or 0.2
local roughness = tonumber(colorTable[6]) or 0.5
local metallic = tonumber(colorTable[5]) or 0.2
local roughness = tonumber(colorTable[6]) or 0.5
local clearcoat = tonumber(colorTable[7]) or 0.8
local roughness = tonumber(colorTable[6]) or 0.5
local clearcoat = tonumber(colorTable[7]) or 0.8
local clearcoatRoughness = tonumber(colorTable[8]) or 0.0
local clearcoat = tonumber(colorTable[7]) or 0.8
local clearcoatRoughness = tonumber(colorTable[8]) or 0.0
-- log('I','vehicleColor','metallic data: metallic = '..metallic..' roughness = '..roughness..' clearcoat = '..clearcoat..' clearcoatRoughness = '..clearcoatRoughness)
local components = string.split(validatedColor)
validatedColor = string.format("%0.2f %0.2f %0.2f %0.2f", tonumber(components[1]), tonumber(components[2]), tonumber(components[3]), tonumber(components[4]))
elseif type(color) == 'table' then
local components = string.split(validatedColor)
validatedColor = string.format("%0.2f %0.2f %0.2f %0.2f", tonumber(components[1]), tonumber(components[2]), tonumber(components[3]), tonumber(components[4]))
elseif type(color) == 'table' then
local components = string.split(validatedColor)
validatedColor = string.format("%0.2f %0.2f %0.2f %0.2f", tonumber(components[1]), tonumber(components[2]), tonumber(components[3]), tonumber(components[4]))
elseif type(color) == 'table' then
local components = string.split(validatedColor)
validatedColor = string.format("%0.2f %0.2f %0.2f %0.2f", tonumber(components[1]), tonumber(components[2]), tonumber(components[3]), tonumber(components[4]))
elseif type(color) == 'table' then
for _,v in ipairs(components) do
if type(tonumber(v)) == 'number' then
countNumericEntries = countNumericEntries + 1
local components = stringToTable(colorStr)
local paint = createVehiclePaint({x = tonumber(components[1]), y = tonumber(components[2]), z = tonumber(components[3]), w = tonumber(components[4])})
return paint
local components = stringToTable(colorStr)
local paint = createVehiclePaint({x = tonumber(components[1]), y = tonumber(components[2]), z = tonumber(components[3]), w = tonumber(components[4])})
return paint
local components = stringToTable(colorStr)
local paint = createVehiclePaint({x = tonumber(components[1]), y = tonumber(components[2]), z = tonumber(components[3]), w = tonumber(components[4])})
return paint
local components = stringToTable(colorStr)
local paint = createVehiclePaint({x = tonumber(components[1]), y = tonumber(components[2]), z = tonumber(components[3]), w = tonumber(components[4])})
return paint
@/lua/ge/extensions/gameplay/traffic.lua
local id = veh:getId()
if traffic[id] and (traffic[id].isAi or tonumber(veh.isTraffic) == 1) then
removeTraffic(id)
@/lua/ge/extensions/gameplay/util/sortedList.lua
o:onDeserialized(d, oldIdMap)
oldIdMap[tonumber(d.oldId)] = o.id
end
@/lua/ge/extensions/editor/rendererComponents.lua
if value then
local res = tonumber(value)
if res then
if tblLength == 3 then
tempFloatArr3[0] = tonumber(res[1])
tempFloatArr3[1] = tonumber(res[2])
tempFloatArr3[0] = tonumber(res[1])
tempFloatArr3[1] = tonumber(res[2])
tempFloatArr3[2] = tonumber(res[3])
tempFloatArr3[1] = tonumber(res[2])
tempFloatArr3[2] = tonumber(res[3])
else
if tblLength == 4 then
tempFloatArr4[0] = tonumber(res[1])
tempFloatArr4[1] = tonumber(res[2])
tempFloatArr4[0] = tonumber(res[1])
tempFloatArr4[1] = tonumber(res[2])
tempFloatArr4[2] = tonumber(res[3])
tempFloatArr4[1] = tonumber(res[2])
tempFloatArr4[2] = tonumber(res[3])
tempFloatArr4[3] = tonumber(res[4])
tempFloatArr4[2] = tonumber(res[3])
tempFloatArr4[3] = tonumber(res[4])
else
--print(newPath .. ' = ' .. tostring(TorqueScriptLua.getVar(s.tsVar)) .. ' (' .. tostring(s.tsVar) .. ')')
initialValue = tonumber(TorqueScriptLua.getVar(s.tsVar)) or 0
end
if s.tsVar then
initialValue = tonumber(TorqueScriptLua.getVar(s.tsVar))
end
if s.tsVar then
initialValue = tonumber(TorqueScriptLua.getVar(s.tsVar))
end
end
s.cVal = im.ArrayFloatByTbl({tonumber(initialValue[1]), tonumber(initialValue[2]), tonumber(initialValue[3]), tonumber(initialValue[4])})
end
end
s.cVal = im.ArrayFloatByTbl({tonumber(initialValue[1]), tonumber(initialValue[2]), tonumber(initialValue[3]), tonumber(initialValue[4])})
end
end
s.cVal = im.ArrayFloatByTbl({tonumber(initialValue[1]), tonumber(initialValue[2]), tonumber(initialValue[3]), tonumber(initialValue[4])})
end
end
s.cVal = im.ArrayFloatByTbl({tonumber(initialValue[1]), tonumber(initialValue[2]), tonumber(initialValue[3]), tonumber(initialValue[4])})
end
DOFSettings['focusSettings'].blurMin.default = tonumber(TorqueScriptLua.getVar("$DOFPostFx::BlurMin"))
DOFSettings['focusSettings'].blurMin.value = DOFSettings['focusSettings'].blurMin.default
DOFSettings['focusSettings'].blurMax.default = tonumber(TorqueScriptLua.getVar("$DOFPostFx::BlurMax"))
DOFSettings['focusSettings'].blurMax.value = DOFSettings['focusSettings'].blurMax.default
DOFSettings['focusSettings'].blurCurveNear.default = tonumber(TorqueScriptLua.getVar("$DOFPostFx::BlurCurveNear"))
DOFSettings['focusSettings'].blurCurveNear.value = DOFSettings['focusSettings'].blurCurveNear.default
DOFSettings['focusSettings'].blurCurveFar.default = tonumber(TorqueScriptLua.getVar("$DOFPostFx::BlurCurveFar"))
DOFSettings['focusSettings'].blurCurveFar.value = DOFSettings['focusSettings'].blurCurveFar.default
DOFSettings['focusSettings'].focusRangeMin.default = tonumber(TorqueScriptLua.getVar("$DOFPostFx::FocusRangeMin"))
DOFSettings['focusSettings'].focusRangeMin.value = DOFSettings['focusSettings'].focusRangeMin.default
DOFSettings['focusSettings'].focusRangeMax.default = tonumber(TorqueScriptLua.getVar("$DOFPostFx::FocusRangeMax"))
DOFSettings['focusSettings'].focusRangeMax.value = DOFSettings['focusSettings'].focusRangeMax.default
lightraysSettings['brightness'].default = tonumber(TorqueScriptLua.getVar("$LightRayPostFX::brightScalar"))
lightraysSettings['brightness'].value = lightraysSettings['brightness'].default
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/followPath.lua
if not self.started or self.complete then return end
if tonumber(id) ~= self.pinIn.vehId.value then return end
if info == nil then
@/lua/common/libs/luaqrcode/qrencode.lua
string.gsub(str,"..?.?",function(a)
int = tonumber(a)
if #a == 3 then
local tab = string.gsub(data,"(........)",function(x)
msg[#msg+1] = tonumber(x,2)
end)
-- Parameter mask is 0-7 (-1 for 'no mask'). x and y are 1-based coordinates,
-- 1,1 = upper left. tonumber(value) must be 0 or 1.
local function get_pixel_with_mask( mask, x,y,value )
-- value = 1? -> -1, value = 0? -> 1
return 1 - 2 * tonumber(value)
else
-- value = 1? -> 1, value = 0? -> -1
return -1 + 2*tonumber(value)
end
@/lua/common/jsonDebug.lua
end
r = tonumber(sub(s, si, i - 1))
if r == nil then
@/lua/vehicle/extensions/tech/ACC.lua
if type(v2) == "cdata" then
local x = tonumber(v2.x)
local y = tonumber(v2.y)
local x = tonumber(v2.x)
local y = tonumber(v2.y)
local z = tonumber(v2.z)
local y = tonumber(v2.y)
local z = tonumber(v2.z)
local sq2 = math.sqrt(x ^ 2 + y ^ 2)
@/lua/ge/extensions/gameplay/rally/rallyManager.lua
audioLen = tonumber(metadataVal.audioLen)
if not audioLen then
@/lua/ge/extensions/ui/gameplaySelector/tileGenerators/campaignTiles.lua
sourceIcons = {},
order = -tonumber(campaign.date) or 0,
isLegacy = true,
@/lua/ge/extensions/editor/inspector.lua
if vec[4] == nil then vec[4] = "0" end
groundCoverUVal[0] = tonumber(vec[1])
groundCoverVVal[0] = tonumber(vec[2])
groundCoverUVal[0] = tonumber(vec[1])
groundCoverVVal[0] = tonumber(vec[2])
groundCoverWVal[0] = tonumber(vec[3])
groundCoverVVal[0] = tonumber(vec[2])
groundCoverWVal[0] = tonumber(vec[3])
groundCoverHVal[0] = tonumber(vec[4])
groundCoverWVal[0] = tonumber(vec[3])
groundCoverHVal[0] = tonumber(vec[4])
end
local metallicValues = stringToTable(fieldValue)
metallicValuePtrs[0][0] = tonumber(metallicValues[1])
metallicValuePtrs[1][0] = tonumber(metallicValues[2])
metallicValuePtrs[0][0] = tonumber(metallicValues[1])
metallicValuePtrs[1][0] = tonumber(metallicValues[2])
metallicValuePtrs[2][0] = tonumber(metallicValues[3])
metallicValuePtrs[1][0] = tonumber(metallicValues[2])
metallicValuePtrs[2][0] = tonumber(metallicValues[3])
metallicValuePtrs[3][0] = tonumber(metallicValues[4])
metallicValuePtrs[2][0] = tonumber(metallicValues[3])
metallicValuePtrs[3][0] = tonumber(metallicValues[4])
for propertyIndex = 0, 3 do
billboardUVValue[0] = tonumber(uvVec[1])
billboardUVValue[1] = tonumber(uvVec[2])
billboardUVValue[0] = tonumber(uvVec[1])
billboardUVValue[1] = tonumber(uvVec[2])
billboardUVValue[2] = tonumber(uvVec[3])
billboardUVValue[1] = tonumber(uvVec[2])
billboardUVValue[2] = tonumber(uvVec[3])
billboardUVValue[3] = tonumber(uvVec[4])
billboardUVValue[2] = tonumber(uvVec[3])
billboardUVValue[3] = tonumber(uvVec[4])
if vec[4] == nil then vec[4] = "0" end
groundCoverUVal[0] = tonumber(vec[1])
groundCoverVVal[0] = tonumber(vec[2])
groundCoverUVal[0] = tonumber(vec[1])
groundCoverVVal[0] = tonumber(vec[2])
groundCoverWVal[0] = tonumber(vec[3])
groundCoverVVal[0] = tonumber(vec[2])
groundCoverWVal[0] = tonumber(vec[3])
groundCoverHVal[0] = tonumber(vec[4])
groundCoverWVal[0] = tonumber(vec[3])
groundCoverHVal[0] = tonumber(vec[4])
imgui.SetWindowSize2(groundCoverUVWindowName, imgui.ImVec2(800, 600))
@/lua/ge/extensions/gameplay/rally/tools/loopToolbox.lua
if x and y and z then
objPos = vec3(tonumber(x), tonumber(y), tonumber(z))
end
if x and y and z then
objPos = vec3(tonumber(x), tonumber(y), tonumber(z))
end
if x and y and z then
objPos = vec3(tonumber(x), tonumber(y), tonumber(z))
end
@/lua/ge/spawn.lua
if gameConnection and gameConnection.freeCamera then
local freeCamera = scenetree.findObjectById(tonumber(gameConnection.freeCamera))
if freeCamera then
@/lua/ge/extensions/flowgraph/modules/vehicleModule.lua
if veh then
local parentId = tonumber(veh:getField("parentGroup", 0))
local parent = scenetree.findObjectById(parentId)
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
if val == true or val == false then return end
-- if not tonumber(val) then return end
-- dump(beamdata.agpick[1].list[val],'?? BP:'..beamdata.agpick[1].key..':'..val,nil,2)
elseif key == 'jpart_pick' then
if not tonumber(val) then return end
beamdata.opart = nil
@/lua/common/utils/torqueScriptParser.lua
local hexescape = P"\\" * S"xX" * C( hexdigit * hexdigit^-1 ) / function( s )
return string.char( tonumber( s, 16 ) )
end
local octescape = P"\\" * C( P"0"^-1 * octdigit * octdigit^-2 ) / function( s )
return string.char( tonumber( s, 8 ) )
end
@/lua/common/libs/copas/copas/semaphore.lua
function semaphore.new(max, start, seconds)
local timeout = tonumber(seconds or DEFAULT_TIMEOUT) or -1
if timeout < 0 then
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/simpleFollowDecalroad.lua
if not self.running then return end
if tonumber(id) ~= self.pinIn.vehId.value then return end
@/lua/ge/extensions/ui/gridSelectorUtils/displayDataModule.lua
if option.type == "number" then
displayData[option.key] = tonumber(displayData[option.key])
end
if type == "number" then
value = tonumber(value)
end
if option.type == "number" then
defaultValue = tonumber(defaultValue)
end
@/lua/ge/extensions/editor/tech/roadArchitect/import.lua
local dP = v3.xarg
pred = { type = dP.elementType, id = tonumber(dP.elementId), contactPoint = dP.contactPoint }
elseif v3.label == 'successor' then
local dS = v3.xarg
succ = { type = dS.elementType, id = tonumber(dS.elementId), contactPoint = dS.contactPoint }
end
elseif v4.label == 'arc' then
gInner.type, gInner.k = 'arc', tonumber(v4.xarg.curvature)
elseif v4.label == 'spiral' then
local dS = v4.xarg
gInner.type, gInner.k1, gInner.k2 = 'spiral', tonumber(dS.curvStart), tonumber(dS.curvEnd)
elseif v4.label == 'poly3' then
local dS = v4.xarg
gInner.type, gInner.k1, gInner.k2 = 'spiral', tonumber(dS.curvStart), tonumber(dS.curvEnd)
elseif v4.label == 'poly3' then
local dP = v4.xarg
gInner.type, gInner.a, gInner.b, gInner.c, gInner.d = 'poly3', tonumber(dP.a), tonumber(dP.b), tonumber(dP.c), tonumber(dP.d)
elseif v4.label == 'paramPoly3' then
local dP = v4.xarg
gInner.type, gInner.a, gInner.b, gInner.c, gInner.d = 'poly3', tonumber(dP.a), tonumber(dP.b), tonumber(dP.c), tonumber(dP.d)
elseif v4.label == 'paramPoly3' then
local dP = v4.xarg
gInner.type, gInner.a, gInner.b, gInner.c, gInner.d = 'poly3', tonumber(dP.a), tonumber(dP.b), tonumber(dP.c), tonumber(dP.d)
elseif v4.label == 'paramPoly3' then
local dP = v4.xarg
gInner.type, gInner.a, gInner.b, gInner.c, gInner.d = 'poly3', tonumber(dP.a), tonumber(dP.b), tonumber(dP.c), tonumber(dP.d)
elseif v4.label == 'paramPoly3' then
gInner.type = 'paramPoly3'
gInner.aU, gInner.bU, gInner.cU, gInner.dU = tonumber(dP.aU), tonumber(dP.bU), tonumber(dP.cU), tonumber(dP.dU)
gInner.aV, gInner.bV, gInner.cV, gInner.dV = tonumber(dP.aV), tonumber(dP.bV), tonumber(dP.cV), tonumber(dP.dV)
gInner.type = 'paramPoly3'
gInner.aU, gInner.bU, gInner.cU, gInner.dU = tonumber(dP.aU), tonumber(dP.bU), tonumber(dP.cU), tonumber(dP.dU)
gInner.aV, gInner.bV, gInner.cV, gInner.dV = tonumber(dP.aV), tonumber(dP.bV), tonumber(dP.cV), tonumber(dP.dV)
gInner.type = 'paramPoly3'
gInner.aU, gInner.bU, gInner.cU, gInner.dU = tonumber(dP.aU), tonumber(dP.bU), tonumber(dP.cU), tonumber(dP.dU)
gInner.aV, gInner.bV, gInner.cV, gInner.dV = tonumber(dP.aV), tonumber(dP.bV), tonumber(dP.cV), tonumber(dP.dV)
gInner.type = 'paramPoly3'
gInner.aU, gInner.bU, gInner.cU, gInner.dU = tonumber(dP.aU), tonumber(dP.bU), tonumber(dP.cU), tonumber(dP.dU)
gInner.aV, gInner.bV, gInner.cV, gInner.dV = tonumber(dP.aV), tonumber(dP.bV), tonumber(dP.cV), tonumber(dP.dV)
gInner.aU, gInner.bU, gInner.cU, gInner.dU = tonumber(dP.aU), tonumber(dP.bU), tonumber(dP.cU), tonumber(dP.dU)
gInner.aV, gInner.bV, gInner.cV, gInner.dV = tonumber(dP.aV), tonumber(dP.bV), tonumber(dP.cV), tonumber(dP.dV)
end
gInner.aU, gInner.bU, gInner.cU, gInner.dU = tonumber(dP.aU), tonumber(dP.bU), tonumber(dP.cU), tonumber(dP.dU)
gInner.aV, gInner.bV, gInner.cV, gInner.dV = tonumber(dP.aV), tonumber(dP.bV), tonumber(dP.cV), tonumber(dP.dV)
end
gInner.aU, gInner.bU, gInner.cU, gInner.dU = tonumber(dP.aU), tonumber(dP.bU), tonumber(dP.cU), tonumber(dP.dU)
gInner.aV, gInner.bV, gInner.cV, gInner.dV = tonumber(dP.aV), tonumber(dP.bV), tonumber(dP.cV), tonumber(dP.dV)
end
gInner.aU, gInner.bU, gInner.cU, gInner.dU = tonumber(dP.aU), tonumber(dP.bU), tonumber(dP.cU), tonumber(dP.dU)
gInner.aV, gInner.bV, gInner.cV, gInner.dV = tonumber(dP.aV), tonumber(dP.bV), tonumber(dP.cV), tonumber(dP.dV)
end
local dG = v3.xarg
geom[#geom + 1] = { s = tonumber(dG.s), start = vec3(tonumber(dG.x), tonumber(dG.y)), hdg = tonumber(dG.hdg), length = tonumber(dG.length), geom = gInner }
end
local dG = v3.xarg
geom[#geom + 1] = { s = tonumber(dG.s), start = vec3(tonumber(dG.x), tonumber(dG.y)), hdg = tonumber(dG.hdg), length = tonumber(dG.length), geom = gInner }
end
local dG = v3.xarg
geom[#geom + 1] = { s = tonumber(dG.s), start = vec3(tonumber(dG.x), tonumber(dG.y)), hdg = tonumber(dG.hdg), length = tonumber(dG.length), geom = gInner }
end
local dG = v3.xarg
geom[#geom + 1] = { s = tonumber(dG.s), start = vec3(tonumber(dG.x), tonumber(dG.y)), hdg = tonumber(dG.hdg), length = tonumber(dG.length), geom = gInner }
end
local dG = v3.xarg
geom[#geom + 1] = { s = tonumber(dG.s), start = vec3(tonumber(dG.x), tonumber(dG.y)), hdg = tonumber(dG.hdg), length = tonumber(dG.length), geom = gInner }
end
local dE = v3.xarg
elev[#elev + 1] = { s = tonumber(dE.s), a = tonumber(dE.a), b = tonumber(dE.b), c = tonumber(dE.c), d = tonumber(dE.d) }
end
local dE = v3.xarg
elev[#elev + 1] = { s = tonumber(dE.s), a = tonumber(dE.a), b = tonumber(dE.b), c = tonumber(dE.c), d = tonumber(dE.d) }
end
local dE = v3.xarg
elev[#elev + 1] = { s = tonumber(dE.s), a = tonumber(dE.a), b = tonumber(dE.b), c = tonumber(dE.c), d = tonumber(dE.d) }
end
local dE = v3.xarg
elev[#elev + 1] = { s = tonumber(dE.s), a = tonumber(dE.a), b = tonumber(dE.b), c = tonumber(dE.c), d = tonumber(dE.d) }
end
local dE = v3.xarg
elev[#elev + 1] = { s = tonumber(dE.s), a = tonumber(dE.a), b = tonumber(dE.b), c = tonumber(dE.c), d = tonumber(dE.d) }
end
local dSE = v3.xarg
sElev[#sElev + 1] = { s = tonumber(dSE.s), a = tonumber(dSE.a), b = tonumber(dSE.b), c = tonumber(dSE.c), d = tonumber(dSE.d) }
end
local dSE = v3.xarg
sElev[#sElev + 1] = { s = tonumber(dSE.s), a = tonumber(dSE.a), b = tonumber(dSE.b), c = tonumber(dSE.c), d = tonumber(dSE.d) }
end
local dSE = v3.xarg
sElev[#sElev + 1] = { s = tonumber(dSE.s), a = tonumber(dSE.a), b = tonumber(dSE.b), c = tonumber(dSE.c), d = tonumber(dSE.d) }
end
local dSE = v3.xarg
sElev[#sElev + 1] = { s = tonumber(dSE.s), a = tonumber(dSE.a), b = tonumber(dSE.b), c = tonumber(dSE.c), d = tonumber(dSE.d) }
end
local dSE = v3.xarg
sElev[#sElev + 1] = { s = tonumber(dSE.s), a = tonumber(dSE.a), b = tonumber(dSE.b), c = tonumber(dSE.c), d = tonumber(dSE.d) }
end
if v3.label == 'laneSection' then
local lSecData = { s = tonumber(v3.xarg.s) }
for _, v4 in pairs(v3) do
local lD = v5.xarg
local laneId = tonumber(lD.id)
lSecData[laneId] = { type = tonumber(lD.type), dir = lD.direction, widths = {}, heights = {} }
local laneId = tonumber(lD.id)
lSecData[laneId] = { type = tonumber(lD.type), dir = lD.direction, widths = {}, heights = {} }
for _, v6 in pairs(v5) do
local numWidths = #lSecData[laneId].widths
lSecData[laneId].widths[numWidths + 1] = { sOffset = tonumber(lA.sOffset), a = tonumber(lA.a), b = tonumber(lA.b), c = tonumber(lA.c), d = tonumber(lA.d) }
elseif v6.label == 'height' then
local numWidths = #lSecData[laneId].widths
lSecData[laneId].widths[numWidths + 1] = { sOffset = tonumber(lA.sOffset), a = tonumber(lA.a), b = tonumber(lA.b), c = tonumber(lA.c), d = tonumber(lA.d) }
elseif v6.label == 'height' then
local numWidths = #lSecData[laneId].widths
lSecData[laneId].widths[numWidths + 1] = { sOffset = tonumber(lA.sOffset), a = tonumber(lA.a), b = tonumber(lA.b), c = tonumber(lA.c), d = tonumber(lA.d) }
elseif v6.label == 'height' then
local numWidths = #lSecData[laneId].widths
lSecData[laneId].widths[numWidths + 1] = { sOffset = tonumber(lA.sOffset), a = tonumber(lA.a), b = tonumber(lA.b), c = tonumber(lA.c), d = tonumber(lA.d) }
elseif v6.label == 'height' then
local numWidths = #lSecData[laneId].widths
lSecData[laneId].widths[numWidths + 1] = { sOffset = tonumber(lA.sOffset), a = tonumber(lA.a), b = tonumber(lA.b), c = tonumber(lA.c), d = tonumber(lA.d) }
elseif v6.label == 'height' then
local numHeights = #lSecData[laneId].heights
lSecData[laneId].heights[numHeights + 1] = { sOffset = tonumber(lA.sOffset), inner = tonumber(lA.inner), outer = tonumber(lA.outer) }
elseif v6.label == 'link' then
local numHeights = #lSecData[laneId].heights
lSecData[laneId].heights[numHeights + 1] = { sOffset = tonumber(lA.sOffset), inner = tonumber(lA.inner), outer = tonumber(lA.outer) }
elseif v6.label == 'link' then
local numHeights = #lSecData[laneId].heights
lSecData[laneId].heights[numHeights + 1] = { sOffset = tonumber(lA.sOffset), inner = tonumber(lA.inner), outer = tonumber(lA.outer) }
elseif v6.label == 'link' then
if v7.label == 'predecessor' then
lSecData[laneId].pred = tonumber(v7.xarg.id)
elseif v7.label == 'successor' then
elseif v7.label == 'successor' then
lSecData[laneId].succ = tonumber(v7.xarg.id)
end
local lOD = v3.xarg
laneOffsets[#laneOffsets + 1] = { s = tonumber(lOD.s), a = tonumber(lOD.a), b = tonumber(lOD.b), c = tonumber(lOD.c), d = tonumber(lOD.d) }
end
local lOD = v3.xarg
laneOffsets[#laneOffsets + 1] = { s = tonumber(lOD.s), a = tonumber(lOD.a), b = tonumber(lOD.b), c = tonumber(lOD.c), d = tonumber(lOD.d) }
end
local lOD = v3.xarg
laneOffsets[#laneOffsets + 1] = { s = tonumber(lOD.s), a = tonumber(lOD.a), b = tonumber(lOD.b), c = tonumber(lOD.c), d = tonumber(lOD.d) }
end
local lOD = v3.xarg
laneOffsets[#laneOffsets + 1] = { s = tonumber(lOD.s), a = tonumber(lOD.a), b = tonumber(lOD.b), c = tonumber(lOD.c), d = tonumber(lOD.d) }
end
local lOD = v3.xarg
laneOffsets[#laneOffsets + 1] = { s = tonumber(lOD.s), a = tonumber(lOD.a), b = tonumber(lOD.b), c = tonumber(lOD.c), d = tonumber(lOD.d) }
end
rPrims[#rPrims + 1] = {
id = tonumber(xArg.id), name = tonumber(xArg.name),
rule = tonumber(xArg.rule), length = tonumber(xArg.length), junction = tonumber(xArg.junction),
rPrims[#rPrims + 1] = {
id = tonumber(xArg.id), name = tonumber(xArg.name),
rule = tonumber(xArg.rule), length = tonumber(xArg.length), junction = tonumber(xArg.junction),
id = tonumber(xArg.id), name = tonumber(xArg.name),
rule = tonumber(xArg.rule), length = tonumber(xArg.length), junction = tonumber(xArg.junction),
pred = pred, succ = succ,
id = tonumber(xArg.id), name = tonumber(xArg.name),
rule = tonumber(xArg.rule), length = tonumber(xArg.length), junction = tonumber(xArg.junction),
pred = pred, succ = succ,
id = tonumber(xArg.id), name = tonumber(xArg.name),
rule = tonumber(xArg.rule), length = tonumber(xArg.length), junction = tonumber(xArg.junction),
pred = pred, succ = succ,
elseif v1.label == 'junction' then
local jId, jType, conn = tonumber(v1.xarg.id), v1.xarg.type, {}
for _, v2 in pairs(v1) do
if v2.label == 'connection' then
local rIn, rOut, cp = tonumber(v2.xarg.incomingRoad), tonumber(v2.xarg.linkedRoad), v2.xarg.contactPoint
local links = {}
if v2.label == 'connection' then
local rIn, rOut, cp = tonumber(v2.xarg.incomingRoad), tonumber(v2.xarg.linkedRoad), v2.xarg.contactPoint
local links = {}
if v3.label == 'laneLink' then
links[#links + 1] = { from = tonumber(v3.xarg.from), to = tonumber(v3.xarg.to) }
end
if v3.label == 'laneLink' then
links[#links + 1] = { from = tonumber(v3.xarg.from), to = tonumber(v3.xarg.to) }
end
@/gameplay/missionTypes/busMode/constructor.lua
if hex:len() == 3 then
return {(tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255, 1}
else
if hex:len() == 3 then
return {(tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255, 1}
else
if hex:len() == 3 then
return {(tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255, 1}
else
else
return {tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255, 1}
end
else
return {tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255, 1}
end
else
return {tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255, 1}
end
@/lua/ge/extensions/core/weather.lua
for k,v in pairs(formerValues[objClassStr][id][attrName]['value']) do
formerValues[objClassStr][id][attrName]['value'][k] = tonumber(v)
end
for k,v in pairs(formerValues[objClassStr][id][attrName]['value']) do
formerValues[objClassStr][id][attrName]['value'][k] = tonumber(v)
end
for k,v in pairs(formerValues[objClassStr][id][attrName]['value']) do
formerValues[objClassStr][id][attrName]['value'][k] = tonumber(v)
end
@/lua/ge/extensions/core/cameraModes/observer.lua
if cam.Speed and tonumber(cam.Speed) then
if self.camLastBulletSpeed ~= cam.Speed then
local targetFOV = cam.targetFOV and tonumber(cam.targetFOV) or (90 - camPosDelta * 3)
@/lua/ge/extensions/gameplay/rally/notebook/structured/visualCompositor.lua
else
local targetNum = tonumber(severity)
if not targetNum or targetNum < 0 then return nil end
for _, sevData in ipairs(configSeverities) do
local sevValue = tonumber(sevData.value)
local diff = math.abs(sevValue - targetNum)
if radiusChange then
local targetNum = tonumber(radiusChange)
-- if not targetNum or targetNum < 0 then return nil end
for _, radData in ipairs(configRadiusChanges) do
local radVal = tonumber(radData.value)
local diff = math.abs(radVal - targetNum)
@/lua/ge/extensions/editor/resourceChecker.lua
if not b then return "0.00 MB" end
return string.format("%.2f MB", (tonumber(b) or 0)/1048576)
end
local p = f.path or ""
local sz = tonumber(f.bytes) or 0
root.bytes = root.bytes + sz
local function _drawTreeList(root, totalBytes)
local total = math.max(1, tonumber(totalBytes) or 1)
im.Columns(5, "assetTreeCols", true)
local total = tonumber(totals.diskBytes) or 1
local barW = im.GetContentRegionAvailWidth()
local function catRow(key)
local total = tonumber(totals.diskBytes) or 1
local b = breakdown[key] and breakdown[key].bytes or 0
local v = flist[i]
im.BulletText("File: "..v.path.." "..humanMB(tonumber(v.bytes)).."\n")
end
local usedT = tonumber(totals.usedTexBytes) or 0
local usedM = tonumber(totals.usedMeshBytes) or 0
local usedT = tonumber(totals.usedTexBytes) or 0
local usedM = tonumber(totals.usedMeshBytes) or 0
local usedTotal = math.max(1, usedT + usedM)
@/lua/vehicle/mapmgr.lua
M.signalsData[data[i]][data[i + 1]][data[i + 2]] = M.signalsData[data[i]][data[i + 1]][data[i + 2]] or {action = 0}
M.signalsData[data[i]][data[i + 1]][data[i + 2]].action = tonumber(data[i + 3]) or 0
end
@/lua/ge/extensions/editor/gen/utils.lua
else
t[#t + 1] = tonumber(str)
end
@/lua/ge/extensions/core/settings/audio.lua
get = function()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelMaster'))
end,
get = function()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelPower'))
end,
get = function()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelForcedInduction'))
end,
get = function()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelTransmission'))
end,
get = function()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelSuspension'))
end,
get = function ()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelSurface'))
end,
get = function ()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelCollision'))
end,
get = function ()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelAero'))
end,
get = function ()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelEnvironment'))
end,
get = function ()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelMusic'))
end,
get = function ()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelUi'))
end,
get = function ()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelOther'))
end,
get = function ()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelLfe'))
end,
get = function ()
return tonumber(TorqueScriptLua.getVar('$pref::SFX::AudioChannelIntercom'))
end,
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua
if im.InputText("##MaterialNameInput", terrainMtlCopyProxy.nameInput, nil, im.flags(im.InputTextFlags_CharsNoBlank)) then
local firstChar = tonumber(string.sub(ffi.string(terrainMtlCopyProxy.nameInput), 1, 1))
if firstChar and type(firstChar) == "number" then
@/lua/common/csvlib.lua
val = sub(s, si, i - 1)
if testnum then val = tonumber(val) or val end
end