Bug #6067

Script Error on Start of ArmA 2

Added by AlabasterSlim over 5 years ago. Updated about 5 years ago.

Status:Closed Start date:11/22/2009
Priority:Immediate Due date:
Assignee:ViperMaul % Done:

0%

Category:Review
Target version:0.6
Component: Affected Version:
Close Reason:

Description

I get this script error everytime I start ArmA 2 or anything I load a map. Here is the full error from the RPT

Error in expression <ba_events_keys_down };

_ar = _handlers select _key;
_entry = [_settings, _code]>
  Error position: <select _key;
_entry = [_settings, _code]>
  Error Zero divisor
File x\cba\addons\events\fnc_addKeyHandler.sqf, line 11

arma2_2009-11-22_09-59-13-60.png - Screenshot of error (39.1 kB) AlabasterSlim, 11/22/2009 15:01

Arma2.RPT (8.4 kB) AlabasterSlim, 11/24/2009 15:55

Arma2.RPT (33.5 kB) AlabasterSlim, 11/24/2009 16:36

ace_keys.hpp - Fresh ACE_KEYS.HPP (4 kB) rocko, 11/24/2009 16:51

Profiles.rar (3.9 kB) AlabasterSlim, 11/24/2009 18:08

AlabasterSlim.ArmA2Profile - Current Working Profile (10 kB) AlabasterSlim, 11/24/2009 20:03

Arma2.RPT - Cleaned RPT with new events.pbo (178.7 kB) AlabasterSlim, 11/24/2009 20:03

Arma2_2009-11-24_14-58-22-29.png - Disabled Profile (54.7 kB) AlabasterSlim, 11/24/2009 20:03

Arma2_2009-11-24_14-58-32-10.png - Enabled Profile (54.9 kB) AlabasterSlim, 11/24/2009 20:03


Related issues

related to Community Base Addons - Bug #6283: CBA_fnc_addKeyHandler may access an array out of bounds. Closed 11/26/2009

History

Updated by rocko over 5 years ago

  • Assignee set to Sickboy

Updated by AlabasterSlim over 5 years ago

Just for the hell of it I tried using my command line as -mod=x;@ACE;@ACEX;@CBA using the x mod folder downloaded from the ShackTac Yoma settings.

This error vanished when this was done.

Please advise - should we have the "x" mod, it wasn't included in our instructions but seems to be used by ACE2.

Updated by ViperMaul over 5 years ago

This one is tough to explain. First you need to follow this short answer.
  1. add -nofilepatching to your commandline.
  2. And for ACE2 testing remove the X folder from your mod line.
  3. Then Retest.

This is most likely because you have an X folder in your system
and
Because CBA PBOs have the following line in them for example "x\cba\addons\events" as their $PBOPREFIX$ the new Arma2 system will look for files in the x\cba\addons\events folder and if there are problems you will get unexpected errors.

The ACE2 instructions only directs Developers to use the X folder and only as x\cba;x\ace;x\acex;
Never as x alone like it appears you have. BUT AGAIN If you are not a developer, then you should only be looking at the Setup for Testers. If you are shacktac tester you should only be looking at the specific link for ShackTac testers Link: ShackTac Tester QuickStart or reviewing the instructions in the ShackTac forums which should have steered you clear of this X folder issue.

I am not saying this short answer above will solve your problem. But I am saying is that the above short answer is for testers who have an x folder existing on their hard drive in the Arma 2 folder. This short answer instructions above is the safe method to keep you from extra unexpected errors.

Updated by ViperMaul over 5 years ago

Actually it looks like you followed the Setup for Developers now that I read this more.
Get with me on Skype and we will fix this for you.

Updated by ViperMaul over 5 years ago

  • Status changed from New to Assigned
  • Assignee changed from Sickboy to ViperMaul

Updated by AlabasterSlim over 5 years ago

I first encountered this error prior to having the "x" folder or mod. I'll speak to you on Skype to nail down what's going on.

Updated by dslyecxi over 5 years ago

This should have been handled through our Skype chat first, and not through the bugtracker. User has been informed of this.

Updated by AlabasterSlim over 5 years ago

Updated by AlabasterSlim over 5 years ago

