Home   Help Search Login Register  

Author Topic: Weapon Index  (Read 1773 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Weapon Index
« on: 21 Oct 2009, 13:10:22 »
Any idea about the logic behind weapon index (used for UseWeapon action)? How can this number be figured out automaticllay?

Offline Rommel92

  • Members
  • *
Re: Weapon Index
« Reply #1 on: 21 Oct 2009, 13:41:38 »
I believe it is the muzzles on the vehicle you are using it on (that includes 'man'). It all varies on the fire modes.
This is based off my experience with using it on ROMM_AI back in the day.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Weapon Index
« Reply #2 on: 21 Oct 2009, 14:23:24 »
It might be mix of defined muzzles and defined modes per present weapon, but again I dont see a clear rule there.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Weapon Index
« Reply #3 on: 21 Oct 2009, 18:39:01 »
 surely the index will match the number at which the weapon is added to the unit ?
 or in the case of a tank plane , it should match the Proxyindex of the turret (turrets canhave more than one weapon tho huh ? hmm) in the cfg file ?

 so far unit should be =
weapons[] = {
        "M4A1_Aim_camo",
        "M9",
        "ItemGPS",
        "Throw",
        "Put",
        "ItemMap",
        "ItemCompass",
        "ItemWatch",
        "ItemRadio",
        "Binocular"
      };

 and vehicle =

 class RightDoorGun : MainTurret
        {
          body = "Turret_2";
          gun = "Gun_2";
          animationSourceBody = "Turret_2";
          animationSourceGun = "Gun_2";
          animationSourceHatch = "";
          selectionFireAnim = "zasleh_1";
          proxyIndex = 2;           <<<<<<<<<<<<<<<<<
          gunnerName = "door gunner";
          commanding = -2;
          minTurn = -150;
          maxTurn = -30;
          initTurn = -90;
          weapons[] = {
            "M240_veh_2"
          };      <<<<<<<<<<<<<<     

 just a guess but if i know BIS , it wont be that straight forward ;).
« Last Edit: 21 Oct 2009, 18:46:41 by DeanosBeano »
I love ofp

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Weapon Index
« Reply #4 on: 21 Oct 2009, 19:16:58 »
Well, for vehicles it seems to match a number which is related to the weapon position in the weapons unit array and the (modes of each weapon read from cfgweapons max 1).
For example, weapons = [A,B,C], A has two modes, B has none (so it counts as 1) and C has none, the weapon index for C is 2 + 1 = 3. But this becomes false for soldiers, with soldiers I've tried to add not only modes but also muzzles, and again the resulting number doesnt match the real index. And soldiers might have the unlisted weapons Throw and Put, so it becomes even more tricky. Anyway there should be a logic behind that, it cannot be a so chaotic number as it seems at first sight.

Offline defunkt

  • Members
  • *
Re: Weapon Index
« Reply #5 on: 22 Oct 2009, 12:09:38 »
Didn't we establish that it is logical but without a function to query if the unit is carrying Throw (or Put) weapons we cannot determine it?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Weapon Index
« Reply #6 on: 22 Oct 2009, 12:18:26 »
Yes, we can (checking for magazines), but then we should find a rule for the extra indexes derived of having Put magazines or/and Throw magazines. The current rule which works for vehicles count (weapon modes max 1) for each weapon in the order they are returned with "unit weapons" command, doesnt work for soldiers, for soldiers muzzles per each weapon seems to be in the formula too. Also there are "item" weapons that I dont know if should be counted or not (map, gps, etc).

Offline defunkt

  • Members
  • *
Re: Weapon Index
« Reply #7 on: 22 Oct 2009, 20:11:35 »
Good (check for magazines) then I suppose it is a matter of dropping everything (you said this will make the first weapon mode/muzzle '0') and trialling one by one items not in the weapons array to try and ascertain how they influence the indexing.