Home   Help Search Login Register  

Author Topic: Removing Duplication from Action Menu with Weapons Config Modes  (Read 2238 times)

0 Members and 1 Guest are viewing this topic.

Offline ViperMaul

  • Members
  • *
    • Theatre Of War (Team PvP Campaign)
My goal is to add two modes to the Javelin via config. The two modes are Top Attack and Direct Attack. These are selectable just like changing from Semi-Automatic to Full Automatic modes for a rifle using the F key.
My problem when I do this, it creates duplicate weapons on the Action Menu when you place the weapon in your inventory.

Expectations:
Like most AT weapons in your inventory, you should see one Action Menu item for each AT weapon you have. When selected it shows the animation of you switching from your primary weapon to your AT weapon.

I should see in the Action Menu list one entry that reads
"Weapon Javelin"

The Problem:
When I add more than one mode, I get two Action Menu items suggesting that I currently have two AT weapons in my inventory. Upon further testing it is discovered that each Action Menu item starts the weapon in one mode or the other. This would be ok if I had control over the text of each seperate Action Menu item but I do not seem to.

Thus the problem is I see the following in the Action Menu list two entries for each mode with improper text.
"Weapon Javelin"
"Weapon Javelin"

How do I fix this?

Here is the code: 
or as shown here
Code: [Select]
class Javelin: Launcher
{
ACE_Weight = 6.42;
magazines[] = {"Javelin","ACE_Javelin"};
sound[] = {"\ace_sound_weapons\snd\Wep\Javelin_Fire.wss", 25, 1};
recoil = "ACE_EmptyRecoil";
ace_at_weapon = 1;
ace_at_unguided_weapon = 0;
};

class ACE_Javelin: Javelin
{
//magazines[] = {"ACE_Javelin"};
modes[] = {"ACE_Javelin_directFire","ACE_Javelin_topFire"};

class ACE_Javelin_directFire
{
displayName = $STR_ACE_WDN_ACE_JAVELIN_DIRECT;
sound[] = {"\ace_sound_weapons\snd\Wep\Javelin_Fire.wss", 25, 1};
drySound[] = {"", 0, 0};
soundContinuous = false;
burst = 1;
autoFire = 0;
soundBurst = 0;
multiplier = 1;
aiRateOfFire = 0.2;
aiRateOfFireDistance = 1500;
useAction = false;
useActionTitle = "Direct Mode";
reloadTime = 0;
magazineReloadTime = 12;
recoil = "ACE_EmptyRecoil";
recoilProne = "ACE_EmptyRecoil";
dispersion = 0.0025;
minRange = 50;
minRangeProbab = 0.04;
midRange = 200;
midRangeProbab = 0.7;
maxRange = 450;
maxRangeProbab = 0.04;
showToPlayer = true;
ace_at_weapon = 1;
ace_at_unguided_weapon = 0;
}
class ACE_Javelin_topFire: ACE_Javelin_directFire
{
displayName = $STR_ACE_WDN_ACE_JAVELIN_TOP;
minRange = 350;
minRangeProbab = 0.2;
midRange = 1050;
midRangeProbab = 0.9;
maxRange = 2500;
maxRangeProbab = 0.14;
ace_at_weapon = 1;
ace_at_unguided_weapon = 0;
useActionTitle = "Top Attack Mode";
}
};

Here is the Muzzle version of the code:  http://pb.6thsense.eu/pb/180
Same problems.


How can I resolve this?
« Last Edit: 17 Aug 2008, 00:16:57 by ViperMaul »
ViperMaul
Theatre of War (Co-Lead Dev)
ACE (Jr Project Manager)

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Have you tried this?:
Code: [Select]
class ACE_Javelin_directFire
{
    ...
    showSwitchAction = 0;
};
class ACE_Javelin_topFire: ACE_Javelin_directFire
{
    ...
    showSwitchAction = 1; // Assuming you want top-fire as the default mode.
};

Bit of a guess on my behalf, but worth a try (showSwitchAction is used to make the binocs come up in the menu, but the other optics not to). Although nothing else explicitly uses it, all fire modes usually inherit from single/burst/fullauto, which might have the value set in them outside the config.
« Last Edit: 17 Aug 2008, 15:44:16 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline ViperMaul

  • Members
  • *
    • Theatre Of War (Team PvP Campaign)
Worth a try.
I didn't even know showSwitchAction existed or was relevant from reading the BI Wiki. Thanks I will let you know.

EDIT:
Unfortunately showSwitchAction did not change behavior in any way.

EDIT:

It appears that it is just impossible or a bug.
When Primary = false like AT weapons; the problem of Modes == Menu Items for each mode = With wrong text.
As soon as you set Primary = True like rifles then the problem immediately goes away.

So FoxHound is either right or it is a bug I am guessing.
Because you should be able to mod just about any weapon I would think.
If fact the MODES do work just fine. Just the menu corruption is there.
« Last Edit: 19 Aug 2008, 15:32:18 by ViperMaul »
ViperMaul
Theatre of War (Co-Lead Dev)
ACE (Jr Project Manager)