acemod / ACE3

Open-source realism mod for Arma 3
https://ace3.acemod.org
Other
1k stars 736 forks source link

Arsenal - Make ACE_asItem and ACE_isUnique apply to CfgWeapons #10366

Open DartRuffian opened 3 weeks ago

DartRuffian commented 3 weeks ago

When merged this pull request will:

IMPORTANT

DartRuffian commented 3 weeks ago

Seems like some part of this breaks painkillers, as they no longer appear in the arsenal in either the medical tab or misc items tab. I'll take another look in the morning

DartRuffian commented 2 weeks ago

Realized I should denote it here, but Grim might have had a different idea, and that I should remind him when 3.18.1 is being looked at

DartRuffian commented 2 weeks ago

Validate reports missing ; on Line 163, but it runs fine

161 {
162     _magazineMiscItems set [configName _x, nil];
163 } forEach (toString {_x call FUNC(isMiscItem)} configClasses _cfgMagazines);
LinkIsGrim commented 2 weeks ago

It's because of the code block. It's fine and the ; will actually make it not work

PabstMirror commented 2 weeks ago

it's Run python3 tools/sqf_validator.py not hemtt

LinkIsGrim commented 2 weeks ago

Reading is hard

DartRuffian commented 2 weeks ago

Just FYI, this means magazines will be slower.

Thought about this, maybe optional param for config for the item? I.e.

["someMag", configFile >> "CfgMagazines"] call ace_arsenal_fnc_isMiscItem;

Saves the call to getItemConfig. It also would get around potentially getting the wrong config path back if there's same class names in different root classes

LinkIsGrim commented 2 weeks ago

Just FYI, this means magazines will be slower.

Thought about this, maybe optional param for config for the item? I.e.

["someMag", configFile >> "CfgMagazines"] call ace_arsenal_fnc_isMiscItem;

Saves the call to getItemConfig. It also would get around potentially getting the wrong config path back if there's same class names in different root classes

Optimize for string and cache it, we make enough lookups for it to be worth it anyway. I have that ready as soon as I can fix magazine misc items

DartRuffian commented 2 weeks ago

I might mess with it later tonight, no guarantee though

LinkIsGrim commented 2 weeks ago

https://github.com/acemod/ACE3/tree/pr/10366/cache moved everything to do with misc items to that function Things to test:

Besides intel items, all need to be tested in an arsenal where they should be available (VR mission is fine) and one where they shouldn't

DartRuffian commented 2 weeks ago

I'll test tonight. I'll test the same things you had listed previously as well as an item that originally inherited from ItemCore and then had its type/simulation changed

DartRuffian commented 2 weeks ago
DartRuffian commented 2 weeks ago

Test Mission with two arsenals. One full and one limited (there are placed comments with details) Misc%20Item%20Test.VR.zip

LinkIsGrim commented 2 weeks ago

Not familiar with the intel items, but acex_intelitems_notepad does appear in Tools

Open Zeus, go to props/empty side units, search for intel > place a document/photo

LinkIsGrim commented 2 weeks ago

More tests:

These could be in a test script if we cared enough (at least we can check if they're sorted into the right buckets, interface would still need manual checking) I guess @johnb432 ?

DartRuffian commented 2 weeks ago

Open Zeus, go to props/empty side units, search for intel > place a document/photo

Done, I have a acex_intelitems_document in my inventory and it says I have 0 in the arsenal. I assume that's the intended outcome for intel items? 107410_20241016091856_1

DartRuffian commented 2 weeks ago

Never even knew ACE handled these, TIL. Only issue I found was that the Chemical Detectors are showing under Bipods.

LinkIsGrim commented 2 weeks ago

Never even knew ACE handled these, TIL. Only issue I found was that the Chemical Detectors are showing under Bipods.

They fall into the category of items this PR was made for, which is non-CBA, non-special, CfgWeapons misc items. Adding ACE_asItem to them should sort them correctly.

DartRuffian commented 2 weeks ago

I'll add it to those classes then. Should they be modified in arsenal itself or another addon?

I assume arsenal, but figured I'd check beforehand.

DartRuffian commented 2 weeks ago

@LinkIsGrim

LinkIsGrim commented 2 weeks ago

Arsenal

LinkIsGrim commented 1 week ago

inb4 "the chemical detector you guys added doesn't do anything"