TEMPEST.114 Posted October 5, 2022 Posted October 5, 2022 i.e. If you draw a line segment or polygon to define a 'no fly zone' - can you access this and it's in-world coords to use inside the DCS Scripting Engine? 1
Grimes Posted October 6, 2022 Posted October 6, 2022 Anything stored within the mission is accessible. Drawings are in env.mission.drawings You can iterate the tables via to access them. if env.mission.drawings and env.mission.drawings.layers then for i = 1, #env.mission.drawings.layers do local l = env.mission.drawings.layers[i] for j = 1, #l.objects do -- some drawing end end end Note that the data format is a little different than how you might draw that same thing via the scripting engine and the features of both are different overall. 1 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
TEMPEST.114 Posted January 23, 2023 Author Posted January 23, 2023 On 10/7/2022 at 12:18 AM, Grimes said: Anything stored within the mission is accessible If that's true then how do I get to the images inside 'pictureFileNameB' table? Because they're obfuscated with a ResKey.
Grimes Posted January 23, 2023 Posted January 23, 2023 9 hours ago, Elphaba said: If that's true then how do I get to the images inside 'pictureFileNameB' table? Because they're obfuscated with a ResKey. Via scripting I suppose you don't. Though if you know the filenames like with audio then you can hardcode it into some script because they will always be in the l10n\default folder. For example with this I knew the audio files for use with a speech construction script. local sFiles = {} -- Tusk sFiles[#sFiles + 1] = {file = 'tusk_complete.wav', len = 0.6, text = 'complete', voice = 'tusk'} sFiles[#sFiles + 1] = {file = 'tusk_out.wav', len = 0.9, text = 'out', voice = 'tusk'} sFiles[#sFiles + 1] = {file = 'tusk_Over.wav', len = 1.5, text = 'over', voice = 'tusk'} sFiles[#sFiles + 1] = {file = 'tusk_requestPicture.wav', len = 1.2, text = 'request picture', voice = 'tusk'} 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
TEMPEST.114 Posted January 24, 2023 Author Posted January 24, 2023 5 hours ago, Grimes said: Via scripting I suppose you don't. Though if you know the filenames like with audio then you can hardcode it into some script because they will always be in the l10n\default folder. For example with this I knew the audio files for use with a speech construction script. local sFiles = {} -- Tusk sFiles[#sFiles + 1] = {file = 'tusk_complete.wav', len = 0.6, text = 'complete', voice = 'tusk'} sFiles[#sFiles + 1] = {file = 'tusk_out.wav', len = 0.9, text = 'out', voice = 'tusk'} sFiles[#sFiles + 1] = {file = 'tusk_Over.wav', len = 1.5, text = 'over', voice = 'tusk'} sFiles[#sFiles + 1] = {file = 'tusk_requestPicture.wav', len = 1.2, text = 'request picture', voice = 'tusk'} Yeah, knowing them up front is fine if *I* made the mission, but if I didn’t then there’s a problem. it’s surely a bug that they aren’t exposed in script - especially as the key is exposed in env.mission.
Recommended Posts