july865 Posted July 2, 2012 Posted July 2, 2012 instead of re-writing the 2 missions i have i would like to make 1 mission out of both, can we merge them together somehow? if so, please explain. Asus x99, i7 5930k, 32g mem, MSI 1070GTX, 970 Samsung M.2, LG 35in Ultra-Wide, TrackIR 4 Thrustmaster Warthog HOTAS [sIGPIC][/sIGPIC]
Druid_ Posted July 2, 2012 Posted July 2, 2012 A miz file is just a zip file so if you unzip it you will see the mission file along with any jpg's sound files etc. Open the mission lua file up in notepad++ and you will see how the mission is constructed. You will need to have a decent understanding of what's going on in the structure of the file before you then open up the other mission and start copying segments across and pasting into the correct sections adding lua code possibly where necessary. Not for the faint hearted and no guarantee that it will work as expected. I have done it only once but I was merging a small miz with a v.large one. Don't think I would attempt to merge 2 large ones together. Might be quicker to rewrite or maybe have a go at it in stages (I.e units and positions, then waypoints, triggers etc). i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q
july865 Posted July 2, 2012 Author Posted July 2, 2012 Thanks Druid. I'll give it a shot. You mentioned POSSIBLY adding lua code. Anything / scenario that you can thing of where I might need too? Asus x99, i7 5930k, 32g mem, MSI 1070GTX, 970 Samsung M.2, LG 35in Ultra-Wide, TrackIR 4 Thrustmaster Warthog HOTAS [sIGPIC][/sIGPIC]
Grimes Posted July 2, 2012 Posted July 2, 2012 He was stating that the mission file itself IS lua. But the question is what are you trying to copy from one mission into another? Copying groups isn't too bad, you just need to find where the groups are located for a given country and add the groups with a new index. Triggers are a little more complicated, but I have modified trigger conditions in the past through editing the mission file. However I did that in FC2 and I'm not sure if its still possible. 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
july865 Posted July 2, 2012 Author Posted July 2, 2012 a squad mate used our "training map" and had made a mission from it, but had removed the training grounds. we had over 500 units for training. i would like to incorporate the mission and training area. we have several of these kinds of maps that are incorporated, just would like to merge these 2. no big deal really, we have the normal back-ups. i thought it would be easier to find the differences in the mission.lua file and add it in. i can see where druid had mentioned to be careful. although i am a novice at scripting, i can see the file structure and how its laid out. didnt think there was over 23000 lines of scripting though....lol i am definitely going to give it a try, at least this would be good practice to learn from. Asus x99, i7 5930k, 32g mem, MSI 1070GTX, 970 Samsung M.2, LG 35in Ultra-Wide, TrackIR 4 Thrustmaster Warthog HOTAS [sIGPIC][/sIGPIC]
Grimes Posted July 3, 2012 Posted July 3, 2012 Well the mission file is pretty much a giant LUA table. And the entries that take up the most space are "on road" routes for ground units as it saves every turn on the road to the mission file. But yes, the files can get quite big, On Station is 317418 lines and most of it are random patrols on roads. :lol: But like I said its a giant table. To place units just look for coalition = { blue = { bullseye = { y = 631228.57142857, x = -328307.14285714, }, -- end of bullseye nav_points = { }, -- end of nav_points name = "BLUE", country = { [1] = { id = 3, name = "Turkey", }, -- end of [1] [2] = { id = 15, name = "Israel", }, -- end of [2] ... Inside each country has all of the aircraft, helictopers, ships, ground forces, and static objects list which are in the mission. Here is a code snippet from one of the A-10C campaign missions. Its a group entry for an OSA. [color="Red"][b][30][/b][/color] = { visible = true, taskSelected = true, route = { spans = { }, -- end of spans points = { [1] = { alt = 20, type = "Turning Point", ETA = 25200, alt_type = "BARO", formation_template = "", y = 632319.96285782, x = -330056.5924857, ETA_locked = true, speed = 5.5555555555556, action = "Off Road", speed_locked = true, }, -- end of [1] }, -- end of points }, -- end of route [color="red"][b]groupId = 68,[/b][/color] hidden = true, units = { [1] = { y = 632319.96285782, type = "Osa 9A33 ln", name = "Unit #71", [color="red"][b] unitId = 172,[/b][/color] heading = 2.9764439761752, skill = "Random", x = -330056.5924857, }, -- end of [1] }, -- end of units y = 632319.96285782, x = -330056.5924857, name = "RU SA-8 1", start_time = 25200, task = "Ground Nothing", }, -- end of [30] The [30] highlighted in red is the group index. When you add a group from one mission file to the next just set the number to whatever is the next number in the sequence. Remember that each type of group for each country has its own index. The other stuff highlighted in red might generate errors if other units or groups have a matching ID. However I'm not 100% sure about that. There is a chance that it will simply assign the next available number automatically if the ID is already taken. Its worth a quick test, but don't rely on it working that way. 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
Ripcord Posted July 3, 2012 Posted July 3, 2012 Some these mods, IIRC, can be done with the mission generator tool as well. I think figured out how to add triggers and goals. Never was able to figure out how to add existing units/objects on top of those being generated by the tool, but they could be copied/pasted afterwards, just as Grimes shows above. As far as merging two missions, probably it would be faster, as Druid suggests, to just copy units over manually -- maybe using the template function in the editor. [sIGPIC][/sIGPIC]
Grimes Posted July 3, 2012 Posted July 3, 2012 Completely forgot... you could just select a group, ctrl+c. Open mission you want to put the units in. And ctrl+v. Its tedious, but it'll work. 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
july865 Posted July 6, 2012 Author Posted July 6, 2012 well i had given it a try. a few mistakes, while loading the mission, it does tell me what line i had made the mistake in. as in wrong character on line xxx. after i had corrected them, the mission is stuck in the loading screen. i had left it there for over 30min just to make sure. DCSW is running and not locked up, just a continuous loading message. ill keep on trying. Asus x99, i7 5930k, 32g mem, MSI 1070GTX, 970 Samsung M.2, LG 35in Ultra-Wide, TrackIR 4 Thrustmaster Warthog HOTAS [sIGPIC][/sIGPIC]
Recommended Posts