Community Forum

Working Width

Forum Overview >> Scripting

CategoryScripting
Created04.04.2019 15:51


S Surman (ssurman) 04.04.2019 15:51
Hi,

New to Lua but trying to get my head round it. I am trying to get the working width of the implement attached but getting lost as to where to look. I have written some functions but cannot get to what I need.


for i, typeDef in pairs(g_vehicleTypeManager.vehicleTypes) do
if typeDef ~= nil and i ~= "locomotive" then

for name, spec in pairs(typeDef.specializationsByName) do
if name == "foldable" then
r=spec:getSpecValueWorkingWidth()
print_r(r)

end
end
end
end
Also dumped table g_currentMission.vehicles and see

2019-04-04 14:47 specializations :: table: 0x01ec40c3fb40
2019-04-04 14:47 23 :: table: 0x01ec44fb00e0
2019-04-04 14:47 getSpecValueWorkingWidth :: function: 0x01ec450daeb8

Any help or guidance appreciated.
Steve.

S Surman (ssurman) 04.04.2019 18:49
Confusing functions with values so think I have managed to understand it now.


Note: Log in to post. Create a new account here.