Kolyma Posted January 5, 2015 Posted January 5, 2015 Is there any way to call the system functions I see in the lua files like in \DCS World\Scripts\Database I see lots of functions in these files and if possible, I'd like to use them in my scripts. For example, how would I invoke this function (from the file db_callnames.lua) from within my own lua script? function db.getUnitCallnames(countryId, unitAttributes)
FSFIan Posted January 5, 2015 Posted January 5, 2015 You can't, the Mission Scripting environment is completely isolated. For some functions, you may be able to load the modules yourself using require() if you mod your game's MissionScripting.lua file, but then your mission will not run on a standard install any more. 1 DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
Igneous01 Posted January 5, 2015 Posted January 5, 2015 Ian;2282651']You can't, the Mission Scripting environment is completely isolated. For some functions, you may be able to load the modules yourself using require() if you mod your game's MissionScripting.lua file, but then your mission will not run on a standard install any more. This is the real unfortunate thing about having lua in DCS. Theres the potential to do many cool things but the only things we get access to are a handful of actions or functions that triggers already provide. I still dont understand why DCS offers export.lua functions like radio.isenabled and radio.frequency yet we cant check this ourselves using lua inside a mission. I suppose the only real way to get any value out of lua is to mod the game - but then that segregates the player base that doesn't use mods in the first place. 1 Developer of Kaukasus Insurgency - a customizable Dynamic PvE Campaign with cloud hosting and stats tracking. (Alpha) http://kaukasusinsurgency.com/
Kolyma Posted January 5, 2015 Author Posted January 5, 2015 Bummer dude. Most of what I'm trying to do is access some of the pre-built tables of information and the functions that run against them. Stuff like aircraft skins, loadouts, call signs. Many of the scripts by others I see here just cut-n-paste that info and I've been doing that with the randomize script I've been working on. But I had hoped to eventually be able to access those functions themselves. Ian;2282651']For some functions' date=' you may be able to load the modules yourself using require() if you mod your game's MissionScripting.lua file, but then your mission will not run on a standard install any more.[/quote'] As for this, I guess I could either cut-n-paste the functions I want, or just place copies of these files in my script directory and do some kind of lua "load/reference" external script thingy? But I am now thinking that might not easily work because the multiple lua files might not all end up packaged inside the *.miz file by the ME Thoughts?
Recommended Posts