I've got an API for diagnostics that I won't always want loaded. However, on occasion it might be useful to try and load it via a chat command (I've already made an API for managing chat commands).
Can include() be used during a game, or does it only work when the JS env is being initialised?
Here's what I want to do:
Code: Select all
var diagPaths = ["multiplay/skirmish", "multiplay/skirmish/api"];
diagPaths.some(function(path) {
include(path+"/Diag.js");
return (typeof Diag == "function"); // will not try any more paths if loaded
});
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO