Jump to content
Sign in to follow this  
dontknowhow

Very newbish question: location of sqf files?

Recommended Posts

I am getting around with scripting, and I was wondering in what locations I can put a sqf file, which can be useful for testing. According to the documentation for execVM, a script is searched in:

  1. the mission folder
  2. the campaign scripts folder
  3. the global scripts folder

if I understand correctly:

number 1 doesn't have to be a pbo, but it can be the unpboed version of my mission, if it's in my local missions directory

number 3 is the Arma 2 addons directory

So, basically the only way to use a sqf file without putting it into a pbo is to put it in the same folder as my mission, in the local mission folder

Now, can someone confirm that I'm correct? Also, what is the campaign scripts folder?

Many thanks

Share this post


Link to post
Share on other sites

The PBO is simply a packaged form of your local mission folder. When you export the mission all your files (sqf, sqm and whatever else) will be "in" your PBO.

Share this post


Link to post
Share on other sites
The PBO is simply a packaged form of your local mission folder. When you export the mission all your files (sqf, sqm and whatever else) will be "in" your PBO.

Yes, I thought they were the same, but they aren't really. If I have a pbo called myscripts.pbo, which contains a file called script.sqf, I can call script.sqf from other missions (but the pbo has to be in the addons directory, which I don't understand either). However, if myscripts.pbo is actually a directory, I can't. I can only call the script from within the same pbo.

Hopefully I'm missing something

Share this post


Link to post
Share on other sites

Ahh, right.

You're entirely correct in your understanding of how it works. There's two uses of PBOs, mission files and addon files. Think of them more like ZIP files, a single file comprised of multiple files/folders.

So you have a mission in the editor and you want to run it on a server. In order to do that you need to Export it, creating a PBO, then put that file on the server and it can now run the mission.

The second use of PBOs is AddOns. AddOns are really of two kinds. Built in (those that came with the game and patches and are in the ArmA2\AddOns folder and player created ones. You could technically put the player ones in the AddOns folder, but that is dangerous since it could affect every mission you make from that point on.

It's a lot safer to put them in their own mod folders. Like if you had a PBO called MyScripts.pbo that held common scripts you use in all of your missions. You would create a folder called: "ArmA2\myscripts" Under that another folder called "addons", so it would be "ArmA2\myscripts\addons" and put your MyScripts.pbo in that addons folder. If you started your game with this added to your shortcut: arma2.exe -nosplash -mod=myscripts you'd then load the PBO with yourscripts automatically and have them available. Keep in mind everyone playing on your mission would also need that PBO installed if they wanted to play. So would the server.

It's telling the client where the PBO is that allows it to properly load the addon PBO. So Addon PBOs are outside of the Mission PBO and are loaded via the -mod= command line option when you start the game.

Any of that make sense? :)

Share this post


Link to post
Share on other sites
Ahh, right.

You're entirely correct in your understanding of how it works. There's two uses of PBOs, mission files and addon files. Think of them more like ZIP files, a single file comprised of multiple files/folders.

So you have a mission in the editor and you want to run it on a server. In order to do that you need to Export it, creating a PBO, then put that file on the server and it can now run the mission.

The second use of PBOs is AddOns. AddOns are really of two kinds. Built in (those that came with the game and patches and are in the ArmA2\AddOns folder and player created ones. You could technically put the player ones in the AddOns folder, but that is dangerous since it could affect every mission you make from that point on.

It's a lot safer to put them in their own mod folders. Like if you had a PBO called MyScripts.pbo that held common scripts you use in all of your missions. You would create a folder called: "ArmA2\myscripts" Under that another folder called "addons", so it would be "ArmA2\myscripts\addons" and put your MyScripts.pbo in that addons folder. If you started your game with this added to your shortcut: arma2.exe -nosplash -mod=myscripts you'd then load the PBO with yourscripts automatically and have them available. Keep in mind everyone playing on your mission would also need that PBO installed if they wanted to play. So would the server.

It's telling the client where the PBO is that allows it to properly load the addon PBO. So Addon PBOs are outside of the Mission PBO and are loaded via the -mod= command line option when you start the game.

Any of that make sense? :)

It kind of does, thank you. And now I'm thinking I might actually be in the wrong forum.

Anyway, this is more or less what I saw, it just doesn't match with what I read in the documentation (which was mentioning, among other things, the unknown campaign scripts folder). But does that mean that, if I want to test an addon with other missions, I can either pbo my addon or unpbo the mission and put the addon in it? I thought there might be a more efficient way.

Thank you

Share this post


Link to post
Share on other sites

If you're new to editing, completely ignore Campaigns. Those are a string of missions and if you're having trouble with just a mission, Campaigns can come later.

For now just put SQF files in the same MISSION folder as the mission itself. That's pretty much default. Very few people put scripts in addOns as you're describing. It's possible, but messy.

For object addons, like LittleBird or different units or something, it's outside of the mission. While the objects can be used IN the mission, you can't add the AddOn into the mission. The player would just have to have it loaded as well.

Share this post


Link to post
Share on other sites
If you're new to editing, completely ignore Campaigns. Those are a string of missions and if you're having trouble with just a mission, Campaigns can come later.

For now just put SQF files in the same MISSION folder as the mission itself. That's pretty much default. Very few people put scripts in addOns as you're describing. It's possible, but messy.

For object addons, like LittleBird or different units or something, it's outside of the mission. While the objects can be used IN the mission, you can't add the AddOn into the mission. The player would just have to have it loaded as well.

Okay, okay, I won't touch the campaigns :)

I was just mainly curious. The thing started because I was looking for an easy way to call my scripts from other missions. Then I saw that in the documentation and I wondered what that was. I am also writing some notes, and I would like them to be as accurate as possible.

Thanks for the info, I'll look at this mod option

Share this post


Link to post
Share on other sites

What I usually do is have a blank mission with the "core" scripts I use often, like Revive, Weapon Respawn, IEDs, vehicle respawn and the like and keep that as a mission folder.

Then when I go to make a new mission, just copy that folder naming it to whatever I want, then open the copied folder in the editor and do the mission. That way all my core stuff was transferred over and ready when I copied it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×