OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Vic on 06 Oct 2009, 16:44:55
-
Is it possible to run scripts from a folder? In OFP you could create a folder called "scripts" and you could run the scripts in there from any mission. I don't want to run them from a PBO or a mission folder, since I'd like to dynamically write those scripts using an external program.
-
From the BIKI on execVM:
The Script is first searched for in the mission folder, then in the campaign scripts folder and finally in the global scripts folder.
I haven't tried this but I think the global scripts folder is referring to your Addons folder. So any script that is within a .pbo that is loaded could be executed. I assume that includes ones you load via modfolders. There might be a way to predefine functions linking to a script in a specific location, but I think the usual way would to treat the pbo as a folder. So a script.sqf inside myscripts.pbo would be called by execVM "myscripts\script.sqf";
Sorry for sound so vague, but I've never had to try it.
-
Thanks, figured it out after a couple attempts.
[] exec "\myscripts\test.sqs" - where myscripts is a folder in the root ArmA dir
-
cool, it's good that its a folder so its easier to modify
-
you can also
[] exec "C:\MyDocuments\myscripts\test.sqs"
as an example.
-
No, you can't this is fixed with a patch.