[ZScript] Leaning

Post your example zscripts/ACS scripts/etc here.

[ZScript] Leaning

Postby Josh771 » Sun Aug 12, 2018 5:15 pm

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 406 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
Josh771
formerly known as SidDoyle
 
Joined: 03 Apr 2013
Location: Elsewhere.
Discord: josh771#7771

Re: [ZScript] Leaning

Postby Enjay » Sun Aug 12, 2018 5:58 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: [ZScript] Leaning

Postby Josh771 » Sun Aug 12, 2018 6:44 pm

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
Josh771
formerly known as SidDoyle
 
Joined: 03 Apr 2013
Location: Elsewhere.
Discord: josh771#7771

Re: [ZScript] Leaning

Postby snarkel » Tue Aug 14, 2018 11:14 am

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
snarkel
some guy that tries to make things with ameture DECORATE skill
 
Joined: 06 Aug 2014

Re: [ZScript] Leaning

Postby potetobloke » Tue Aug 14, 2018 10:38 pm

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
potetobloke
My legs are OK.
 
Joined: 07 Dec 2016
Location: In a chemical world
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: [ZScript] Leaning

Postby Josh771 » Sun Aug 19, 2018 12:27 pm

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
Josh771
formerly known as SidDoyle
 
Joined: 03 Apr 2013
Location: Elsewhere.
Discord: josh771#7771

Re: [ZScript] Leaning

Postby RikohZX » Sun Aug 19, 2018 6:21 pm

Well this fits perfectly with your own aforementioned Sneaky Doom, it's actually really neat.
User avatar
RikohZX
 
Joined: 04 Sep 2012

Re: [ZScript] Leaning

Postby snarkel » Tue Sep 11, 2018 6:40 pm

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
snarkel
some guy that tries to make things with ameture DECORATE skill
 
Joined: 06 Aug 2014


Return to Script Library

Who is online

Users browsing this forum: No registered users and 0 guests