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

Improving E&E Check #751

Open
osarup opened this issue Jul 5, 2016 · 3 comments
Open

Improving E&E Check #751

osarup opened this issue Jul 5, 2016 · 3 comments

Comments

@osarup
Copy link
Contributor

osarup commented Jul 5, 2016

While working on a rescue mission I required certain functionality facilitated by the E&E check. I went ahead and used my own script anyway since I needed a specifically shaped area, but I realised that the E&E component of F3 could be improved a bit more.

Primarily centered around the use of the recently introduced (v1.58) inArea function, it would allow finer control of the target area (in terms of shape) while cutting down on some of the code implemented in F3.

The following lines can be removed, for example:

// GET SAFE-ZONE POSITION
// Get a position for the safe-zone

switch (typeName _obj) do {
    case "STRING": {_pos = getMarkerPos _obj};
    case "OBJECT": {_pos = getPosATL _obj};
    default {_pos = getPosATL _obj};
};

...as inArea automatically handles this.

Additionally, I was trying to see whether the following method could be used:

if (_playersonly) then {
    _units = playableUnits select {side _x == _object};
};

and it looks possible. The entire switch statement can be eliminated.

I'm aware that 3-4-0 is already in RC, so marking this for future release but will start working on it soon enough. May not be able to do it before 11th July anyway.

@osarup
Copy link
Contributor Author

osarup commented Jul 24, 2016

What argument layout would we like to use for the revised E&E Check?

Current Layout:
[_objects, _obj, _safeDistance, _end, _playersonly]

_objects = array of units, groups which are to be checked for
_obj = object or marker forming the centre of the area
_safeDistance = radius of the area
_end = F3 ending or custom code
_playersonly = only check players (optional, default true)

Proposed layout:
[_objects, _obj, _safeDistance_hori, _end, _playersonly,_safeDistance_vert, _angle, _isRectangle]

_objects = array of units, groups which are to be checked for
_obj = object or marker forming the centre of the area
_safeDistance_hori = horizontal side or radius of area
_end = F3 ending or custom code
_playersonly = only check players (optional, default true)
_safeDistance_vert = vertical side or distance of area (optional, defult equals horizontal)
_angle = angle of area (optional, 0 by default)
_isRectangle = toggles between elipse and rectangle (optional, elipse by default)

Advantage of this layout is that it's backwards compatible out of the box. Of course, from a programmer's POV it's probably not very nice to have the new shape related arguments so far away from _safeDistance_hori.

@osarup
Copy link
Contributor Author

osarup commented Jul 24, 2016

There's also the additional consideration of whether we want to use playableUnits or allPlayers. As playable units includes AI too, which may end up stuck somewhere.

@osarup
Copy link
Contributor Author

osarup commented Jul 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants