Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtered getUnitLoadout #1236

Closed
BrettMayson opened this issue Oct 2, 2019 · 3 comments
Closed

Filtered getUnitLoadout #1236

BrettMayson opened this issue Oct 2, 2019 · 3 comments
Labels
Milestone

Comments

@BrettMayson
Copy link
Contributor

BrettMayson commented Oct 2, 2019

Is your feature request related to a problem?
Some mods (TFAR, ACRE, Unique Maps) use an ID system to track individual items. This will cause issues with getUnitLoadout and setUnitLoadout.

Solution you'd like:
CBA_fnc_getUnitLoadout that is a drop in replacement for its vanilla counterpart. Also create CBA_fnc_addUnitLoadoutFilter and CBA_fnc_removeUnitLoadoutFilter that take code as a parameter, that code takes a getUnitLoadout array and must return a getUnitLoadout array. The code will be used to replace any ID items with their base version.

Additional context:
ACRE Example

@commy2
Copy link
Contributor

commy2 commented Oct 2, 2019

Idea:
CBA_fnc_generalizeLoadout

  • walks through all items and removes ids
CBA_fnc_setUnitLoadout = {
    params ["_unit", "_loadout"];
    _loadout = _loadout call CBA_fnc_generalizeLoadout;
    _unit setLoadout _loadout;
};
CBA_fnc_getUnitLoadout = {
    params ["_unit"];
    getUnitLoadout _unit call CBA_fnc_generalizeLoadout
};

Question is how it is supposed to know what is a derived item. Would need some config entry pointing to the correct class.
Also, this reminds one of baseWeapon. Should it replace weapons with baseWeapon? Can we recycle baseWeapon for this?

@BrettMayson
Copy link
Contributor Author

I like the addition of generalizeLoadout so it can be used without directly affecting a unit, I hadn't considered that.

I do still think it should be using code from mods however, and not doing it automatically.

@dedmen
Copy link
Contributor

dedmen commented Oct 3, 2019

Question is how it is supposed to know what is a derived item.

We have ACE Arsenal config entries for that. Might be worth adding a filter for that within ACE?

@commy2 commy2 mentioned this issue Jan 19, 2020
6 tasks
@commy2 commy2 added this to the Ongoing milestone Jan 19, 2020
@commy2 commy2 closed this as completed Jan 19, 2020
@commy2 commy2 modified the milestones: Ongoing, Backlog Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants