OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: LurchiDerLurch on 02 Jul 2010, 17:01:04

Title: Problem in script with OAH installed / not installed
Post by: LurchiDerLurch on 02 Jul 2010, 17:01:04
Hello,

I know how I can check if OAH is installed:

Code: [Select]
 
if (!(isClass(configFile>>"CfgMods">>"Expansion"))) then
{
//no OAH
}
else
{
       //OAH
};

But if I use a command from OAH for example
Code: [Select]
false setCamUseTi 0; ARMA2 refuses to execute the code...(or at least an error message appears... the script itself seems to work how it should) even if it's a dead code... he never enters it.  :/

Any idea?

edit: Maybe with exceptions? try {} catch{} ... but how does ARMA2 exactly handle exceptions?
Lurchi
Title: Re: Problem in script with OAH installed / not installed
Post by: kju on 03 Jul 2010, 20:39:37
Make two versions of your addon.
Best to use version control for that.
Title: Re: Problem in script with OAH installed / not installed
Post by: i0n0s on 03 Jul 2010, 23:23:26
Move all calls to new commands into a separate file.
Preload that file only if OA is present and it should work fine.
Title: Re: Problem in script with OAH installed / not installed
Post by: LurchiDerLurch on 04 Jul 2010, 11:39:18
Move all calls to new commands into a separate file.
Preload that file only if OA is present and it should work fine.

It works. Thank you.  :cool2: