KillahPotatoes / KP-Liberation

The work on GreuhZbugs Liberation Mission for Arma 3 continues...
MIT License
264 stars 298 forks source link

[Rewrite] Q: Build action menu conditions #856

Closed mwpowellhtx closed 3 years ago

mwpowellhtx commented 3 years ago

Hello,

Vis-a-vis the refactor, what is the point of the condition, if you please? What is the gist there?

Are we asking whether player, or _target from the perspective of the action menu condition, is 1) away from start base and 2) near a FOB?

In particular, I am not certain what the point of setting a KPLIB_fob variable on the player accomplishes.

Additionally, what is _originalTarget? A thing that player is looking at? Or in this case, that the player is not looking at anything?

And having permissions, etc, etc, so on and so forth.

Possibly extending into decisions dealing with the set of FOBs, location parameters, etc, vis-a-vis saved game state, but I'll start here to keep it simple.

Thank you...

if (hasInterface) then {

    // Build actions
    private _buildCondition = '
        (_target == _originalTarget)
        && !(_originalTarget getVariable ["KPLIB_fob", ""] in ["", "KPLIB_eden_startbase_marker"])
        && (["Build"] call KPLIB_fnc_permission_checkPermission)
    ';
    private _buildAction = {
        private _pos = getMarkerPos (player getVariable "KPLIB_fob");
        [_pos, KPLIB_param_fobRange] call KPLIB_fnc_build_start;
    };

    private _actionArray = [localize "STR_KPLIB_ACTION_BUILD", _buildAction, nil, -802, false, true, "", _buildCondition, 10];
    [_actionArray] call CBA_fnc_addPlayerAction;
};
veteran29 commented 3 years ago

Sorry but this is not a forum, we've stopped doing the rewrite due to lack of time, and due to same lack of time we have no time to provide support like this on every simple coding thing.

If you've taken the challenge to continue the Rewrite you should be able to work on this by yourself, if you're not you should educate yourself more.

Thanks for understanding.