GeoS72 Posted April 10, 2022 Share Posted April 10, 2022 This isn't a bug per se. This thread is more about identifying an oddity and appeasing my OCD. I noted the list of radio channels has no sort order when looking at the mission file (no extension) from a .MIZ file. The important thing is the radio channel list is sorted correctly in the ME. I normally do all my radio channel updates via Notepad++, external to the ME, from a master file to the desired mission file (extracted from the .MIZ). When I copy from the master file, the channel presets are in numerical order. Once the file is saved then opened in the ME, the simplicity of a numerically sorted channel list is lost. Why does the radio channel list get scrambled? Here is an example: 1 Link to comment Share on other sites More sharing options...
Vakarian Posted April 12, 2022 Share Posted April 12, 2022 I'd guess it's the way DCS is doing de/serialization of list type objects. Lists might get "scrambled", but there's nothing stopping you from rearraning them or copying list in an ordered manner in the file. As long as all the data is there and when deserialized in the mission editor it gets displayed correctly, you shouldn't be concerned if it turns out a bit out of order. Ensuring the data is serialized/deserialized in specific order is not worth the time most of the times. All those channels have their indexes in the square brackets so they should (haven't tested it) get populated in mission editor according to them. So even if they are shown here like this, that doesn't mean they are going to be shuffled in the actual radio presets. Link to comment Share on other sites More sharing options...
Grimes Posted April 12, 2022 Share Posted April 12, 2022 Yes it tends to be how lua serializes tables. The same occurs if you do something like `for index, freq in pairs(Radio.channels) do` then if you print the values it'll be out of order. Fun part is it can be out of order in the same pattern on multiple runs. You'd have to use `for i = 1, 20 do` to get the values in order. Might be best to just write something that'll make the changes automatically. 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 Link to comment Share on other sites More sharing options...
Recommended Posts