[ZScript] Ledge climbing

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.
dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm
Contact:

[ZScript] Ledge climbing

Post by dodopod »



This mod allows the player to climb ledges by holding 'Jump'. It works using a player class derived from DoomPlayer,
so it will take some slight changes if you want to use it in Hexen, for example.

Download
User avatar
Rip and Tear
Posts: 185
Joined: Tue May 02, 2017 3:54 pm

Re: [ZScript] Ledge climbing

Post by Rip and Tear »

This is really cool, and seems to work pretty well.

One thing that should probably be fixed is that it doesn't check if there is enough room to climb up.
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: [ZScript] Ledge climbing

Post by Tormentor667 »

Prince of Persia Doom anyone? :)
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: [ZScript] Ledge climbing

Post by Matt »

Rip and Tear wrote:One thing that should probably be fixed is that it doesn't check if there is enough room to climb up.
On the other hand, it might be better that it doesn't - sometimes you might want to just hang onto a ledge to delay a fall until something's passed by, or the platform itself could be gradually lowering and you just need to hang on for a second or so before there's enough room to get on.


edit: aww man this is sooo much cleaner than the kludgefest I'm using right now!
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: [ZScript] Ledge climbing

Post by Caligari87 »

Mind if I take this and make some adjustments, with credit of course? I was trying to do something like this myself, and failing miserably.

8-)
dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm
Contact:

Re: [ZScript] Ledge climbing

Post by dodopod »

Matt wrote:On the other hand, it might be better that it doesn't - sometimes you might want to just hang onto a ledge to delay a fall until something's passed by, or the platform itself could be gradually lowering and you just need to hang on for a second or so before there's enough room to get on.
That's true, though I should probably add a special case for that, or something. As it is, the player bounces up and down when they get to the top.
Caligari87 wrote:Mind if I take this and make some adjustments, with credit of course? I was trying to do something like this myself, and failing miserably.

8-)
Sure.
dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm
Contact:

Re: [ZScript] Ledge climbing

Post by dodopod »

New version. Now it works w/ 3D floors, and when there's not enough clearance to get on top of a ledge. The player will automatically crouch when they reach the top of a ledge, in case they need to fit into a small space. Or, if there still isn't enough room, they'll just hang on, until the player lets go.
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [ZScript] Ledge climbing

Post by Nash »

This feels almost like Dying Light's ledge climbing mechanics. Good job!
User avatar
MrToots
Posts: 77
Joined: Fri Sep 22, 2017 11:56 am
Contact:

Re: [ZScript] Ledge climbing

Post by MrToots »

I'm kind of a noob at ACS/Zscript how do I make it so the script works with my pre made playercharacter?
dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm
Contact:

Re: [ZScript] Ledge climbing

Post by dodopod »

I'm not sure exactly what you're trying to do, so it's hard to give precise instructions. The main thing is to find the file zscript/climbing/climbing_player.zc. The first line should say

Code: Select all

class ClimbingPlayer : DoomPlayer
Change "DoomPlayer" to the name of your player class. If that doesn't work, send me your PK3 so I can see what's wrong.
Treck
Posts: 7
Joined: Sat Apr 07, 2018 9:54 am

Re: [ZScript] Ledge climbing

Post by Treck »

Sorry for the bump, I'm having trouble getting this to work with other classes, I've tried to do what was said bellow but whenever i replace "DoomPlayer" with the class i want i just get an error on startup, any help would be appreciated.
dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm
Contact:

Re: [ZScript] Ledge climbing

Post by dodopod »

That solution didn't end up working, anyway. What did work was to have the custom player class inherit from ClimbingPlayer. In other words

Code: Select all

class YourPlayerClass : ClimbingPlayer
But I'm not entirely sure what you're trying to do, so that may or may not work.
Treck
Posts: 7
Joined: Sat Apr 07, 2018 9:54 am

Re: [ZScript] Ledge climbing

Post by Treck »

Thanks for the help, unfortunately i still cant make it work, how i have it set up

Code: Select all

class Doomer3 : ClimbingPlayer
In a separate PK3 the class is defined in KEYCONF and looks like

Code: Select all

clearplayerclasses
addplayerclass Doomer3
This is the message i get on startup if anyone can suggest what im doing wrong.
Spoiler:
dodopod
Posts: 66
Joined: Wed Oct 04, 2017 2:00 pm
Contact:

Re: [ZScript] Ledge climbing

Post by dodopod »

Wait, did you change the line that said

Code: Select all

class ClimbingPlayer : DoomPlayer
to

Code: Select all

class Doomer3 : ClimbingPlayer
That's not what I meant. What I meant was, go to wherever Doomer3 is defined, and change that line to

Code: Select all

class Doomer3 : ClimbingPlayer
Treck
Posts: 7
Joined: Sat Apr 07, 2018 9:54 am

Re: [ZScript] Ledge climbing

Post by Treck »

Ahh, yes, That did the trick thanks heaps, I'm really enjoying this script it works wonderful!
Post Reply

Return to “Script Library”