Could be asleep, typing random messages instead.

Climbable ropes/chains/ladders etc? [Good solution herein]

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar Buff Skeleton
>:E >:E
Posts: 4175
Joined: 15 Dec 2007, 00:46

Subject: Climbable ropes/chains/ladders etc? [Good solution herein]

Post Posted: 19 Jul 2009, 19:22

I'm trying to make climbable stuff, but this engine is a real jerk about it. Here's what I've done so far:

1) Created a custom zone that uses bWaterZone, a high fluid friction, and no gravity. This allows the most control for the player, and it works fantastically well except for these few but annoying problems:

- Players can drown while climbing. I fixed this, though, by borrowing from TarZone's implementation of slowing down whatever enters; I simply set the pawn's UnderWaterTime to -1 while in the zone and reset it when they leave to the pawn's default.
- Projectiles think the rope is a water zone, because it is. Rockets and grenades slow down, biogel floats, etc. This is a big problem, as you can't properly shoot while climbing if this is the case.
- The water entry actor/noise, while replaceable, STILL HAPPENS for some actors, even the player in some cases. This is really irritating too.
- Pawns use their swimming animation while climbing, which looks stupid.

So far, this is still the best implementation despite the issues, as players have lots of control when climbing (up or down) and they can leap from another high place and "grab on" to the rope without falling to their death.

2) Tried a custom zone using only gravity and friction adjustments. This works sorta ok, sorta badly. There isn't as much control, as the player always goes straight up automatically, and often way way too fast (no one can climb a rope that fast!). Projectiles are ok, naturally, as it's not bWaterZone=True.

- Setting the gravity to a positive value makes it impossible to climb down and climbing up can be super fast
- Setting the gravity to zero doesn't help
- Setting the friction high still doesn't stop the player from zooming UP the rope if they jump, or if they hold the jump button and press forward against the rope brush
- If you leap from a high place, you can't start climbing up. You just fall, but sometimes you don't take any damage since the zone has a higher friction and lower terminal velocity
- It's very easy to fall out of the zone and very hard to fall back into it


3) Speculated about movers. I haven't tried this yet, but you could use invisible platforms that rise with a narrow, tall Trigger (movers set to TriggerControl). This is the worst implementation, and if it came to this, I'd just make standard elevators instead.

- No control for the player. Automatic climb
- Can't climb down. Mover can only go up one way
- Mover movement is very obvious to the player and you can walk around on it, even if it's very small
- If you fall off and want to go back up, you have to wait for the mover to slooooooowly come back down



So, yeah, this is a real dilemma. Do any of you have any ideas about how to deal with projectiles in a waterzone? I tried adding a

Code: Select all

   if ( Other.IsA('Projectile') )
      return;

to my custom waterzone's ActorEntered function, but that didn't do anything. Is there some way to make a zone just not register projectiles (or dropped inventory) at all? If I could get the zone to completely ignore projectiles, there wouldn't be that damn water splash actor/sound and velocity slowdown for them, and then I would be able to have climbable ropes.
Last edited by Buff Skeleton on 21 Jul 2009, 17:40, edited 1 time in total.

Sarevok
Skaarj Assassin Skaarj Assassin
Posts: 124
Joined: 11 Mar 2009, 03:31
Location: somewhere

Subject:

Post Posted: 19 Jul 2009, 20:18

A trick I heard of, but never tried is an invisible set of stairs. They would have to be almost vertical, maybe 1-2 units in step length, I think the max height the player can climb is 24 units per step.

User avatar Buff Skeleton
>:E >:E
Posts: 4175
Joined: 15 Dec 2007, 00:46

Subject:

Post Posted: 19 Jul 2009, 21:11

That presents the problem of being able to climb super fast, too.

Z-enzyme
White Tusk White Tusk
Posts: 2136
Joined: 13 Nov 2007, 20:01

Subject:

Post Posted: 19 Jul 2009, 22:24

I used for my ladders a touch function.

Code: Select all

=============================================================================
//
// QLadder.
//
=============================================================================
class QLadder expands Triggers;

function Touch( actor Other ) //actor touches the ladder, calls this function
{
   if( Pawn(Other) != None && Pawn(Other).bIsPlayer ) //if actor is a player do...
   {
      Other.SetPhysics(PHYS_Flying); //...do this
   }
}

