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

Add Advanced Throwing #3477

Merged
merged 61 commits into from
Aug 22, 2016
Merged

Add Advanced Throwing #3477

merged 61 commits into from
Aug 22, 2016

Conversation

jonpas
Copy link
Member

@jonpas jonpas commented Feb 29, 2016

When merged this pull request will:

  • Integrate (90% rewritten) grenade throwing system by @dslyecxi
  • Close Tweak grenade modes to make them more useful #1628
  • Add settings to draw throw arc, show mouse hints, enable pick up, enabe attached pick up
  • Improve and optimize rendering and handling of throwables
  • Add support for scripted throwables (eg. flashbang, handheld flares)
  • Improve 3rd person support
  • Use CBA DisplayLoad and keybinds
  • Add toggle lean support
  • Add pick up ability (including attached)
  • Add feature documentation

Todo:

  • Fix init failing on first game load (after loading from Eden)
  • Convert KeyDown EH to XEH DisplayLoad (once fixed in CBA) and DisplayLoad XEH to CBA_fnc_addDisplayHandler postInit
  • Throw fired event
  • Cleanup waitUntilAndExecutes and waitAndExecutes where possible (FUNC(throw) needs serious work on that)
  • Add button icons (like when carrying) showing controls - when Disable only action menu on mouse hint and modifier where unnecessary #3551 merged
  • Add "double right click to drop when cooked" to mouse hint
  • player -> ACE_player/passed _unit
  • Use grenade throw key (requires intercepting that key so it doesn't do its default action) - Use custom CBA key instead of "Cycle Throw Items" instead.
  • Cancel throw when !canInteract (e.g. unconsciousness)
  • Cancel throw when player switch
  • If you pull out a throwable and throw it when your magazine is partially full, and in doing so, exhaust all of your throwables, the next time you press the 'cycle throwables' key (with no throwables available to throw) it will reset your ammo count to whatever it was during your last valid throw
  • Adjust position when locked in lean mode and side stances
  • Allow throwing with weapon down from FFV
  • Add better notification when unable to throw from inside vehicle
  • Disable leaning addition in vehicle
  • Fix scroll wheel up not working every second restart
  • 3rd person support
  • Improve 3rd person support
  • DefaultAction doesn't get executed when in FFV with lowered weapon, so throw requires 2 LMB presses to actually throw design decision to leave it like that, simpler for end-user to understand and not make mistakes because of it (can't change direction of player in FFV slot, raising weapon changes look direction to where weapon is pointing)
  • KeyUp isn't guaranteed to fire (for some reason) - for example holding it down for short amount of time - apparently vanilla issue fixed by changing it to "toggle drop mode" instead of holding a button
  • DefaultAction doesn't fire when driver vehicle == unit - fixed by changing to mouseButtonDown event and leaving DefaultAction for "fire" suppression only
  • Flashbang and handheld flares support
  • Fix "exploded in hand" not exiting throw mode
  • Make weaponselect change throwable keys compatible with from inside vehicle throwing.
  • Arc and mouse hint client settings
  • Editor module
  • Rename to "advancedthrowing"
  • Fix throw orientation being different than holding orientation
  • Moving (flying) rendering
  • Picking up primed throwables
  • Replace animation with gesture to properly fix the moving mistakes (current fix makes grenade be thrown from behind you if you walk or run) no suitable gesture, current fix will have to do
  • Change GVARs to setVariables
  • Convert to CBA events (required Deprecate ACE events framework #3815)
  • Module icon
  • Fix Advanced Throwing Issue #3939
  • Use use a function to do gestures #4096 for throw gesture
  • Beautified component name
  • Fix walking sideways jiggle when weapon on back or lowered
  • Disable debug
  • Limit throwing power over shoulder
  • Cool-down between throws (mimic vanilla behaviour, also to prevent issues)
  • Disallow selecting throwable if reloading
  • Change pick-up settings to not be client settable
  • Use CBA player events
  • Improve pick-up action performance in multiplayer (test 0f6d54e)
  • Add proper player detach support
  • Fix arc accuracy

Future:
-> #4218

Experimentation:

  • Rolling throwables Arma 3 physics allow you to throw into the floor and it will be almost the exact same effect as ACE2 grenade rolling, not much point implementing
  • Custom pin sound instead of regular throw sound -> ace_grenades separate component if ever

To decide:

  • Remove grenade modes from ace_grenades? Leave for anyone who wants to use it
  • Make Advanced Throwing mandatory or keep it optional (default enabled)? (connects with above, if we keep it it might be nice to keep old modes as well? if removed rename to ace_throwing?) Leaving optional
  • Add support for picking up primed throwables to vanilla throwing? (if yes, move to ace_grenades?) No, due to no nice way of holding them, apart from delay from pick up to throw

@jonpas jonpas added the kind/feature Release Notes: **ADDED:** label Feb 29, 2016
@jonpas jonpas added this to the 3.6.0 milestone Feb 29, 2016
if (_enable) then {
GVAR(KeyDownHandle) = (findDisplay 46) displayAddEventHandler ["KeyDown", {_this call FUNC(onKeyDown)}];
GVAR(MouseButtonDownHandle) = (findDisplay 46) displayAddEventHandler ["MouseButtonDown", {_this call FUNC(onMouseButtonDown)}];
GVAR(MouseScrollHandle) = (findDisplay 46) displayAddEventHandler ["MouseZChanged", {_this call FUNC(onMouseScroll)}];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move these to a DisplayLoad event instead. Fixes your point 1.

class Extended_DisplayLoad_EventHandlers {
    class RscDisplayMission {
        ADDON = QUOTE(_this call COMPILE_FILE(XEH_missionDisplayLoad));
    };
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that findDisplay 46 cannot be used at that point though. use:
params ["_display"]
instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will wait on fixing that when key events are fixed when used with this on CBA's side.

@nicolasbadano
Copy link
Contributor

Also mass replace all player by ACE_player

GVAR(ActiveGrenadeType) = "";

GVAR(CameraOffset) = [0, 0, 0.3];
GVAR(zAdjust) = -0.03;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this three a vector: GVAR(adjust) = [-0.03, -0.05, -0.12];

@jonpas jonpas self-assigned this Feb 29, 2016
@bux bux added the status/WIP label Mar 1, 2016
@jonpas jonpas changed the title Add initial integration of grenade throwing system Integrate advanced grenade throwing system Mar 1, 2016
if (vehicle _unit == _unit) exitWith {true};

private _return = false;
private _assignedRole = assignedVehicleRole _unit;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done locally, just need to push.

@jonpas
Copy link
Member Author

jonpas commented Mar 1, 2016

Does no funky stuff to weapon ammo anymore as it uses the action directly.

Changed controls slightly, mouse wheel up and down is change mod now, 2 right clicks is drop when cooked.

Dependent on ace_weaponselect due to using selectNextGrenade - needed because of switch to CBA key instead of vanilla "Cycle Throwables".

3rd person also enabled, but grenade is currently in front of the camera.

Some general cleanup as well, it's a start.

@jonpas
Copy link
Member Author

jonpas commented Mar 5, 2016

3rd person support added, leaning calculated from head position to make it work when lean is toggled and also adjust for side stances.

Someone with more math knowledge than me should probably go through the calculations to make them more robust.

@jonpas jonpas removed the status/WIP label Aug 8, 2016
… obstruct view, Fix high throw arc being way off, Fix script error on intersect with object
@jonpas jonpas removed the status/WIP label Aug 19, 2016
@bux
Copy link
Member

bux commented Aug 19, 2016

When in drop mode, you're able to "extend" the grenade distance through a closed window (through the glass).

@jonpas
Copy link
Member Author

jonpas commented Aug 19, 2016

Yes, that is a limitation of the engine. There is no proper way to detect glass. You can see with vanilla grenades, you can throw them through those glass windows perfectly fine.


// Inventory check
if (_throwable isEqualTo [] && {!_primed}) exitWith {
[ACE_player, "No valid throwables"] call FUNC(exitThrowMode);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"No valid throwables" -> Stringtable? (or is this just log?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just for debugging, won't ever be shown to user.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, just log.

@jonpas jonpas merged commit f8dfa4f into master Aug 22, 2016
@jonpas jonpas deleted the grenadeThrowing branch August 22, 2016 13:09
@commy2
Copy link
Contributor

commy2 commented Aug 22, 2016

🎉

@BlackburnUTG
Copy link

BlackburnUTG commented Sep 14, 2016

What do I do, if I want to set button to cancel Advanced Throwing? Where can I do it?

@jonpas
Copy link
Member Author

jonpas commented Sep 15, 2016

@BlackburnUTG you can't rebind the cancel button. And please don't revive merged pull requests, join our Slack for questions.

@acemod acemod locked and limited conversation to collaborators Sep 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Release Notes: **ADDED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Advanced Throwing Issue Tweak grenade modes to make them more useful