Jump to content

DAWS Save Mission


Recommended Posts

  • Replies 442
  • Created
  • Last Reply

Top Posters In This Topic

Thanks!

 

Inviato dal mio SM-G850F utilizzando Tapatalk

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Find attached the mission.

 

I used the last edition of CTLD script.

 

I do this.

 

Fly mission, and inside the UH, I pick up the troops through the F10 commands. The group is extracted properly, then I fly away, and drop the infatnry group.

 

Also, there is a blue vehicle figthing against two red infantry.

 

At the end of the mission, the red infatnry is destroyed, the vehicle is moved and the extractable group (extract1) is in other place.

 

but I when I save it. Red infantry is destroyed, blue vehicle is in the last position but the extractable unit is in the embarking place.

DAWS CTLD test.miz

Link to comment
Share on other sites

Ok thanks!

 

Inviato dal mio SM-G850F utilizzando Tapatalk

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

About ca no, you can't. I'working about this and a ground automatic planning in dgws, but i still Even Don't know if i'll ever finish it.

 

I want to focus on me instrument rather than a campaign focused code.

 

Inviato dal mio SM-G850F utilizzando Tapatalk

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

This W.E. I'll try to investigate also for a possibile solution, I want to understand where is the missing information for updating units coordinates.

 

It seems that for some reason the group got excluded from the update unit check that is done in DAWS.

 

Sadly I can't learn properly CTLD in those days cause I will only have few time and a laptop.

 

Matador, if you could provide a sample mission and/or a dcs.log file would be awesome.

 

I really would like to see those mod working properly together :)

 

I've had a quick look, and as far as I understand the code, the issue lies in MOSSave() specifically the for loop for mist.DBs.MEunitsById

 

This table will never have dynamic units in it (so troops loaded from a zone wont appear) and even though CTLD explicitly sets groupId and unitId, it seems unitID get overridden somewhere so the loop doesnt pickup up the new positions.

 

Example (dumped using https://github.com/jboecker/dcs-witchcraft - helps with debugging!):

 


From mist.utils.tableShow(mist.DBs.unitsByName)
["Unidad #1"] = table: 0000000137BDC770     {
   ["Unidad #1"]["alt"] = 10,
   ["Unidad #1"]["heading"] = 0,
   ["Unidad #1"]["point"] = table: 00000000B8F4B3D0         {
       ["Unidad #1"]["point"]["y"] = 618353,
       ["Unidad #1"]["point"]["x"] = -356121,
       },
   ["Unidad #1"]["country"] = "usa",
   ["Unidad #1"]["coalitionId"] = 2,
   ["Unidad #1"]["unitName"] = "Unidad #1",
   ["Unidad #1"]["groupName"] = "extract1",
   ["Unidad #1"]["type"] = "Soldier M4",
   ["Unidad #1"]["countryId"] = 2,
   ["Unidad #1"]["x"] = -356121,
   ["Unidad #1"]["groupId"] = 2,
   ["Unidad #1"]["category"] = "vehicle",
   ["Unidad #1"]["speed"] = 0,
   ["Unidad #1"]["coalition"] = "blue",
   ["Unidad #1"]["y"] = 618353,
   ["Unidad #1"]["unitId"] = 1000026, -- wrong!
   },

Compared to - mist.DBs.MEunitsById
[2] = table: 000000002EE466C8     {
   [2]["type"] = "Soldier M4",
   [2]["point"] = table: 0000000047C2F1A0         {
       [2]["point"]["y"] = 618339.42857142,
       [2]["point"]["x"] = -356149.14285714,
       },
   [2]["groupId"] = 2,
   [2]["skill"] = "Average",
   [2]["country"] = "usa",
   [2]["groupName"] = "extract1",
   [2]["y"] = 618339.42857142,
   [2]["coalition"] = "blue",
   [2]["x"] = -356149.14285714,
   [2]["unitId"] = 2,
   [2]["category"] = "vehicle",
   [2]["unitName"] = "Unidad #1",
   [2]["playerCanDrive"] = true,
   [2]["heading"] = 0,
   [2]["countryId"] = 2,
   },

 

This could be fixed by changing the loop to use the mist.DBs.unitsByName which will contain no duplicates, always the latest information and Unit IDs as well as any dynamically spawned units from any other script.

 

Other parts of the script need to be changed to not rely on unit ID but instead compare using unit name but otherwise not much should need to be changed.

 

I may have misunderstood the script as I've only had a quick look but does that make sense and is it any help? :)


Edited by Ciribob

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

I was looking in the same directions. I'm already considering 2 solution: changing the used DB or rewriting a personal one based on mist :)

 

This should also fix the but of added units, but that was also a choice for another purpose... maybe I'll find a different way to choose which added groups shoulnd't be tracked and which one should.

 

EDIT:

before this code relied on unit name, but it's a very unstable solution due to the ongoing changes in the ME code, so I won't revert on that solution. I'll try to find another solution, like not using the "ME" version of the DB.


Edited by chromium

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

I was looking in the same directions. I'm already considering 2 solution: changing the used DB or rewriting a personal one based on mist :)

 

This should also fix the but of added units, but that was also a choice for another purpose... maybe I'll find a different way to choose which added groups shoulnd't be tracked and which one should.

 

EDIT:

before this code relied on unit name, but it's a very unstable solution due to the ongoing changes in the ME code, so I won't revert on that solution. I'll try to find another solution, like not using the "ME" version of the DB.

 

Ah thats fair enough, i'm not surprised names caused an issue! The Group ID stays the same for transported troops so I guess you can use that plus a name to figure out if a unit ID has changed?

 

Glad I didn't misunderstand the script completely. Good luck! :thumbup:

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

First of all I'm trying not using the "ME" DBs version. If this solve the spawned units issue, I'll post here a testing version for you. If it works, I'll update the release version.

 

Anyway I need to use unit ids, cause I don't actually have a DB that could index unit ids with groups (if you kill a unit in a group, the group indexed for its units vary, so I can't even think to use something like GroupID+Unit index in group)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Awesome, thanks Chromium :)

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

