Page 1 of 1

[ZScript] Leaning

Posted: Sun Aug 12, 2018 4:15 pm
by Josh771
Here is my first release of a simple leaning script with two modes of control.

(Click to animate; it's a GIF)

By default, 'Q' and 'E' will be bound to 'Lean Left' and 'Lean Right' respectively. You may instead choose to bind a Strafe-lean key, which will cause the strafe keys to lean while it is held.

Known issues:
• Strafe-lean does not prevent strafing in Hideous Destructor. I recommend using keybinds for 'Lean Left' and 'Lean Right'.
• Because the leaning is currently implemented as a mere quick sidestep, you will fall off of any ledge you attempt to lean over.
• The lean angle option is meant for fine-tuning, but be warned that using extreme values (e.g. 90) may be unplayable.

I would like to fix the leaning-over-ledges issue and will be considering methods for doing that. Also thinking on an alternate implementation that should fix the Hideous Destructor incompatibility hopefully.
lean.pk3
(2.03 KiB) Downloaded 2830 times
Feel free to modify this or integrate this into your own mods. I always appreciate credit, too, so go ahead and mention me if you use it (But I won't hunt you down if you don't :P ).

EDIT: I just realized this may well not function correctly with multiplayer. Please let me know if that is the case; I already have a fix in mind.

Re: [ZScript] Leaning

Posted: Sun Aug 12, 2018 4:58 pm
by Enjay
Nice.


I like the fact that it is actually functional - i.e. if you lean far enough around a corner to see a previously hidden enemy, you can now shoot the enemy. It's not just that the camera has moved (where your shot would still be blocked by the wall).

[edit] and the bad guys can see you peeping around the wall too if they are looking in the right direction. Also nice.

I wonder though, is there any way of making the player less likely to be seen in that situation? Not invisible, just less visible because he is semi-behing cover. Mind you, I guess that would start getting tricky because other enemies elsewhere (e.g. behind the player) should't have their view of the player altered so a simple invisibility-like effect isn't appropriate). [/edit]


Image

Garrett approves. :)

Re: [ZScript] Leaning

Posted: Sun Aug 12, 2018 5:44 pm
by Josh771
I would absolutely love to make this obscure you from enemies, but I had already considered the issue of using what would essentially be partial invisibility allowing you to "hide in plain sight" quite unrealistically. I can't imagine pulling that off in any sort of portable way, but perhaps if I reboot Sneaky Doom I can put something like that in there.

Re: [ZScript] Leaning

Posted: Tue Aug 14, 2018 10:14 am
by snarkel
I tried this out and I noticed that when using the standard lean keys you actually lean much further to the left than to the right and if you keep leaning left you'll actually start moving left because you aren't actually returning to your original position. I also noticed that you become absurdly slow when strafing. Are these both intentional?

Re: [ZScript] Leaning

Posted: Tue Aug 14, 2018 9:38 pm
by potetobloke
Sweet and useful mod but, is it possible to implement it without the view roll?
Also, it doesn't work properly with Nash's Tilt++ mod.

Re: [ZScript] Leaning

Posted: Sun Aug 19, 2018 11:27 am
by Josh771
snarkel wrote:I tried this out and I noticed that when using the standard lean keys you actually lean much further to the left than to the right and if you keep leaning left you'll actually start moving left because you aren't actually returning to your original position. I also noticed that you become absurdly slow when strafing. Are these both intentional?
Slowed movement speed is semi-intentional. It comes with the simulated increased friction I use to keep the leaning from gliding too far, but I considered it an added bonus that you can't run around full speed while hanging dramatically to one side or the other. That "dramatically" is up for debate, of course, since the tilting can be adjusted.

As for any sort of asymmetry in the leaning, I've been using this extensively and noticed no such thing. I'm curious what your load order is or whether you notice the effect in vanilla or with only certain lean angles. I'm considering a re-write of the leaning logic that should rule out these sorts of problems, anyway, but I'm still curious why there should be any difference from left to right.
potetobloke wrote:Sweet and useful mod but, is it possible to implement it without the view roll?
Also, it doesn't work properly with Nash's Tilt++ mod.
It could be implemented as a quick sidestep without roll; the current logic depends upon changing the player's roll, but I'm considering a rewrite that will do away with that behavior.

No, I'm afraid it doesn't get along too well with Tilt++. The two mods, afaik, would need to be integrated, unless I can sit down and figure out how to preserve Nash's tilting and combine it with my own. That may well be possible, I just haven't tried yet. But my suspicion is that I would need to (with Nash's permission) release a modified Tilt++ with leaning.

Re: [ZScript] Leaning

Posted: Sun Aug 19, 2018 5:21 pm
by RikohZX
Well this fits perfectly with your own aforementioned Sneaky Doom, it's actually really neat.

Re: [ZScript] Leaning

Posted: Tue Sep 11, 2018 5:40 pm
by snarkel
Josh771 wrote:
Slowed movement speed is semi-intentional. It comes with the simulated increased friction I use to keep the leaning from gliding too far, but I considered it an added bonus that you can't run around full speed while hanging dramatically to one side or the other. That "dramatically" is up for debate, of course, since the tilting can be adjusted.

As for any sort of asymmetry in the leaning, I've been using this extensively and noticed no such thing. I'm curious what your load order is or whether you notice the effect in vanilla or with only certain lean angles. I'm considering a re-write of the leaning logic that should rule out these sorts of problems, anyway, but I'm still curious why there should be any difference from left to right.
Well, I did have Tilt++ and and now that you and riko say that it doesn't work, I wonder if that is what is causing the weird symmetry issues. And as for the strafing, I mean like, even when NOT leaning, you are slowed to a ridiculous amount when strafing.

Re: [ZScript] Leaning

Posted: Tue Aug 17, 2021 12:20 pm
by RastaManGames
Sad, that this is broken when using it with "Rainbow 6 Arsenal" due to some included movement addons.
It will be good to have something like included leaning into that mod or, at least, have compatibility with movement addons for universality.