Open lawkaita opened 2 years ago
This is because of that
https://github.com/acemod/ACE3/blob/master/addons/medical_engine/CfgWeapons.hpp
and here type = 0;
https://github.com/acemod/ACE3/blob/master/addons/medical_treatment/CfgWeapons.hpp
Comment say that this is to hide them from arsenal. In BI arsenal scope = 1;
can be used for that, but not in ACE one.
Also to be honest, I don't understand why in vanilla medkit returned as weapon item. This is not a scope, bipod, laser or loaded mag. Maybe CBA function should be fixed somehow?
Couldn't scopeArsenal = 0
be used to hide them instead? Also, it's not like the items are hidden in the ACE Arsenal. There's not much reason to hide them in the BIS Arsenal.
For some reason getWeaponCargo
will still list the medikits and first aid kits, so anyone trying to use CBA_fnc_removeWeaponCargo can use that as a temporary workaround.
type = 0
solution can also break mission config. In editor double-click any vehicle with FAK/Medikit in inventory (e.g. Quadbike
), then press OK
and then save mission. The object gets mission config like this:
class CustomAttributes {
class Attribute0 {
property="ammoBox";
expression="[_this,_value] call bis_fnc_initAmmoBox;";
class Value {
class data {
singleType="STRING";
value="[[[[""FirstAidKit""],[4]],[[],[]],[[],[]],[[],[]]],false]";
};
};
};
};
The value
attribute has 4 array elements here: [ [["FirstAidKit"],[4]], [[],[]], [[],[]], [[],[]] ]
- weapons, magazines, items and backpacks. And FAK is weapon here.
If load such mission with ACE medical and take such FAK from vehicle it won't be converted to ACE medicals.
If load mission without ACE Medical:
load cursorObject == 0
while Quadbike has 4 "FAKs" in inventory;getUnitLoadout player
will return FAK as weapon: [[],[],[],["U_B_CombatUniform_mcam",[["FirstAidKit",1],[["FirstAidKit","","","",[],[],""],1]]],[],[],"","",[],["","","","","",""]]
(["FirstAidKit",1]
is normal FAK, the other one is weapon);Source:
\a3\3den\UI\Attributes\AmmoBox.sqf
in attributeSave
case checks weapon type: getnumber (configfile >> "cfgweapons" >> _class >> "type") in [4096,131072]
. If it's true it becomes an item and goes to value array #2
else to value array #0
.
On mission start bis_fnc_initAmmoBox
does clearweaponcargoglobal _entity; clearitemcargoglobal _entity;
first. Then it does addweaponcargoglobal
of items in value array #0
and additemcargoglobal
of items in value array #2
. addWeaponCargoGlobal
silently ignores item type and adds it as weapon.
[cursorObject, ["FirstAidKit", "Medikit", "MineDetector", "ToolKit"], false, true] call BIS_fnc_addVirtualItemCargo;
Function does return all objects, but "FirstAidKit" and "Medikit" are missing in cargo.
Mods (complete and add to the following information):
2.06 stable
3.15.6 stable
3.14.1 stable
Description:
weaponsItemsCargo
does not return medikits or first aid kits if ace is loadedSteps to reproduce:
Start mission editor, place down a unit, start the game, then in the debug console execute
The last command will return
[]
.Expected behavior: With no mods loaded or only CBA loaded, the last command willl return
Where did the issue occur? Editor (Singleplayer)
Additional context: This bug causes CBA_fnc_removeWeaponCargo to delete medikits and first aid kits, since it gets the cargo data with
weaponsItemsCargo _container
and then doesclearWeaponCargoGlobal _container
.