Jump to content

Recommended Posts

Posted

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]|

[/TABLE]

  • ED Team
Posted (edited)

This has already been reported Thanks

 

I am sure Grimes will say if it is not part of the same issue. :)

Edited by BIGNEWY

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

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

Posted

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]|

[/TABLE]

Posted
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 ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • ED Team
Posted
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 :)

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...