Jump to content
Craig_VG

Check if a mod/addon is enabled

Recommended Posts

Hey guys, I have a quick question.

I knew how to do this at one point, but I've forgotten.

At mission start, I would like to define whether or not a certain mod has been loaded up on the machine in which the code is run from. In this case it's ACRE. With ACE I can just check if certain variables have been defined, but I'm not as familiar with ACRE.

My request: A snippet of code that checks if ACRE is running

Thanks

Craig

Share this post


Link to post
Share on other sites

ACE can be done like so:

if (isClass(configFile >> "CfgPatches" >> "ace_main")) then { \/* ACE is available *\/ } else { \/* ACE is NOT available *\/ };

I would guess you could try "acre_main" instead, or :

_acre = isClass(configFile >> "cfgPatches" >> "acre_main"); // Returns true if ACRE is enabled

Is this what you're after?

Edited by panther42

Share this post


Link to post
Share on other sites

Yeah that's what I'm looking for, are you sure it would work though?

Share this post


Link to post
Share on other sites

Copy that.

I don't have ACRE either, so we're both out of luck on this one.

Share this post


Link to post
Share on other sites

Some dominations have this feature, where it displays a message and/or kicks you if you don't have acre. Maybe try and find one of those to see how they did it. Or, at least go download ACRE so you can test panthers suggestion.

---------- Post added at 21:56 ---------- Previous post was at 21:50 ----------

I suggest using PWS, joining some ACE/ACRE servers. Almost all of those demand ACRE. Then go into your missions cache and un-pbo the file.

Share this post


Link to post
Share on other sites

Well, I guess you could test this much, since neither of us have ACRE:

if (isClass(configFile >> "CfgPatches" >> "acre_main")) then { hint "ACRE is available"} else {hint "Hey Jackwagon, you don't have ACRE"};

Just do a google search for if (isClass(configFile >> "CfgPatches" >> "acre_main"))... seems to be the correct name

Edited by panther42

Share this post


Link to post
Share on other sites

Just for future reference, you can find the cfgPatches name for any addon loaded on your copy of Arma by running the following script (just execVM it from a trigger in the editor). It will dump the cfgPatches names for all active addons into the rpt. Then look through it and find the one you need :)

for "_i" from 0 to (count (configFile / "CfgPatches") - 1) do 
{
_cfg_entry = (configFile / "CfgPatches") select _i;

if (isClass _cfg_entry) then
{
	diag_log format ["%1", _cfg_entry];
};
};

Share this post


Link to post
Share on other sites

Yeah Das Attorney, that does work, but neither of us have ACRE, so that won't work so well...

Do you use ACRE? Maybe you can test for bobtom

Share this post


Link to post
Share on other sites

lol no unfortuately not :D

I used to have it when I played online with VCB, but uninstalled it when I changed PC's.

That said, acre_main seems to be the way to go :)

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

×