Mt5_Roie Posted January 28, 2016 Posted January 28, 2016 So I load the menu items script right after MIST, CTDL, and CSAR scripts get loaded. I have it do checks to see if any flag are on and set up the F10 menu options based on that. What I would like to do is call that menu setup function in another script later on when a flag is changed. Does the functions from all script get dumped into memory, or is each script sandboxed on its own? Currently I just have that function copy and pasted into every flag actions...which means if anything gets updated, I have to update all of them. Time consuming and trying to lean my code. Coder - Oculus Rift Guy - Court Jester
0xDEADBEEF Posted January 28, 2016 Posted January 28, 2016 all variables/functions/tables are global, unless specifically declared local
Steggles Posted January 28, 2016 Posted January 28, 2016 Unless your function is declared local as deadbeef has said, you should be able to access it from any script, outside of the script that its defined in, as long as that lua file is loaded before the function is called. -16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com EWRS - Early Warning Radar Script Specs: Gigabyte Sniper Z5-S Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler 16GB RAM Gigabyte GTX 1080 TM Hotas Warthog: SN: 06976 Saitek Pro Flight Combat Rudder Pedals TrackIR5 with TrackClipPro & Oculus Rift 2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024
Recommended Posts