James
Notice that you will have to activate file patching via -filePatching. Otherwise execVM and loadFile will not load any files outside your mission folder (like the global scripts).
Results appear below as you type; use the arrow keys to move through them.
Command · Markdown · JSON · original wiki page
Returns the content of given files. If you plan to compile said string, be aware that the file should not contain comments or compile will throw an error. If there are comments, use preprocessFile/preprocessFileLineNumbers instead.
Warning
If the file is not prepared using UTF-8 encoding and contains some characters with codes > 127, they might convert incorrectly.
loadFile fileName
Parameters:
fileName: StringReturns: String
_contents = loadFile "wantedString.txt";
_contents = compile loadFile "myFunction.sqf"; // will compile string into code
fileExists · preprocessFile · preprocessFileLineNumbers
Notice that you will have to activate file patching via -filePatching. Otherwise execVM and loadFile will not load any files outside your mission folder (like the global scripts).