Jump to content
Sign in to follow this  
feuerexcz

Launching script from config

Recommended Posts

Okay, here's the problem. I want to make a mod that contains 2 scripts. Script Start.sqf needs to be launched right after a mission start. Other script is then called by script Start.sqf. I need this to work in any mission, without changing the mission files, without adding anything into the mission. Completely mission-independent. I want to ask if something like this is possible in Arma and how it's done, because the way that I'm trying doesn't work for some reason. I found a mod for Arma 2 that does pretty much the same thing that I want, but I was still unable to make this work.

Here's what I've done so far:

I have a config.cpp and both of my scripts in the folder P:\Testmod\Testmod\

I use the BinPBO to pack the folder P:\Testmod into a .pbo.

I have a subfolder in the Arma 3 folder. \Arma 3\@Testmod\addons\Testmod.pbo

I even created .bisign and .bikey for this, don't know if it's any help or not.

I am testing the game with CBA and Testmod checked in the Expansions tab. The game keeps telling me that it can't find the script start.sqf.

The config looks like this:

class CfgPatches
{
class Testmod
{
 units[] = {"Testmod"};
 weapons[] = {};
 requiredVersion = 0.1;
 requiredAddons[] = {"Extended_Eventhandlers"};
};
};
class Extended_PostInit_EventHandlers
{
init = "[] execVM ""\Testmod\Start.sqf"";";
};

class CfgVehicles
{
class Plane;
class testmodinit: Plane{};
};

I tested the scripts in a mission and when they are in the mission folder, they work fine with no errors. I guess the problem will be in the path to them, both in config and in the script itself. I have very little experience with file paths in A3 and have no idea how to fix the errors.

The second script is called by this:

nul = [] execVM "\@Testmod\Testmod\hint.sqf";

As I said, the game can't find any of the scripts that I want to launch, it tells me that the first script start.sqf wasn't found, in the main menu and then after launching a mission. I tried to copy different codes from tutorials, changed this and that, but still no success. If anyone knows what to do with this, I would be really grateful for any help.

Share this post


Link to post
Share on other sites

Instead of binpbo, use the new tools (in steam/tools) or pboproject. Your path looks fine to me, so it might be that your mod is not packed properly.

Alternatively you could use functions defined in Cfgfunctions to avoid using CBA (look at the values "preInit", "postInit" etc.)

Share this post


Link to post
Share on other sites

You, sir, deserve a medal!

After downloading new tools, packing and unpacking a few archives, I finally packed it all in the right way. I'm so glad that there were no more complicated problems.

I'm also going to have a look at the functions, and see how that works.

Some minor adjustments had to be done, but it works all nice and smooth!

Thanks for quick help!

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  

×