Jump to content
  • 0

How do you disable jumping in a specific sector?


Gianluco

Question

Basically what the title says, I've already tried raising the Gravity to 999, but it has a really weird effect when jumping

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 3

Pretty simple to achieve with ACS and appropriately placed lines to trigger it, using SetActorProperty() to alter the value of the player's Jump height with APROP_JumpZ.

 

Script "RemoveJump" (int preventJumping) {
   if(preventJumping) {
      SetActorProperty(0,APROP_JumpZ,0);
   }
   else {
      SetActorProperty(0,APROP_JumpZ,8<<16);
   }
}

The script above is a simple implementation of this. When entoring the sector(s) you want the player to no longer be able to jump in, you will need to call the script via a line or an "actor enters sector" thing, setting the preventJumping variable to 1. You'll then need to use the same method on the exits, calling the same script but with preventJumping set to 0. I've included a demo below for you to reference - good luck!

 

preventJump-Example.zip

Edited by Dragonfly

Share this post


Link to post
  • 0

You can do it on a whole-map basis via adding NoJump to the map's MAPINFO.

 

If you really only want it to be a specific sector, you will probably need to add more gravity; the default is 800.

Share this post


Link to post
  • 0
53 minutes ago, Dark Pulse said:

You can do it on a whole-map basis via adding NoJump to the map's MAPINFO.

 

If you really only want it to be a specific sector, you will probably need to add more gravity; the default is 800.

I know about the gravity thing, but when you jump with high gravity it has a weird effect

Share this post


Link to post
  • 0
47 minutes ago, Gianluco said:

I know about the gravity thing, but when you jump with high gravity it has a weird effect

The only way I can think of is to technically have it run as an ACS Script.

#include "zcommon.acs"

script 1 (void)
{
		SetActorProperty(0, APROP_JumpZ, 0);
}

script 2 (void)
{
		SetActorProperty(0, APROP_JumpZ, 8<<16);
}

Rather than set a sector's gravity, you set the lines defining the sector facing towards the player so they trip them with the Script Execute action (80), and then just outside that sector's boundaries, facing towards the player in the opposite direction (i.e; if they were going out of the sector), you do the same. Script 1 defines the sector where jumping is "disabled", script 2 restores the player's ability to jump.

 

Set both sets of lines to be repeatable, to activate when the player walks over them, and to activate from the front side only.

 

Edited by Dark Pulse

Share this post


Link to post
  • 0

Another option that will simulate it is to have an invisible 3D floor at head height, so there is simply no room to jump. This is OK if you don't need to shoot up of course...


 

Share this post


Link to post
  • 0
3 hours ago, smeghammer said:

Another option that will simulate it is to have an invisible 3D floor at head height, so there is simply no room to jump. This is OK if you don't need to shoot up of course...


 

 

I'd advise against this. Aside from the obvious potential jank of it, it will also cause more potential lag... Not that it'd be noticeable on most pc's this day. 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...