Home   Help Search Login Register  

Author Topic: Problem in script with OAH installed / not installed  (Read 1518 times)

0 Members and 1 Guest are viewing this topic.

Offline LurchiDerLurch

  • Members
  • *
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
« Last Edit: 02 Jul 2010, 17:26:49 by LurchiDerLurch »

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Problem in script with OAH installed / not installed
« Reply #1 on: 03 Jul 2010, 20:39:37 »
Make two versions of your addon.
Best to use version control for that.

Offline i0n0s

  • Moderator
  • *****
Re: Problem in script with OAH installed / not installed
« Reply #2 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.

Offline LurchiDerLurch

  • Members
  • *
Re: Problem in script with OAH installed / not installed
« Reply #3 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: