[ZScript] Leaning

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Post Reply
User avatar
Josh771
Posts: 676
Joined: Wed Apr 03, 2013 11:36 am
Location: Elsewhere.

[ZScript] Leaning

Post 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 2826 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.
User avatar
Enjay
 
 
Posts: 26516
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [ZScript] Leaning

Post 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. :)
User avatar
Josh771
Posts: 676
Joined: Wed Apr 03, 2013 11:36 am
Location: Elsewhere.

Re: [ZScript] Leaning

Post 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.
User avatar
snarkel
Posts: 139
Joined: Wed Aug 06, 2014 9:02 pm
Preferred Pronouns: He/Him

Re: [ZScript] Leaning

Post 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?
User avatar
potetobloke
Posts: 246
Joined: Wed Dec 07, 2016 12:07 am
Graphics Processor: nVidia (Modern GZDoom)
Location: In a chemical world

Re: [ZScript] Leaning

Post 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.
User avatar
Josh771
Posts: 676
Joined: Wed Apr 03, 2013 11:36 am
Location: Elsewhere.

Re: [ZScript] Leaning

Post 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.
User avatar
RikohZX
Posts: 307
Joined: Tue Sep 04, 2012 9:11 pm

Re: [ZScript] Leaning

Post by RikohZX »

Well this fits perfectly with your own aforementioned Sneaky Doom, it's actually really neat.
User avatar
snarkel
Posts: 139
Joined: Wed Aug 06, 2014 9:02 pm
Preferred Pronouns: He/Him

Re: [ZScript] Leaning

Post 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.
User avatar
RastaManGames
Posts: 375
Joined: Wed Mar 12, 2014 11:13 pm
Graphics Processor: nVidia with Vulkan support
Location: Russian Federation, Krasnoyarsk

Re: [ZScript] Leaning

Post 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.
Post Reply

Return to “Script Library”