TEMPEST.114 Posted March 7, 2024 Posted March 7, 2024 I'm using W11 and NanaZip. If I look at a brand new mission file in NanaZip then I see that the method of compression is 'Deflate:Maximum' there are no 'Characteristics' and the Host OS is 'FAT'. When I add in my sound and image files, the method is changed on those new files to just 'Deflate' and the 'Characteristics' is NTFS. When I try and access them from the mission editor when running the mission, it can't see or find them, so I'm guessing it's these differences that are causing the problem. However I downloaded the free trial of WinRar and the same thing happened. It wouldn't play the audio or show the picture. BUT... If I add them in via the mission editor using a 'Show' or 'Play' to NEUTRALS when the mission starts, and then call them from my scripts as normal, they work fine. When I look at the .miz file in NanaZip then the Method is 'Deflate:Maximum' and there are no Characteristics. Is there a way to add all my files in Explorer somehow rather than doing events inside the mission editor at mission start?
Tippis Posted March 7, 2024 Posted March 7, 2024 The problem isn't so much the adding and removing files via a zip tool or the filesystem data of the file itself, but that the mission only really recognises assets that are either auto-indexed (eg embedded kneeboard pages and certain config files like labels.lua) or that are part of its “dictionary” file. When you add them through the ME trigger editor, they also get added to the dictionary. And perhaps more to the point, they're attached to a dictionary index that is recognised and blocked by the editor so there's no conflict with other dictionary items. You can do all of that manually, but it's a huge faff to keep it all straight. The mission editor will invariably end up being the simplest option, although there are some other third-party .miz tools that also keep the adding and indexing straight. That said, you can still benefit a bit from doing some things manually, like updating files that have already been added in an approved way, but you now have a new version that you want to include instead. Or the aforementioned auto-indexed files, where you can play around freely without involving the mission editor (indeed, often you have the exact opposite problem there: the mission editor doesn't have any way of adding or editing those files so you must do it manually). 1 ❧ ❧ Inside you are two wolves. One cannot land; the other shoots friendlies. You are a Goon. ❧ ❧
TEMPEST.114 Posted March 7, 2024 Author Posted March 7, 2024 Just now, Tippis said: The problem isn't so much the adding and removing files via a zip tool or the filesystem data of the file itself, but that the mission only really recognises assets that are either auto-indexed (eg embedded kneeboard pages and certain config files like labels.lua) or that are part of its “dictionary” file. When you add them through the ME trigger editor, they also get added to the dictionary. And perhaps more to the point, they're attached to a dictionary index that is recognised and blocked by the editor so there's no conflict with other dictionary items. You can do all of that manually, but it's a huge faff to keep it all straight. The mission editor will invariably end up being the simplest option, although there are some other third-party .miz tools that also keep the adding and indexing straight. That said, you can still benefit a bit from doing some things manually, like updating files that have already been added in an approved way, but you now have a new version that you want to include instead. Or the aforementioned auto-indexed files, where you can play around freely without involving the mission editor (indeed, often you have the exact opposite problem there: the mission editor doesn't have any way of adding or editing those files so you must do it manually). It's just that I need to add about 200 files to EVERY mission I make (mostly audio but some other files). Doing it manually in the mission editor would kill me. You can't even copy/paste triggers between mission files so that would be horrific to manually do each time. What would you suggest? What are these 3rd party tools?
Tippis Posted March 7, 2024 Posted March 7, 2024 My immediate suggestion would be to try to make a template mission — any files that you reuse can just be reused directly; some that you don't can perhaps be used as generic placeholders where you can update their specific content to match the unique mission. E.g. if you use custom beacons with their own morse (or radio) signals, and want to use different identifiers in each mission, then re-use those units and setups, but give them names that let you easily identify which becaon is which file so all you have to do is mass-update the sound files because everything else is already set up properly. As for third-party stuff, there are a few frameworks that let you generate missions in various ways and which work within the data structures the .miz use. You can look for them in other parts of the Mission Editor subforum. There are also some scripting frameworks that let you include stuff at runtime, but this entails some level of breaking the security sandbox and/or might only work in SP with appropriately set up clients. This may be a bit of a blocker depending on how squeamish you about those things. ❧ ❧ Inside you are two wolves. One cannot land; the other shoots friendlies. You are a Goon. ❧ ❧
TEMPEST.114 Posted March 8, 2024 Author Posted March 8, 2024 14 hours ago, Tippis said: My immediate suggestion would be to try to make a template mission — any files that you reuse can just be reused directly; some that you don't can perhaps be used as generic placeholders where you can update their specific content to match the unique mission. E.g. if you use custom beacons with their own morse (or radio) signals, and want to use different identifiers in each mission, then re-use those units and setups, but give them names that let you easily identify which becaon is which file so all you have to do is mass-update the sound files because everything else is already set up properly. As for third-party stuff, there are a few frameworks that let you generate missions in various ways and which work within the data structures the .miz use. You can look for them in other parts of the Mission Editor subforum. There are also some scripting frameworks that let you include stuff at runtime, but this entails some level of breaking the security sandbox and/or might only work in SP with appropriately set up clients. This may be a bit of a blocker depending on how squeamish you about those things. so i have to manually add 200+ triggers to a 'template mission', and do that for EACH MAP... That's the only solution?!
Solution Tippis Posted March 8, 2024 Solution Posted March 8, 2024 (edited) It's not the only solution, but it's the most immediately available. Depending on what other restrictions you have to adhere to, it might also be the one that saves you the most time. If it's mostly scripts you want to load, you can look up “dynamic script loading” as a topic all in and of itself, and what kind of setup is required to make that happen. Scripting in general can let you work around many of the annoyances in the mission editor, but the complexity will soon require you to set up a full on script debugging environment to make all of that work without turning your hear grey. Part of that should probably be to figure out what you actually need those triggers for, and if they are such a necessity that you need them in every mission you create. Some organisation and optimisation might cull a few from the list. And if it's only the triggers and their attached assets we're talking about, it's utterly trivial to transfer those from one terrain to the other — you just have to change the definition in the mission file of what terrain it is supposed to use. So you only have to do it once, and then change two lines of code for every other terrain you want to use. Edited March 8, 2024 by Tippis 1 ❧ ❧ Inside you are two wolves. One cannot land; the other shoots friendlies. You are a Goon. ❧ ❧
TEMPEST.114 Posted March 8, 2024 Author Posted March 8, 2024 36 minutes ago, Tippis said: It's not the only solution, but it's the most immediately available. Depending on what other restrictions you have to adhere to, it might also be the one that saves you the most time. If it's mostly scripts you want to load, you can look up “dynamic script loading” as a topic all in and of itself, and what kind of setup is required to make that happen. Scripting in general can let you work around many of the annoyances in the mission editor, but the complexity will soon require you to set up a full on script debugging environment to make all of that work without turning your hear grey. Part of that should probably be to figure out what you actually need those triggers for, and if they are such a necessity that you need them in every mission you create. Some organisation and optimisation might cull a few from the list. And if it's only the triggers and their attached assets we're talking about, it's utterly trivial to transfer those from one terrain to the other — you just have to change the definition in the mission file of what terrain it is supposed to use. So you only have to do it once, and then change two lines of code for every other terrain you want to use. Any chance of being more explicit on those two lines please?
Tippis Posted March 8, 2024 Posted March 8, 2024 (edited) If you open the .miz in any kind of zip explorer, you will find two files in it: one called “theatre”, which simply lists the theatre (this is how DCS mission listing knows what map the mission is on without having to interpret anything complex) and one called “mission”, which is the file that… drumroll… defines the mission. The “mission” file is a lua file, even though it lacks the extension, and can be opened up and edited in any competent text (or lua-specific) editor. Early on in the structure, you will find a data key that is called ”theatre” that likewise defines what map the mission is on. I don't know how standardised it is, but it seems to appear between the “weather” and “trigger” blocks in all the examples I looked at. It will look something like }, -- end of ["weather"] ["theatre"] = "Normandy", ["triggers"] = or }, -- end of ["weather"] ["theatre"] = "Syria", ["triggers"] = or }, -- end of ["weather"] ["theatre"] = "Falklans", ["triggers"] = …or any of the other internal names of the maps. To completely change over a mission from one terrain to another, just swap out the name in those two places. The one caveat is that each map has different coordinate systems, or at least different coordinate limits, so if you've place any units right in the middle of one map, they may end up at the very border of (or even beyond the border) another terrain, and you'll have to drag them back into place. This is why it's best to do this before you've placed any units at all, if you're building a template. Otherwise, you're looking at an awful lot of dragging-and-dropping, or even manual coordinate copy-and-pasting if stuff ends up outside of the visible editing area. Edited March 8, 2024 by Tippis 1 ❧ ❧ Inside you are two wolves. One cannot land; the other shoots friendlies. You are a Goon. ❧ ❧
TEMPEST.114 Posted March 8, 2024 Author Posted March 8, 2024 2 minutes ago, Tippis said: If you open the .miz in any kind of zip explorer, you will find two files in it: one called “theatre”, which simply lists the theatre (this is how DCS mission listing knows what map the mission is on without having to interpret anything complex) and one called “mission”, which is the file that… drumroll… defines the mission. The “mission” file is a lua file, even though it lacks the extension, and can be opened up and edited in any competent text (or lua-specific) editor. Early on in the structure, you will find a data key that is called ”theatre” that likewise defines what map the mission is on. I don't know how standardised it is, but it seems to appear between the “weather” and “trigger” blocks in all the examples I looked at. It will look something like }, -- end of ["weather"] ["theatre"] = "Normandy", ["triggers"] = or }, -- end of ["weather"] ["theatre"] = "Syria", ["triggers"] = or }, -- end of ["weather"] ["theatre"] = "Falklans", ["triggers"] = …or any of the other internal names of the maps. To completely change over a mission from one terrain to another, just swap out the name in those two places. The one caveat is that each map has different coordinate systems, or at least different coordinate limits, so if you've place any units right in the middle of one map, they may end up at the very border of (or even beyond the border) another terrain, and you'll have to drag them back into place. Brilliant help! Thank you so very, very much!
Recommended Posts