FlightControl Posted October 22, 2015 Posted October 22, 2015 I am the creator of the MOOSE framework... And i found a scripting problem in DCSW 1.5.x. Please investigate this problem, it may cause issues for many server hosters... When iterating the env.mission.coalition contents, i see a big difference how the objects in the dictionary are named... In DCSW version 1.2.x, Groups and Units names used to have in the env environment the same name as in the mission editor. But in DCSW version 1.5.x, Groups and Units now have different names than defined in the mission editor: Groups have now a name like DictKey_GroupName_(and a number) Units have now a name like DictKey_UnitName_(and a number). I don't have a clue now how i can extract the information from the "templates" as defined in the mission editor of the groups and units that i want to dynamically spawn. The moose framework existence is in danger, so is MIST. This can become a big problem for DCS. Many users of DCS world will complain! Due to this change, the frameworks that are around will not work anymore (like MIST). Is there any solution available or any workaround for this? (Grimes?) for coa_name, coa_data in pairs(env.mission.coalition) do if (coa_name == 'red' or coa_name == 'blue') and type(coa_data) == 'table' then self.Units[coa_name] = {} ---------------------------------------------- -- build nav points DB self.Navpoints[coa_name] = {} if coa_data.nav_points then --navpoints for nav_ind, nav_data in pairs(coa_data.nav_points) do if type(nav_data) == 'table' then self.Navpoints[coa_name][nav_ind] = routines.utils.deepCopy(nav_data) self.Navpoints[coa_name][nav_ind]['name'] = nav_data.callsignStr -- name is a little bit more self-explanatory. self.Navpoints[coa_name][nav_ind]['point'] = {} -- point is used by SSE, support it. self.Navpoints[coa_name][nav_ind]['point']['x'] = nav_data.x self.Navpoints[coa_name][nav_ind]['point']['y'] = 0 self.Navpoints[coa_name][nav_ind]['point']['z'] = nav_data.y end end end ------------------------------------------------- if coa_data.country then --there is a country table for cntry_id, cntry_data in pairs(coa_data.country) do local countryName = string.lower(cntry_data.name) self.Units[coa_name][countryName] = {} self.Units[coa_name][countryName]["countryId"] = cntry_data.id if type(cntry_data) == 'table' then --just making sure for obj_type_name, obj_type_data in pairs(cntry_data) do if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" or obj_type_name == "static" then --should be an unncessary check local category = obj_type_name if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group! self.Units[coa_name][countryName][category] = {} for group_num, GroupTemplate in pairs(obj_type_data.group) do if GroupTemplate and GroupTemplate.units and type(GroupTemplate.units) == 'table' then --making sure again- this is a valid group self:_RegisterGroup( GroupTemplate ) end --if GroupTemplate and GroupTemplate.units then end --for group_num, GroupTemplate in pairs(obj_type_data.group) do end --if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then end --if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" or obj_type_name == "static" then end --for obj_type_name, obj_type_data in pairs(cntry_data) do end --if type(cntry_data) == 'table' then end --for cntry_id, cntry_data in pairs(coa_data.country) do end --if coa_data.country then --there is a country table end --if coa_name == 'red' or coa_name == 'blue' and type(coa_data) == 'table' then end --for coa_name, coa_data in pairs(mission.coalition) do [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
ED Team BIGNEWY Posted October 22, 2015 ED Team Posted October 22, 2015 (edited) This has already been reported Thanks I am sure Grimes will say if it is not part of the same issue. :) Edited October 23, 2015 by BIGNEWY Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, PIMAX Crystal
FlightControl Posted October 22, 2015 Author Posted October 22, 2015 Thanks Grimes, looked in your mist code. Seems that there is a new function. I need to apply the following? if env.mission.version > 7 then groupName = env.getValueDictByKey(groupName) end thanks again! [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
FlightControl Posted October 22, 2015 Author Posted October 22, 2015 OK. I tested it and the MOOSE framework is fixed... Thanks to Grimes. [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
Grimes Posted October 22, 2015 Posted October 22, 2015 I am sure Grimes will say if it is not part of the same issue. :) It isn't. :music_whistling: Sven, see this thread for details on the scripting engine in 1.5. Not much has changed, but there are a few minor differences. Also the hoggit scripting engine wiki is updated to 1.5. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
FlightControl Posted October 23, 2015 Author Posted October 23, 2015 Thanks. Great stuff. [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
ED Team BIGNEWY Posted October 23, 2015 ED Team Posted October 23, 2015 It isn't. :music_whistling: Sven, see this thread for details on the scripting engine in 1.5. Not much has changed, but there are a few minor differences. Also the hoggit scripting engine wiki is updated to 1.5. Thanks for the save, I knew you would :) Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, PIMAX Crystal
Recommended Posts