As discussed in Skype, here is the second RPT file, with the new cba_events.pbo.

Keybinding for reloading is set to ONLY "R"

Updated by rocko over 5 years ago

Can you get a fresh ace_keys.hpp file from somewhere and try it with that one? And not apply changes to it.

Also please add your ace_keys.hpp file here or paste it somewhere and give the link.

Updated by rocko over 5 years ago

Updated by ViperMaul over 5 years ago

Ok as it turns out, even after using the proper shortcut the problem still exists.
After speaking with Sickboy, he helped me narrow this down to what seems to be a bug when you move away from the default "ReloadMagazine" key binding in Arma2.

This is a good bug find in my opinion.
I was able to reproduce the problem.

The workaround for me was to go back to the ReloadMagazine" key binding and click the Default button and save.
Since we have found steps to reproduce we can now hand this off to a developer for a fix or add some robustness.

Thank you AlabasterSlim for stepping forward.

Updated by ViperMaul over 5 years ago

Sickboy writes: extract from sys_rangefinder preInit:

{ [_x, [false, false, false], { call FUNC(settingsKeyDownHandler) }, "DOWN"] call CBA_fnc_addKeyHandler; } forEach (actionKeys "ReloadMagazine");

This bug may end up being moved to CBA.

Updated by ViperMaul over 5 years ago

  • Assignee changed from ViperMaul to Sickboy

Updated by AlabasterSlim over 5 years ago

As requested, here are my user profiles. The default profile is Marc, the one I use is AlabasterSlim

Updated by ViperMaul over 5 years ago

It should be noted, that the reason these profiles were requested is that.
1) after returning the AlabasterSlim profile to default Arma2 keybinds the problem still remained.
2) only after switching profiles to Marc did the error go away.
The question is why does ACE not recognize the default changed keybinds to AlabasterSlim profile when Arma2 recognizes it. Could be a separate bug. Separate from the addKeyHandlers bug.

Updated by AlabasterSlim over 5 years ago

Note: Also using trackIR and the Xbox 360 Controller.

Updated by ViperMaul over 5 years ago

ViperMaul wrote:

Sickboy writes: extract from sys_rangefinder preInit:

[...]

This bug may end up being moved to CBA.

Here is debug output requested by Sickboy

http://pastebin.jonasscholz.de/289

Updated by Sickboy over 5 years ago

Thanks, my guess is that 196876 (the key assigned to "ReloadMagazine") as array index is simply too much, though investigation should be done into the limits of array indexes.
I guess ar = []; ar set [196876, true]; will yield a same kind of error.

Updated by Sickboy over 5 years ago

  • Assignee changed from Sickboy to ViperMaul

Updated by ViperMaul over 5 years ago

So the question if true, is this an ACE bug, CBA bug or Arma2 limitation/bug?
It looks like we can rule out ACE bug at least right?

Updated by AlabasterSlim over 5 years ago

Finally got home so I could test this with the Xbox 360 Controller. There seem to be two conditions that if true will cause this error.

Normal Condition: If keybind R (only), No Error

Error Conditions:

If ((keybind != R) or (keybind R && keybind != R[ie. something else])) , Causes Error

If Xbox 360 Controller Profile is Enabled, Causes Error (See Screenshots).
The default 360 control for reload is the Blue X. When using the 360 profile in game other script errors appear, but the game seems to function normally.

Updated by killswitch over 5 years ago

This looks to a bug in CBA (events component) - the function CBA_fnc_addKeyHandler is trying to access an element at, for example, index 196876 in an array that is only 251 elements in size.

The fix is to have CBA_fnc_addKeyHandler resize the relevant array if needed. I'll get right to it...

Update: See #6283

Updated by rocko over 5 years ago

  • Category changed from Script to Review
  • Status changed from Assigned to Resolved
  • Priority changed from Normal to Immediate

Updated by AlabasterSlim over 5 years ago

ViperMaul provided me with an update effects_cba.pbo that works.

Updated by ViperMaul over 5 years ago

  • Status changed from Resolved to Closed

Updated by ViperMaul over 5 years ago

Again nice bug report AlabasterSlim!

Updated by Sickboy about 5 years ago

  • Target version set to 0.6

Also available in: Atom PDF