function tick(float DeltaTime) //tick tock.
{
   local PlayerPawn pp; //define player class as pp

   foreach TouchingActors(class'PlayerPawn',pp) //for all touching actors, if they are pp
   {
      if(pp.ViewRotation.Pitch < 57344 && pp.ViewRotation.Pitch > 40960) //at some point of view rotation do...
      {
         pp.Velocity.Z = -140; //...do this.
      }
      if(pp.ViewRotation.Pitch < 24576 && pp.ViewRotation.Pitch > 8192) //same as above.
      {
         pp.Velocity.Z = 140;
      }
   }
}

function UnTouch( actor Other ) //when actor untouches...
{
   if( Pawn(Other) != None && Pawn(Other).bIsPlayer ) //...and is a player...
   {
      Other.SetPhysics(PHYS_Falling); //... go down make boom!
   }
}



It uses the view rotation to determine if player climbes or not.

User avatar Buff Skeleton
>:E >:E
Posts: 4175
Joined: 15 Dec 2007, 00:46

Subject:

Post Posted: 19 Jul 2009, 22:26

Oh, awesome, this sounds really clean and simple too. Thanks! I'll give this a try and see how it goes.

Sarevok
Skaarj Assassin Skaarj Assassin
Posts: 124
Joined: 11 Mar 2009, 03:31
Location: somewhere

Subject:

Post Posted: 19 Jul 2009, 22:59

Though you'll probably use qtit's ladder, I think I figured it out. Use the invisible stairs and then just add a regular zone info around them. Change the zone velocity X=80, Y=0, Z=0 and change nothing else. Y seems to push the player to the left and Z lowers the jump. It allows the player to slowly climb the rope, but can quickly get down, seems pretty realisitic. Anything higher than 100 on X and the player can't go forward at all.

User avatar Buff Skeleton
>:E >:E
Posts: 4175
Joined: 15 Dec 2007, 00:46

Subject:

Post Posted: 20 Jul 2009, 04:59

Thank you so much qtit, this is absolutely perfect!

User avatar Shivaxi
Gilded Claw Gilded Claw
Posts: 1917
Joined: 24 Jun 2008, 19:51
Location: Behind You! =P
Contact:

Subject:

Post Posted: 20 Jul 2009, 05:35

oh lol...didn't see this thread before I replied in your project thread Waff :P . Kinda useless now...nvm :B
http://img836.imageshack.us/img836/9950/shivavatar2.jpg Image

Waffnuffly: If there is any purpose for the god damned ocean, it is for us to eat it.
Jet_v4.3.5: I want to be Lincoln and kick Satan's ass. Emancipate and Proclimate on his ass.

User avatar Buff Skeleton
>:E >:E
Posts: 4175
Joined: 15 Dec 2007, 00:46

Subject:

Post Posted: 28 Jul 2009, 04:08

OK, I have a slight bug here with this ladder trigger and waterzones. Mostly, the problem is when you fall off of a ladder or whatever and land in the water; your velocity kinda gets fucked up and your movement speed goes down to next to nothing, making it really hard to get out of the water. I think it has something to do with setting the velocity the way it does and entering a waterzone probably has its own velocity-setting mechanism, so do you think there's a way to fix this?

.:..:
Skaarj Warrior Skaarj Warrior
Posts: 68
Joined: 20 Dec 2007, 13:06
Location: Finland
Contact:

Subject:

Post Posted: 31 Jul 2009, 06:51

I think your problem will be fixed like this:

Code: Select all

function UnTouch( actor Other ) //when actor untouches...
{
   if( Pawn(Other) != None && Pawn(Other).bIsPlayer ) //...and is a player...
   {
      if( Other.Region.Zone.bWaterZone )
         Other.SetPhysics(PHYS_Swimming);
      else Other.SetPhysics(PHYS_Falling); //... go down make boom!
   }
}

User avatar Buff Skeleton
>:E >:E
Posts: 4175
Joined: 15 Dec 2007, 00:46

Subject:

Post Posted: 31 Jul 2009, 14:22

Thanks a lot dots, I'll try that and report back if it fixes the problem!

[Edit] And it has. Excellent. Thanks again guys!


Who is online

Users browsing this forum: No registered users and 1 guest

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited