Home   Help Search Login Register  

Author Topic: Running scripts from folder?  (Read 1560 times)

0 Members and 1 Guest are viewing this topic.

Offline Vic

  • Members
  • *
Running scripts from folder?
« 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.

Offline tcp

  • Members
  • *
    • Violator Gaming
Re: Running scripts from folder?
« Reply #1 on: 06 Oct 2009, 18:08:20 »
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.

Offline Vic

  • Members
  • *
Re: Running scripts from folder?
« Reply #2 on: 06 Oct 2009, 21:28:39 »
Thanks, figured it out after a couple attempts.

[] exec "\myscripts\test.sqs" - where myscripts is a folder in the root ArmA dir

Offline tcp

  • Members
  • *
    • Violator Gaming
Re: Running scripts from folder?
« Reply #3 on: 07 Oct 2009, 00:49:34 »
cool, it's good that its a folder so its easier to modify

Offline MRO204

  • Members
  • *
  • I'm a llama!
Re: Running scripts from folder?
« Reply #4 on: 07 Oct 2009, 01:12:24 »
you can also

[] exec "C:\MyDocuments\myscripts\test.sqs"

as an example.

Offline i0n0s

  • Moderator
  • *****
Re: Running scripts from folder?
« Reply #5 on: 07 Oct 2009, 02:13:11 »
No, you can't this is fixed with a patch.