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

End path drawing when passing through Geom/Fire #4385

Merged
merged 2 commits into from
Sep 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions addons/advanced_throwing/functions/fnc_drawArc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ for "_i" from 0.05 to 1.45 step 0.1 do {

if (_newTrajASL distance (getPosASLVisual ACE_player) <= 20) then {
if ((ASLToATL _newTrajASL) select 2 <= 0) then {
_cross = 1
_cross = 1; // 1: Distance Limit (Green)
} else {
// Even vanilla throwables go through glass, only "GEOM" LOD will stop it but that will also stop it when there is glass in a window
if (lineIntersects [_prevTrajASL, _newTrajASL]) then {
_cross = 2;
if (lineIntersects [_prevTrajASL, _newTrajASL]) then { // Checks the "VIEW" LOD
_cross = 2; // 2: View LOD Block (Red)
} else {
if (!((lineIntersectsSurfaces [_prevTrajASL, _newTrajASL, _activeThrowable, ACE_player, true, 1, "GEOM", "FIRE"]) isEqualTo [])) then {
_cross = 3; // 3: GEOM/FIRE LOD Block (Yellow) - pass a3 bulding glass, but blocked on some CUP glass
};
};
};

Expand All @@ -60,7 +64,7 @@ for "_i" from 0.05 to 1.45 step 0.1 do {
private _movePerc = linearConversion [3, 0, vectorMagnitude (velocity ACE_player), 0, 1, true];
_alpha = _alpha * _movePerc;

private _col = [ [1, 1, 1, _alpha], [0, 1, 0, _alpha], [1, 0, 0, _alpha] ] select _cross;
private _col = [ [1, 1, 1, _alpha], [0, 1, 0, _alpha], [1, 0, 0, _alpha], [1, 1, 0, _alpha] ] select _cross;

if (_cross != 2 && {lineIntersects [eyePos ACE_player, _newTrajASL]}) then {
_col set [3, 0.1]
Expand Down
17 changes: 15 additions & 2 deletions docs/wiki/feature/advanced-throwing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,24 @@ After cooking a grenade any mode can be used to throw it further or it can simpl

Grenade will be thrown where you are currently looking at, free-look (including TrackIR) is fully supported. However, the further to the side and back you are looking, the lower the throw power will be.

### 1.2 Rethrowing
### 1.2 Indicators

When enabled, an arc of colored filled circles will indicate the path grenade will fly through.

Color | Meaning
----- | --------
White | Flight path
Green | Collision with ground surface
Red | Collision with object
Yellow | Possible collision

Possible collisions are collisions that might happen, but there is also a chance that the grenade will not collide with that object. It is impossible to predict in many cases due to different object configurations.

### 1.3 Rethrowing

Advanced Throwing allows you to pick up grenades that have already been thrown. You have to be very close to it to effectively pick it up. Useful for rethrowing smoke grenades or repositioning chemlights. Frag grenades can also be thrown back, for example out of the house, however doing so is extremely risky.

### 1.3 Settings
### 1.4 Settings

Various settings can be set according to your likeness. Next to global toggle to disable Advanced Throwing there are settings to hide the throw arc indicating approximate throw distance and the arc it will fly through and hide mouse controls. Additionally for server administrators and mission makers, picking up grenades can be entirely disabled, as well as a setting to enable picking up attached items such as chemlights attached to vehicles or other player's shoulder.

Expand Down