Closed bux closed 10 years ago
Don't add them via addWeapon, but with addItem. Thats a side effect from them being available in the VA. Adding them via addItem doesn't have this side effect. The same happens when you add the MineDetector via addWeapon.
Repro: ammo_box addWeaponCargo ["MineDetector", 1] -> MineDetector has no weight and can be equipped as secondary weapon.
ammo_box addItemCargo ["MineDetector", 1] -> MineDetector has weight and cannot be equipped as weapon.
The items were taken from the AGM Misc ammo box.— JD
On Thu, Oct 2, 2014 at 9:28 AM, commy2 notifications@github.com wrote:
Don't add them via addWeapon, but with addItem. Thats a side effect from them being available in the VA. Adding them via addItem doesn't have this side effect. The same happens when you add the MineDetector via addWeapon.
Reply to this email directly or view it on GitHub: https://github.com/KoffeinFlummi/AGM/issues/1223#issuecomment-57593249
Can't reproduce then:
:grin: Your favorite kind of bug:
It's a Zeus placed AGM Misc box
Ah ffs.
The same with the medical items, from the Medical box (Zeus placed). Obviously!
Is there an ammo box from the vanilla game that has the mine detector? If so, can you check if the same happens to the mine detector?
"Box_NATO_Support_F" has a mine detector ....
It does. BIS's fault then?
Yes. How did you place an ammo box with zeus anyways?
Got it. The same happens with a zeus placed "Box_NATO_Support_F" to the mine detector. Because the AGM items have to be the same kind of item the mine detector is, to show up in the VA, I can't fix this.
I'll open an issue in the feedback tracker.— JD
On Thu, Oct 2, 2014 at 10:05 AM, commy2 notifications@github.com wrote:
Got it. The same happens with a zeus placed "Box_NATO_Support_F" to the mine detector. Because the AGM items have to be the same kind of item the mine detector is, to show up in the VA, I can't fix this.
Reply to this email directly or view it on GitHub: https://github.com/KoffeinFlummi/AGM/issues/1223#issuecomment-57595966
Thx.
Edit: Make sure to also mention the addWeaponCargo vs. addItemCargo stuff
Can't this be closed? Nothing we can do about it...
:+1: Close
I'm working on an init script for the crate, that removes weapons and readds items.
I wrote the function just to realize that they fixed this? Can anyone confirm? AFK for 2 hrs.
Confirmed working, I can't put any item into launcher slot.
Meh, the ticket is still open. http://feedback.arma3.com/view.php?id=20997
backup, you never know:
// by commy2
private ["_crate", "_weapons", "_items"];
_crate = _this select 0;
// get all weapons inside the crate
_weapons = weaponCargo _crate;
_items = [];
// if the "weapon" is supposed to be an item, move those from the weapon array to the item array
{
if (getText (configFile >> "CfgWeapons" >> _x >> "simulation") == "ItemMineDetector") then {
_weapons set [_forEachIndex, ""];
_items pushBack _x;
};
} forEach _weapons;
_weapons = _weapons - [""];
// exit now if everything is fine
if (count _items == 0) exitWith {};
// otherwise clear weapon cargo and re-add items and weapons
// this function is executed on every PC, so use local commands
clearWeaponCargo _crate;
{
_crate addWeaponCargo [_x, 1];
} forEach _weapons;
{
_crate addItemCargo [_x, 1];
} forEach _items;
Not fixed!
Zeus placed AGM Misc box:
Well that's weird, I did exactly the same test, not on dedicated though, but in multiplayer and I couldn't do that.
: )
I'll do more testing. Atleast I can implement my script.
It only happens if you press OK when the custom crate filling menu is open.
So many curator eventhandlers, but none of these trigger after editing the cargo... Anyone know what control that is?
Needs testing. Might lag now whenever you try to open a crate with thousands of weapons.
hmm.. interesting just tried this (@agm_dev build from 17. 10) and the agm ammoboxes indeed have this issue. But what is strange, that I also spawned my custom agm ammobox (https://github.com/evromalarkey/ASCZ-Mods/blob/master/Source/ascz_arsenal_box/config.cpp) via zeus and there was no problem. Maybe it has to do something with Box_NATO_Support_F which is AGM_Box_Misc inheriting?
It only happens if you press OK when the custom crate filling menu is open.
When I close the meny by pressing Cancel or ESC, it's working fine.
nah, just found out myself. Never mind, it's because my agm ammobox is not recognized by zeus as an ammobox so there is no filling menu dialog.. :D
not recognized by zeus as an ammobox so there is no filling menu dialog
Maybe that would be a better solution than my script? How does Zeus decide if it's an ammo box?
I think zeus recognize all inherited bis ammobox classes (eg. Land_PaperBox_open_full_F is not under ammoboxes). So if you use config stuff from the Box_NATO_Support_F and you will not inherit it, it should work.
I think zeus recognize all inherited bis ammobox classes (eg. Land_PaperBox_open_full_F is not under ammoboxes). So if you use config stuff from the Box_NATO_Support_F and you will not inherit it, it should work.
Interesting.
Well, it's still possible to add the AGM items (or the MineDetector ....) with zeus to ammo boxes, so the script is necessary.
yeah that's true, btw think I know what have bis wrong. Mine detector and agm items have type = 4; and BI has condition (ui_f_curator\UI\RscCommon\RscAttributeInventory.sqf, row 374) that items from 4096 to 131072 are items, and since 4 is not in the range, it's added as weapon :D
Can we override that sqf and add the correction?
On Sun, Oct 19, 2014 at 6:29 PM, evromalarkey notifications@github.com wrote:
yeah that's true, btw think I know what have bis wrong. Mine detector and agm items have type = 4; and BI has condition (ui_f_curator\UI\RscCommon\RscAttributeInventory.sqf, row 374) that items from 4096 to 131072 are items, and since 4 is not in the range, it's added as weapon :D
— Reply to this email directly or view it on GitHub https://github.com/KoffeinFlummi/AGM/issues/1223#issuecomment-59666422.
Don't think so, compileFinal
Where is that function called though?
Correction would be: if (type = 4 && simulation = "MineDetector") then { item }
in ui_f_curator.pbo config there is reference to BIS_fnc_initCuratorAttribute which it handles, if I understand it correctly.
with uinamespace do {
private ["_params","_class","_path","_fncName","_control"];
_params = _this select 0;
_class = _this select 1;
_path = _this select 2;
_fncName = _class;
if (isnil _fncName || cheatsEnabled) then {
private ["_scriptPath","_fncFile"];
_scriptPath = gettext (configfile >> "cfgScriptPaths" >> _path);
_fncFile = preprocessfilelinenumbers format [_scriptPath + "%1.sqf",_class];
_fncFile = format ["scriptname '%1_%2'; _fnc_scriptName = '%1';",_class] + _fncFile;
uinamespace setvariable [_fncName,compileFinal _fncFile];
};
_control = _params select 0;
_control ctrlremovealleventhandlers "setFocus";
_display = ctrlparent _control;
_display displayaddeventhandler ["unload",format ["with uinamespace do {['onUnload',_this,missionnamespace getvariable ['BIS_fnc_initCuratorAttributes_target',objnull]] call %1};",_fncName]];
_ctrlButtonOK = _display displayctrl 1;
_ctrlButtonOK ctrladdeventhandler [
"buttonclick",
format ["with uinamespace do {['confirmed',[ctrlparent (_this select 0)],missionnamespace getvariable ['BIS_fnc_initCuratorAttributes_target',objnull]] call %1}; false",_fncName]
];
_target = missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target",objnull];
["onLoad",[ctrlparent (_params select 0)],_target] call (uinamespace getvariable _fncName);
};
Thats BIS_fnc_initCuratorAttribute. I don't see a line with items though.
in config (row 3520) it's calling BIS_fnc_initCuratorAttribute which is then calling RscAttributeInventory.sqf
format [_scriptPath + "%1.sqf",_class];
Here it is composing RscAttributeInventory.sqf
class RscAttributeInventory: RscControlsGroupNoScrollbars {
onSetFocus = "[_this,""RscAttributeInventory"",'CuratorCommon'] call (uinamespace getvariable ""BIS_fnc_initCuratorAttribute"")";
idc = 25168;
};
Great!
I hacked something in without messing with bis' stuff too much. Needs testing.
Looks good. Seems to work in Preview and self hosted MP.
Why are mine detectors rocket launchers anyway... Who though that was a good idea!?
I found a better solution. Needs testing again. The good thing now is, that the damn mine detector stays bugged.
AGM Items aren't bugged anymore. They even work "splendid" (hehe) in Virtual Arsenal. -> Fixed
Arma3: 1.30 Mods: CBA_A3, agm_dev agm_dev from: 2014-10-02 Tested on: Editor Zeus enabled: Yes Modules: No modules