[CODE] Smooth stair/camera movement

Post your example zscripts/ACS scripts/etc here.

[CODE] Smooth stair/camera movement

Postby Turret49 » Wed Jun 29, 2016 6:40 pm

(aka No More Slipping)

-------
Update 4/7/16
- Now smooths if the player climbs up a step while in midair.
- Added basic elevation detection using a dummy actor, camera will now account for lift movement instead of squashing/stretching.
- (lift detection is buggy when you stand on the edge, and actor platforms aren't detected at all)

-------

A bit tired of losing control and slipping around whenever Doomguy comes across even the slightest gradation in the ground, I made this script which attempts to keep the player's feet firmly on the floor and let them be able to fully control their movement. This script also takes control over the player's ViewHeight, giving a smoother stair-travelling experience.

Note that you will still fall off stairs if they are too steep to run down. (Also I am not that experienced at ACS so sorry for any newbie-isms)

Credits to Epic MegaGames and Digital Extremes for the smooth camera code, also KeksDose for a tiny bit of code borrowed from Trailblazer.

Download link: https://www.mediafire.com/?o7o73w19j987lic

I also made an example map to help show the difference the script makes, don't run it with the .pk3 though, as an altered version of the script is already embedded within the wad.
You can get the map here: https://www.mediafire.com/?cyrrhg7zp21dd04 (uses outdated version of script!)

Image
Last edited by Turret49 on Mon Jul 04, 2016 6:37 am, edited 4 times in total.
Turret49
Global Moderator
 
Joined: 29 Aug 2015

Re: [CODE] Smooth stair/camera movement

Postby Gutawer » Sat Jul 02, 2016 3:42 pm

Thanks for this, seems to work pretty well. Just wondering, does it have any effect on slopes?
User avatar
Gutawer
User Accounts Assistant
 
Joined: 16 Apr 2016
Discord: Gutawer#3431

Re: [CODE] Smooth stair/camera movement

Postby Nash » Sat Jul 02, 2016 3:48 pm

[commenting to check this out in future]
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: [CODE] Smooth stair/camera movement

Postby Turret49 » Mon Jul 04, 2016 5:20 am

Gutawer wrote:Thanks for this, seems to work pretty well. Just wondering, does it have any effect on slopes?

From what I've looked at the player seems to grip slopes a bit more, but it doesn't appear to have any affect on actual control, sadly.

Updated the OP with a new version after finding some issues with the first one. the new lift detection is really buggy but I'm not sure of a better way to do it. In GZdoom there's even a bug at the start of a map (DUMP 2 MAP28) That is entirely random (somehow arbitrarily based on the size of the script, including commented out text) where the dummy actor reverses its Z height (and FloorZ) information for a couple seconds and I can't figure out how to stop it from happening. Doesn't happen in ZDoom, either.
Turret49
Global Moderator
 
Joined: 29 Aug 2015


Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest