Ice rink

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Ice rink

Post 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.
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Re: Ice rink

Post 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.
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: Ice rink

Post 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...
User avatar
.+:icytux:+.
Posts: 2661
Joined: Thu May 17, 2007 1:53 am
Location: Finland

Re: Ice rink

Post 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.
User avatar
Remmirath
Posts: 2562
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

Re: Ice rink

Post 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.
User avatar
.+:icytux:+.
Posts: 2661
Joined: Thu May 17, 2007 1:53 am
Location: Finland

Re: Ice rink

Post 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.
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: Ice rink

Post 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.
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: Ice rink

Post 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.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Ice rink

Post by XutaWoo »

Perhaps make it so that when a player enters from a side,the player is thrust to the other?
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: Ice rink

Post by Jimmy »

Ack, you're a little late... Carlcyber already fixed this for me. :P
Locked

Return to “Editing (Archive)”