Code: Select all
local a = ScenEdit_GetUnit({ side = 'USSR' , name = 'Roxy #1' })
print(a.fields)
for k,v in pairs(a.fields) do
if string.find(k,'property_') ~= nil then
local t = string.find(v," , ") -- location of first ,
print("\r\n[object] = " .. string.sub(v,2,t-1) ) -- property name
print( a[string.sub(v,2,t-1)] ) -- value of property
end
endAll I want to do is assign the BASE of the unit, there appears to be a properly called "hostFacility" but when I go to set this, nothing happens to the unit.
local a = ScenEdit_GetUnit({ side = 'USSR' , name = 'Roxy #1' })
ScenEdit_SetUnit({ side = 'USSR' , name = 'Roxy #1'}, {hostFacility='Nairobi Air Force Base (KDPA)'})
Tried tables, selectors, etc.. nothing.
Any ideas? I'm not even sure that's the right lua wrapper, but there is no other host or assignedBase property.
Thanks,
