-
Notifications
You must be signed in to change notification settings - Fork 4
lara_cheat: fix weapon issues #239
lara_cheat: fix weapon issues #239
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lara no longer retains the rifle type weapon in her hand when fly cheat lasts for a brief duration.
I've tested all the scenarios I could think of in HSH - whether Lara is armed/unarmed before the ending animation is triggered. I checked what happens when fly or teleport cheats are used, and what happens when Lara teleports to dry/water rooms. I also checked the start of HSH and the special animation in Offshore Rig too, just in case.
All LGTM, and thank you.
What if we just remove this? diff --git a/src/game/creature.c b/src/game/creature.c
index fb1b273b..26d48eaa 100644
--- a/src/game/creature.c
+++ b/src/game/creature.c
@@ -826,8 +826,6 @@ void __cdecl Creature_Kill(
g_LaraItem->goal_anim_state = lara_kill_state;
g_LaraItem->current_anim_state = lara_kill_state;
g_Lara.extra_anim = 1;
- g_Lara.gun_status = LGS_HANDS_BUSY;
- g_Lara.gun_type = LGT_UNARMED;
g_Lara.hit_direction = -1;
g_Lara.air = -1;
https://home.wind.garden/serve/pub/TR2X-0.2-449-g6d3deb1-dirty-Windows.zip It seems to help with the original issue all the while introducing no regressions to the special death animations. I know of the following cases, but I might've missed some:
|
This allows Lara to shoot during the special animations 😄 Sorry, I should have mentioned I tried this already. I also tried doing a check to exit gun control if I also tried forcing her to be unarmed after using tp if the extra animation is set, but it generally ended in being unable to draw weapons again (or interact, climb etc). |
Could we just "reset"/reinitialize Lara on fly or tp? Is it a huge loss if she doesn't retain her current weapon? |
Yeah – I'd just force her to have no gun equipped if it interrupted a special animation. |
The problem is, ideally we want to set request gun type to undraw, to trigger the animation of her putting the weapon away. But only if she is holding a weapon, and we can't originally know that because If I just set the following in TP, the original bug remains. It's because gun control sees no difference in the status and so doesn't force her to undraw/reset her arms.
If I omit the gun type, her arms reset, but she then softlocks - can't interact, draw guns again etc. We could maybe manually reset her arms? |
Yes, I'd say resetting Lara completely would be the best. (Maybe with the exception of holsters and the back gun.) |
This allows the gun undrawing animation to complete fully, avoiding mesh issues if the cheat is exited very quickly. Part of LostArtefacts#237.
2eefee0
to
d89bef9
Compare
Ok, I think this is good now. We have to retain a flare check otherwise I couldn't get her left arm to reset, so currently if you a light a flare before an extra anim, then TP or fly, the flare will persist. Otherwise, if a gun is equipped, Lara will be unarmed after the anim, and her hands should be in the correct position. |
(I haven't tested – but the code LGTM.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested all the scenarios I could think of in these extra anims. Everything looks good. 👍
Resolves #237.
When Lara goes into an extra death animation, like HSH, her current gun status is lost, so I've introduced a caching mechanism to allow it be properly restored if TP or fly is used. I could not find another way to to do this otherwise, as her status is "hands busy" in the extra anim, and I couldn't find another way to work out what she was actually doing before the cutscene starts.
The other issue with the shotgun appearing in her hand after leaving the fly cheat quickly during undrawing should hopefully be resolved too.