Page 1 of 1

Lua GetLoadout Roles

Posted: Tue Jan 21, 2025 8:08 pm
by Parel803
Goodevening,

This:
local l = ScenEdit_GetLoadout ({name='testLOweather', guid='KO61QJ-0HN9Q2IEBCB5B'})
print (l.roles)

Gives:
{ TOD = 0, role = 2007, weather = 0 }

Shouldn't TOD and weather be giving a number iaw: https://commandlua.github.io/assets/Dat ... tTimeOfDay

If I'm doing something wrong, apologise.

regards GJ

Re: Lua GetLoadout Roles

Posted: Fri Feb 07, 2025 10:38 pm
by michaelm75au
The database being used by scenario might not have the values. '0' usually means there is no values for that loadout.
I tried it on a scenario based on a DB from 12 months ago and it showed the '0's, but when I migrated it to the latest DB, the expected values showed up

Re: Lua GetLoadout Roles

Posted: Sun Feb 09, 2025 3:09 pm
by Parel803
Micheal,

Thank you for your time and answer, I'll check.

Updated my save to DB3K 510 got:
>> local l = ScenEdit_GetLoadout ({name='F-7M Fishcan [MiG-21 Copy]', guid='9V11D5-0HN9B6VO7NOL9'})
print (l.roles)
{ TOD = 0, weather = 0, role = 3001 }

Made a small new scen with DB 510 got:
>> local l = ScenEdit_GetLoadout ({name='F-7B Fishcan [MiG-21 Copy]', guid='KO61QJ-0HNA96CVNJG87'})
print (l.roles)
{ TOD = 2003, weather = 2002, role = 3001 }

Not sure yet what I did incorrect but oké. I now know it is oke in a new scen.
And solved after deep re-build :-) Thx again

regards GJ