Page 1 of 1

Ice rink

Posted: Tue May 26, 2009 5:53 am
by Jimmy
I want to create quite a specific ice rink.
  • The player has no control over his movements on the ice.
  • The player mustn't move diagonally across the ice, only straight.
  • The player loses no momentum crossing the ice even if he hits a wall - he should simply be bounced back.
  • The ice has no friction at all so the player's initial momentum isn't slowed after he steps onto it.
I've got Sector_SetFriction(tag,255) making the ice lose all friction, and I've made it so the player gets Prop_TotallyFrozen set while he's on the ice, but this isn't ideal. I'm also fairly sure that with some GetPlayerInput tomfoolery, I can make it so he can't go on the ice if he's moving diagonally. But the thing I'm having the most problems with is the rebounding off the walls. Typically, a low-friction surface causes the player to bounce off it anyway, but when there's no friction at all and if the player's moving diagonally (which I should alleviate at some point) the player simply hits the wall and slides down it. The fact that he can't control his movement while over the ice makes him get stuck sliding inexorably down the nearest wall. :(

Help would be greatly appreciated.

Re: Ice rink

Posted: Tue May 26, 2009 10:55 am
by Phobus
A player bumps executed script that gets the players momentum and reverses it would be good. If you had walls facing horizontally with arg 1 being 1 and the vertical walls being 2, then you could then use that to only reverse momentum away from the wall, so the player bouncing would work as you want it to.

Re: Ice rink

Posted: Wed May 27, 2009 5:06 am
by Jimmy
That would be ideal since the walls in question already have a "player bump" activation. :)

Now, I want to restrict the player's diagonal movement under certain circumstances. Can it be done with [wiki]GetPlayerInput[/wiki]? It's just a little complicated for me...

Re: Ice rink

Posted: Wed May 27, 2009 7:06 am
by .+:icytux:+.
jimmy91 wrote:That would be ideal since the walls in question already have a "player bump" activation. :)

Now, I want to restrict the player's diagonal movement under certain circumstances. Can it be done with [wiki]GetPlayerInput[/wiki]? It's just a little complicated for me...
well, if you dont want to be able to strafe at all, you could make your playerclass have the player.sidemove or whatever it was, check wiki, and put it to 0.

Re: Ice rink

Posted: Wed May 27, 2009 7:20 am
by Remmirath
I guess Jimmy is referring to diagonal movement, that is both the forward and strafe movement. So i think that GetPlayerInput would be the best choice here. And he didn't ask to completely deactivate strafing.

Re: Ice rink

Posted: Wed May 27, 2009 7:22 am
by .+:icytux:+.
Morpheus wrote:I guess Jimmy is referring to diagonal movement, that is both the forward and strafe movement. So i think that GetPlayerInput would be the best choice here. And he didn't ask to completely deactivate strafing.
no, but without strafing you cant move diagonally. so if he dosn't mind taking strafing out then.

Re: Ice rink

Posted: Wed May 27, 2009 8:03 am
by Jimmy
I will mind - the project in question is Blocks of Doom II, whose 3rd person camera requires the player to be able to strafe if he wants to navigate anywhere. :P

Just to clarify a little further - I don't want the player to be able to walk diagonally onto a certain part of the map (in this project's case, any block on the grid which is covered by ice). This will stop the player sliding over the ice at an angle.

Re: Ice rink

Posted: Thu May 28, 2009 9:43 am
by Jimmy
Can someone please give me a quick script that stops a player from moving diagonally onto a sector? :)

GetPlayerInput kinda flies over my head.

Re: Ice rink

Posted: Thu May 28, 2009 5:58 pm
by XutaWoo
Perhaps make it so that when a player enters from a side,the player is thrust to the other?

Re: Ice rink

Posted: Sun May 31, 2009 5:20 am
by Jimmy
Ack, you're a little late... Carlcyber already fixed this for me. :P