Home   Help Search Login Register  

Author Topic: Configs of some air vehicles screwed?  (Read 1098 times)

0 Members and 1 Guest are viewing this topic.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Configs of some air vehicles screwed?
« on: 03 Apr 2008, 02:55:24 »
Ok, this is an odd one. In my script i use this line to get standard weapons of a air vehicle:
Code: [Select]
_veh_payload = getArray(configFile>>"CfgVehicles">>classname>>"Weapons");

This works on almost all planes/choppers. I get a complete array with all standard weapons of the corresponding vehicle.

I wrote "almost" since i encountered the problem that on the AH1W and the Su34 (both versions) all i get is an empty array [].

Also checked outside the script with a radio trigger:
Code: [Select]
hint format ["%1", getArray(configFile>>"CfgVehicles">>classname>>"Weapons")]

which gave me correct arrays on a A10, on the AV8B (both of them), the KA50 and a UH60 (with FFAR's).
Right now i didn't tested with others (but probably will).

Has anyone an idea why this happens? Can anyone confirm this behaviour?


Myke out

:EDIT:
As my ArmA runs with beta patch 1.11 i tried with 1.08, guessing BI might have something screwed up in the beta patch but the proble also exists with 1.08
« Last Edit: 03 Apr 2008, 03:13:34 by myke13021 »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Configs of some air vehicles screwed?
« Reply #1 on: 03 Apr 2008, 04:49:08 »
More than likely because the weapons and magazines properties for those aircraft are in subclasses of the config definition:

class AH1W.......class Turrets......class MainTurret.........weapons

Similar for the SU34......all other aircraft don't have turrets.


Planck
I know a little about a lot, and a lot about a little.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Configs of some air vehicles screwed?
« Reply #2 on: 03 Apr 2008, 12:30:57 »
Ah, i see. Probably it is, if the vehicle is meant to have pilot AND gunner, it has turret and the code will not work on such vehicles.

Thx for lighten me up, Planck.


For my script right now it will not be a problem, since the vehicle is already created and i could get the weapons list by simply using the weapons on it.



Btw, Planck: how about to write a "Config tutorial for scripters"?  :D :D :D