The issue isn't in the MOSSsave, but in the MOSSUnitLookup unit fuction inside the update function. Code:

 

-- find a unit by name in the mission table
function MOSSUnitLookup(mission, uID)
  --env.info(("MOSSUnitLookup is looking for uID " .. uID))
  for coalitionID,coalition in pairs(mission["coalition"]) do
	for countryID,country in pairs(coalition["country"]) do
	  for attrID,attr in pairs(country) do
		if (type(attr)=="table") then
		  for groupID,group in pairs(attr["group"]) do
			if (group) then
			  for unitID,unit in pairs(group["units"]) do
				if unit.unitId then
				  --env.info(("comparing unit " .. unit.unitId .. " with uID " .. uID))
				  if unit.unitId == uID then
					if debugProcess == true then
						env.info(("MOSSUnitLookup found unit: " .. uID .. "; name: " .. [color="Red"]env.getValueDictByKey(group.name)[/color]))
					end
					return coalitionID,coalition,
						countryID,country,
						attrID,attr,
						groupID,group,
						unitID,unit;
				  end
				end
			  end
			end
		  end
		end
	  end
	end
  end
  return nil,nil,nil,nil,nil,nil,nil,nil,nil,nil;
end
--]]--

 

I simply tried cloning a couple of units and the cloned ones aren't tracked. You can't see that units name.

 

So I believe that I have to rewrite the units lookup iteration.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

The issue isn't in the MOSSsave, but in the MOSSUnitLookup unit fuction inside the update function. Code:

 

-- find a unit by name in the mission table
function MOSSUnitLookup(mission, uID)
  --env.info(("MOSSUnitLookup is looking for uID " .. uID))
  for coalitionID,coalition in pairs(mission["coalition"]) do
	for countryID,country in pairs(coalition["country"]) do
	  for attrID,attr in pairs(country) do
		if (type(attr)=="table") then
		  for groupID,group in pairs(attr["group"]) do
			if (group) then
			  for unitID,unit in pairs(group["units"]) do
				if unit.unitId then
				  --env.info(("comparing unit " .. unit.unitId .. " with uID " .. uID))
				  if unit.unitId == uID then
					if debugProcess == true then
						env.info(("MOSSUnitLookup found unit: " .. uID .. "; name: " .. [color="Red"]env.getValueDictByKey(group.name)[/color]))
					end
					return coalitionID,coalition,
						countryID,country,
						attrID,attr,
						groupID,group,
						unitID,unit;
				  end
				end
			  end
			end
		  end
		end
	  end
	end
  end
  return nil,nil,nil,nil,nil,nil,nil,nil,nil,nil;
end
--]]--

 

I simply tried cloning a couple of units and the cloned ones aren't tracked. You can't see that units name.

 

So I believe that I have to rewrite the units lookup iteration.

 

Good point!

 

Have you seen the complete list of MIST DBs? https://github.com/mrSkortch/MissionScriptingTools/tree/master/Example%20DBs It might save you searching and a bit of work :)

 

Was that after changing the for loop to use a different lookup table as well?

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

Have you seen the complete list of MIST DBs? https://github.com/mrSkortch/MissionScriptingTools/tree/master/Example%20DBs It might save you searching and a bit of work :)

 

I knew them, but the lookup don't use mist table. I would be weird to move that lookup to a mist table while i'm trying to make the mod non dependant to mist :P*

 

*Grimes is always working on mist updates, so I would like to find a working solution free of mist updates, cause I really use only the DBs of mist for this code.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Wow! You guys are awesome!. I hope, i can help one day!.

 

the CTLD is a must for ground warfare. Many people here usee it.

 

Me dream is to see how we can put together the DAWS, CTLD and the Campaing Engine being developed. For the moment, you just have to conform with ideas!

 

As he said, MBot do not want to include ground units in the campaign engine right know. Also, MBot already has a saving mission code so I believe that Save Mission and DCE may not be compatible, or at least conflicting in their working patterns.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Ah right, didn't realise you were trying to remove mist, sorry! :)

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

Ah right, didn't realise you were trying to remove mist, sorry! :)

 

Don't worry, I didn't wrote that anywere XD. I'm still looking for a solution.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Not that easy sadly, but it seems that this feature is really important.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Update.

The good news is that I isolated the issue. The bad news is that all the mod do is to modify and save the env.mission table. But the env.mission table does not contain spawned units.

 

Now I have to find a good way to add spawned units to that table or else to use a different table.

 

EDIT:

since I really have few time, I might ask anyone who want to create a code to add any spawned group inside the env.mission table, at the moment the mission is saved (not continously), keeping only the alive units and their current position. The code should have a country & category checks for who would like to add dyn groups of a country or a category that is not currently inside the mission table.


Edited by chromium

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Update.

The good news is that I isolated the issue. The bad news is that all the mod do is to modify and save the env.mission table. But the env.mission table does not contain spawned units.

 

Now I have to find a good way to add spawned units to that table or else to use a different table.

 

Halfway there! :) well done! :thumbup:

Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD

CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup

Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

 

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :)

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord

Link to comment
Share on other sites

Yes but sadly as edited I have few time. I might have time in those coming days, but more probably in half january or after. It's not a change&check edit, it's a couple of new function to be added and tested in any condition.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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