AMVI_Rider Posted August 4, 2012 Posted August 4, 2012 (edited) I'm writing my first export script that just exports the object list to a log file. I noticed that static objects are not reported in the table returned by LoGetWorldObjects(). So, am I missing something? Is there an alternative way to obtain static objects from an export script? edit: forgot to mention that I'm referring to DCS World 1.2.0 Edited August 4, 2012 by AMVI_Rider [sIGPIC][/sIGPIC] Author of DCSMP and VRK Ryzen 5 3600X - 32GB DD4 3200C14 Win10 64 - Geforce GTX 1080Ti Hotas Warhog + Virpil T-50 base - Saitek Combat Rudder Pedals - Cougar MFCDs - Custom head tracker 35" UWQHD main display + 22" MFCD/Helios display / Rift S 2x256 GB SSD - 2Tb Caviar Green
Speed Posted August 6, 2012 Posted August 6, 2012 I'm writing my first export script that just exports the object list to a log file. I noticed that static objects are not reported in the table returned by LoGetWorldObjects(). So, am I missing something? Is there an alternative way to obtain static objects from an export script? edit: forgot to mention that I'm referring to DCS World 1.2.0 Statics have always been hard to access properly, in any Lua environment. Have you also noticed how ships don't export properly either? LoGetWorldObjects doesn't return unit name or group name for ships. That said, one way you could get statics is by reading the mission file. I actually created a function that will do this in any environment that has access to lfs and io, and I can share that one with you if you want. However, in many (but not all!) ways, the export Lua environment is pretty weak compared to other Lua environments. You have no events access, for example. If you DID, then you could also tell which of the intial static objects were still alive. If you were willing to expand your mod beyond the bounds of the export environment, then the solutions would open up to you. In fact, if it's OK that your mod would only work in multiplayer, and only run on the server host, the best place to put a mod is the net Lua environment, because the net Lua environment can access the export, main simulation (aka "server"), and mission Lua environments via the net.dostring_in function. See what kind of things I am able to do with Slmod, for example, because I placed it in the net environment. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
AMVI_Rider Posted August 6, 2012 Author Posted August 6, 2012 Statics have always been hard to access properly, in any Lua environment. Have you also noticed how ships don't export properly either? LoGetWorldObjects doesn't return unit name or group name for ships. No I just stopped with statics ... as you confirmed, I need to take another approach That said, one way you could get statics is by reading the mission file. I actually created a function that will do this in any environment that has access to lfs and io, and I can share that one with you if you want. I read your posts about re-reading the mission table from temp directory and used your code to match runtime object with original mission table during export stop function to discover killed units without the need of constantly get the object table. If you ave any newer code I'm very interested in it ;) However, in many (but not all!) ways, the export Lua environment is pretty weak compared to other Lua environments ... See what kind of things I am able to do with Slmod, for example, because I placed it in the net environment. I see ... I took the export approach to avoid changing the sim files too much and in a way that became not compatible with other mods (i.e. yours) and to write some code from scartch rather than cutting&pasting too much. My MOD (let's call it a training on the job) main goal is to get killed units during MP missions: I thought about the debriefing approach but I think I will go for net to have some space for future improvements. Now it's clearly time for me to gain some expertise on the sim code :book: Thank you for being so kind to share yours! [sIGPIC][/sIGPIC] Author of DCSMP and VRK Ryzen 5 3600X - 32GB DD4 3200C14 Win10 64 - Geforce GTX 1080Ti Hotas Warhog + Virpil T-50 base - Saitek Combat Rudder Pedals - Cougar MFCDs - Custom head tracker 35" UWQHD main display + 22" MFCD/Helios display / Rift S 2x256 GB SSD - 2Tb Caviar Green
Recommended Posts