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

Remove parachute landing animation #5794

Merged
merged 6 commits into from
Dec 2, 2017
Merged

Remove parachute landing animation #5794

merged 6 commits into from
Dec 2, 2017

Conversation

kymckay
Copy link
Member

@kymckay kymckay commented Nov 20, 2017

The vanilla animation has since been reworked and is an improvement.

I believe the PFH used to track when the player lands could also be removed by adjusting how the variables that track chute cutting and reserve chute are used. Beyond the scope of this PR though.

Closes #5596

The vanilla animation has since been reworked and is an improvement.
@kymckay kymckay requested a review from commy2 November 20, 2017 14:44
@kymckay kymckay added kind/enhancement Release Notes: **IMPROVED:** kind/optimization Release Notes: **IMPROVED:** labels Nov 20, 2017
@kymckay kymckay added this to the 3.12.0 milestone Nov 20, 2017
@@ -33,7 +33,7 @@ GVAR(PFH) = false;
["vehicle",{
if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then {
GVAR(PFH) = true;
[FUNC(onEachFrame), 0.1, []] call CALLSTACK(CBA_fnc_addPerFrameHandler);
[FUNC(onEachFrame), 0.1, []] call CBA_fnc_addPerFrameHandler;
};
}] call CBA_fnc_addPlayerEventHandler;
Copy link
Contributor

@commy2 commy2 Nov 20, 2017

Choose a reason for hiding this comment

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

The whole thing can be deleted.

Copy link
Member Author

Choose a reason for hiding this comment

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

It needs to run to determine when the player lands to reset the chute cut variable. Which is what I mention in the OP about if we change the way those variables are handled we can totally remove the PFH.

Copy link
Member Author

Choose a reason for hiding this comment

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

(At least, I'm assuming that variable being reset is necessary. It's quite hard to determine what the original intent is with some of the code)

@commy2
Copy link
Contributor

commy2 commented Nov 20, 2017

@kymckay
Copy link
Member Author

kymckay commented Nov 22, 2017

Yeah I also saw that and actually think it might be slightly broken since it's running via a CBA XEH on CAManBase and not just on the player respawn

@commy2
Copy link
Contributor

commy2 commented Nov 23, 2017

I still don't get what we need chuteIsCut for.

@kymckay
Copy link
Member Author

kymckay commented Nov 23, 2017

I think it's so that a reserve chute is not added if the players uses a reserve chute which is configured to have a reserve, but not entirely sure myself

@ulteq
Copy link
Contributor

ulteq commented Nov 23, 2017

I still don't get what we need chuteIsCut for.

condition = QUOTE([_player] call FUNC(checkCutParachute));

@SilentSpike I think you can't just remove fnc_checkCutParachute.sqf.

@kymckay
Copy link
Member Author

kymckay commented Nov 27, 2017

Aha so that's where it's used! I did a ctrl+shift+f for the function but it didn't turn up that instance. Thanks 😄

@kymckay
Copy link
Member Author

kymckay commented Nov 28, 2017

Think this should now work as intended now without the arbitrary code complexity, but haven't had a chance to test yet

@kymckay
Copy link
Member Author

kymckay commented Dec 1, 2017

Got around to testing this, seems the cut parachute action is broken because I overlooked that the hasReserve variable is reset to false once the reserve is added. Fixing now.

@kymckay
Copy link
Member Author

kymckay commented Dec 1, 2017

Fixed and tested, this should be good to go 👍

@kymckay
Copy link
Member Author

kymckay commented Dec 1, 2017

Actually 🤔 I think if player was to pull chute and never cut it, then the canCut variable would still be true on landing. If they were to then jump out of another plane with their reserve still on then they would then be able to cut that too and fall to their death.

The simple way to avoid all this nonsense would be to let players cut any parachute, but then we'd have to provide some indication that they have a reserve because there's no way to check while in the air.

- Prevent potential for action to be present when reserve is not
available
- Move cut parachute action to the parachute self actions rather than
the player's
@kymckay
Copy link
Member Author

kymckay commented Dec 1, 2017

Okay fixed all the issues now and massively reduced the complexity of the implementation 👍

Will let @commy2 handle the vanilla UI stuff. Only thing I did notice in testing is that when you cut your chute you don't seem to return to the falling animation, but that isn't a result of this PR and must be a longstanding bug (which I won't address because I hate messing with animations).

@commy2
Copy link
Contributor

commy2 commented Dec 1, 2017

UI stuff is fixed here: ref #5836


_TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call EFUNC(common,numberToDigitsString),[_minute, 2] call EFUNC(common,numberToDigitsString)]);
Copy link
Contributor

Choose a reason for hiding this comment

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

We want the old way, it pads zeros to the left
[5, 2] call ace_common_fnc_numberToDigitsString = "05"
5 toFixed 2 ="5.00"

@PabstMirror PabstMirror merged commit ec09c2b into master Dec 2, 2017
@PabstMirror PabstMirror deleted the parachute-anim-rm branch December 2, 2017 17:02
BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
* Remove parachute landing animation

The vanilla animation has since been reworked and is an improvement.

* Optimise altimeter code

* Fix reserve chute handling and cutting action

* Fix cut parachute action

* Fix cut parachute action further

- Prevent potential for action to be present when reserve is not
available
- Move cut parachute action to the parachute self actions rather than
the player's

* Revert number to string conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:** kind/optimization Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants