-
Notifications
You must be signed in to change notification settings - Fork 740
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
Add Repair and Rearm interactions to Zeus #6632
Conversation
statement = QUOTE( \ | ||
private _unit = objNull; \ | ||
{ \ | ||
if ( \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like it should be findIf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't imagine how. Could you explain please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
if (
side _x in [east,west,resistance,civilian]
&& !(isPlayer _x)
) exitWith { _unit = _x; };
} forEach (curatorSelected select 0);
All this does is find the first unit where the condition returns true. Which is also what findIf does, returns the index of the first element where condition returns true..
private _unit = (curatorSelected select 0) param [
(curatorSelected select 0) findIf { side _x in [east,west,resistance,civilian] && !(isPlayer _x) }
, objNull];
Does the same thing. But get's rid of calling if
and exitWith
on every iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know param
can handle -1
as index. Without it this code wouldn't be so elegant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
param/params are literally the best commands ever.
Works great |
I want it to work with many vehicles at the same time, module can handle one vehicle only (as I know). |
Also, I generally dislike big code in configs because it's hard to read and maintain ( |
@Dystopian Please do not add any rearm or repair actions to the interact menu. To my knowledge they cannot be easily removed by the scenario designer from that menu. I want to limit the curator actions to enable more versus oriented approach to curator actions. Adding them there limits the different ways zeus can be used. @PabstMirror They would be much better if they were modules because that way I as a scenario designer can limit them. I am able to choose what modules get added to which curator and their costs etc. I hope you please consider this point now and also in the future. |
@Bummeri really, I didn't think about it. What do you think about setting limiting those menus which mission designer can restrict in scenario? |
@Dystopian If I understand you correctly then that would be a better way to go, since I could disable them from such scenarios. |
I'll make a PR. |
If it is not done in another way then please revert this. |
This PR is not in release, I will make PR till release, just busy IRL. |
* Add Repair and Rearm interaction to zeus * Optimize remoteControl statement
When merged this pull request will:
Stance
andRemote Control
menus;Remote Control
statement multi-line;ace_rearm_fnc_rearmEntireVehicleSuccess
params (remove nested array).