Game Development Community

Stopping player from moving on steep terrain

by Hugo Mardolcar · in Torque Game Engine · 10/02/2003 (6:10 am) · 3 replies

Hello ppl

I'm trying to make the player unable to walk over steep hills (it's not very nice that he's able to climb anything...)

I was searching here and there and I eventually got to gameConnectionMoves.cc, to the method GameConnection::getNextMove, and it looks like it should be there that the "steepness" check should be placed.

I made the calculations with the MoveManager::mForwardAction kind of variables, but it doesn't seem to work and I wonder what these variables actually hold...

can someone give me an hint about this?

Thanks!

#1
10/02/2003 (6:35 am)
I would make the changes to the player.cc file. IE, the Player class itself, in updateMove. Theres already a ton of stuff in there about jumping and landing on slopes (they push you back on the normal a bit to give a bouce effect). You could look at that and calculate the normal angle to find the slope, then if its too much, just stop the player from moving forward.
#2
10/02/2003 (6:41 am)
I think the solution to this is a lot simpler than you think.

Open player.cs in /server/scripts/ and look for the variable:

runSurfaceAngle

Changing the value of this affects how steep a slope a player can climb.

Hope this is what you need.

-Greg.
#3
10/02/2003 (6:52 am)
Eheh, simple and effective
that's it, thanks!