SoW Reddog Posted March 25, 2017 Posted March 25, 2017 Is there a difference between the environments run from GameGUI files and those scripts run from mission triggers?
Grimes Posted March 26, 2017 Posted March 26, 2017 Yes. There are a few different "lua" environments that can exist within DCS, so it is best to think of each as a local set of values only accessible to oneself. Some have functionality to do scripting in other environments, others don't. Within gameGui you can run scripts withing the config, mission, and export lua environments in addition to the server environment that gameGUI exists in. So with the gameGUI you can use a function called 'net.dostring_in' to run a script in config, mission, or export. Gamegui is mostly used in multiplayer because it has a lot of functions meant for use in server admin scripting, but it also works in single player. 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
SoW Reddog Posted March 26, 2017 Author Posted March 26, 2017 Thanks Grimes. I hadn't realised there was a difference. D'oh! I had code which worked to a point (and then silently errored with nothing in the log) in GameGUI which when I moved it to the mission and fired it off via a trigger started erroring on things which worked previously like StatSystem.logFile:write(os.date("!%c").." - "..str.."\n")So I'm guessing that eventhandlers are not within the mission environment exposed via GameGUI then? and the net.log() isn't exposed within the ME trigger environment then? Is there a rundown on what does and doesn't work where?
Grimes Posted March 28, 2017 Posted March 28, 2017 Is there a rundown on what does and doesn't work where? DCSInstallFolder/API has a "DCSControl_API.txt" and that has all of the functions present within gameGUI. DCSInstallFolder/Scripts has an export.lua file which contains documentation of functions accessible to that area. On the hoggit wiki I've tried to keep it up to date as far as scripting engine goes. As I said in the my first reply, some of the environments have functionality that allows for it to run code in other environments. Specifically you could use net.dostring_in('mission', <somecode>) to run the string in the mission scripting environment. The scripting engine has its own event system. You can see it here: http://wiki.hoggit.us/view/Category:Events 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
Pikey Posted March 28, 2017 Posted March 28, 2017 And typically not much is shared, but I saw global flags are shared so you can do some limited communication. Or you can go full nuts and create a TCP socket and share what you like. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Recommended Posts