Buzzer1977 Posted December 25, 2024 Posted December 25, 2024 _G["countries"] is a mess. I'm currently trying to do some dynamic scripting, but mapping of countries is a complete mess. No matter which data i'm looking for, everything is completely inconsistent and messed up. Is there a chance this will ever get fixed? F.e. "names" is lacking IDs 1-14 "names": [ "UKRAINE", "USA", "TURKEY", "UK", "FRANCE", "GERMANY", "AGGRESSORS", "CANADA", "SPAIN", "THE_NETHERLANDS", "BELGIUM", "NORWAY", "DENMARK", "15": "ISRAEL", "16": "GEORGIA", "17": "INSURGENTS", "18": "ABKHAZIA", "19": "SOUTH_OSETIA", "20": "ITALY", .... "88": "NIGERIA", "89": "PERU", "90": "ECUADOR", "91": "AFGHANISTAN", "92": "NEW ZEALAND", "0": "RUSSIA" ] AMD Ryzen 9 5950x, MSI MEG x570 Unify, G.Skill 128GB DDR4-3200, MSI RTX3090 Ventus 3x 24GB, Samsung PCIe 4.0 M.2 1TB 980 Pro, Seagate PCIe 4.0 M.2 2TB FireCuda 520, Quest 3
cfrag Posted December 25, 2024 Posted December 25, 2024 (edited) 7 hours ago, Buzzer1977 said: _G["countries"] is a mess Ummm. You are trawling Lua's _G - the environment's global table. And yes, DCS's countries are a mess. Have been since Flanker days. To add fun to this, you'll notice that there is no country with ID=14 when you look at the country enum. 7 hours ago, Buzzer1977 said: Is there a chance this will ever get fixed? Doubtfully. ED aren't exactly known for their code engineering prowess, at least not when it comes to MSE's API. Edited December 25, 2024 by cfrag 2
Buzzer1977 Posted December 25, 2024 Author Posted December 25, 2024 Most collections in ["countries"] are f'ed up. "by_idx" -> f'ed & mostly redundant to by_country, but in f'ed up way. "names" -> f'ed "name" -> f'ed & redundant to names "id" -> usable, but why isnt' it called by_idx? "by_country" -> usable Most convinient way to fix this would be if ED could add the WorldID key to 0-14 in "by_idx". The inconsistent usage of countryName, ShortName, ID (i.e. WorldID) in the API drives me crazy too. Why in the World do they have 3 primary keys? Especially WorldID starting with 0 for Russia making access to arrays via LUA impossible? This way you always have to traverse collections instead of direct access to a fixed length, fixed position array. AMD Ryzen 9 5950x, MSI MEG x570 Unify, G.Skill 128GB DDR4-3200, MSI RTX3090 Ventus 3x 24GB, Samsung PCIe 4.0 M.2 1TB 980 Pro, Seagate PCIe 4.0 M.2 2TB FireCuda 520, Quest 3
cfrag Posted December 25, 2024 Posted December 25, 2024 I feel that you should never assume that ED invests any talent, knowledge, nor engineering when they create something related to MSE API or in-game UX. To me it looks as if the cheapest, spur-of-moment idea is enough to make it into production. Look at the trigger singleton and marvel at how getUserFlag and setUserFlag are in different branches. Try to wrap your head around why its action branch mirrors some, but not all methods from missionCommands, and in an incompatible way that does not integrate. Too much of the API looks like un-skilled amateur work, and it is inconceivable to me that anyone with even the barest minimum of engineering knowledge green-lit something this unprofessional. I feel that DCS's MSE API is in a really, really bad state. I hope that it will improve someday. The cruel joke that's our current warehouse API doesn't make me optimistic, though. So don't complain too vociferously (you are likely to be awarded warnings for your trouble), and try to make the best of it, try and create fun missions despite the obstacles thrown in your way by the API and/or ME. 3
Recommended Posts