Low Gravity and Fast Elevators - Workaround

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
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Low Gravity and Fast Elevators - Workaround

Post by Sarah »

I'm working on an environment with 1/2 the normal game gravity, which is the Doom default. I'm using 3D floors to make a lift/elevator that drops really fast from under the player at the start of the map (the player spawns on the lift), but the player doesn't stay on the lift. Instead the lift drops out from under the player and he gains momentum then hits the platform, loses the momentum, and then repeats the process the whole way down. I'm using a custom player and I've tried a couple flags, NOLIFTDROP and MOVEWITHSECTOR, to hopefully stop the fall-bouncing. The closest I've come is by using both flags, although I think MOVEWITHSECTOR is doing the work, to get a jittery movement as the player's position is reset to the floor of the lift(ceiling of the 3D floor). My guess is the jittery movement is caused by the lift moving almost too fast for the re-positioning to be smooth. So, assuming that I don't want to mess with the speed of the lift, what is the best way to keep the player on it and still have smooth movement? Also, I'd like it if the player could still walk around on the lift while it's moving.
Last edited by Sarah on Thu Apr 18, 2013 3:52 pm, edited 3 times in total.
User avatar
Arch
Posts: 491
Joined: Thu Nov 10, 2011 12:06 pm
Contact:

Re: [Question] Low Gravity and Fast Elevators

Post by Arch »

I don´t know if I understood what you´re trying to do, but I think the final effect should be something like this? The player starts slowly falling down?
Spoiler:
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Re: [Question] Low Gravity and Fast Elevators

Post by Sarah »

This topic, Free Video Screen Capture Software?, is now connected to this one. Hang on and I'll get a video uploaded of the problem.

However, after some reflection I believe I see what is wrong. Video first, then I'll explain :wink:



Please forgive the horrendous-ness of the video, however it shows what I'm talking about. You'll notice that even with MOVEWITHSECTOR and NOLIFTDROP the player still jitters as the lift drops. Now, here is my theory:

The elevator/lift/whatever needs to accelerate and decelerate. Now, luckily the map that video is from is easy to edit at the moment so I'm going to go test that and I'll update with results. Meanwhile, if anyone has any other ideas I'm all ears :D
User avatar
Arch
Posts: 491
Joined: Thu Nov 10, 2011 12:06 pm
Contact:

Re: [Question] Low Gravity and Fast Elevators - New Video

Post by Arch »

Oh now I got it. Making the elevator move slower should fix it. If you really need this speed, you could make an invisible 3d floor right over player´s head so he couldn´t "jump" out of the lift.

Neat map you´re working on, by the way.
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Re: [Question] Low Gravity and Fast Elevators - New Video

Post by Sarah »

I'm overall trying to avoid being forced to resort to that. In all honesty the player should move with the lift. But if the player jumps then they should stay in the air. At some point I'm going to be turning on falling damage and I'm trying to avoid breaking the game because the player dies from riding an elevator. I'm having problems getting any sort of acceleration/deceleration code going.

Right now, this is what I have. The lift doesn't even move... :?

Code: Select all

script 5 OPEN
{
    delay(35*3);
    
    int accel = 0;
    while(accel < 90)
    {
        FloorandCeiling_LowerByValue(1007, accel, 1);
        accel = accel + 2;
            delay(1);
    }
    
        delay(1);
        
    while(accel > 0)
    {
        FloorandCeiling_LowerByValue(1007, accel, 1);
        accel = accel - 2;
            delay(1);
    }
}
I've also tried putting the distance value at 2047, about half of the total distance the lift should move...yeah this is all part of that cinimatic opening stuff 8-) The sector ids are right, I'm basically stumped. :?


Actually, another question, could this be considered a glitch? I am using MOVEWITHSECTOR and not NOLIFTDROP...I realized the folly of having both flags there. While testing I realized that it's trying to keep the actor on the lift, but it's going too fast. You can jump and will be instantly pulled back onto the lift.

And one more thing, with regards to speed, what is that compared to? Say I set a normal door to open at a speed of 30. Well 30 whats per what? 30 map units, 30 feet, per second, per tic? Same thing applies here, I'm moving a lift 90 whats per what?
User avatar
Isle
Posts: 687
Joined: Fri Nov 21, 2003 1:30 am
Location: Arizona, USA

Re: [Question] Low Gravity and Fast Elevators - New Video

Post by Isle »

i gave it a shot and got similar results. how about faking it and moving everything else up?
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Re: [Question] Low Gravity and Fast Elevators - New Video

Post by Sarah »

That would be a marvel solution, but the problem is moving EVERYTHING upward when the map is completed. Also, there will be multiple lifts, so moving all but the lifts up/down would be inefficient. I'm worried I'm going to have to sandwich the player between 3D floors to make this work right.

EDIT:

Actually I think I'm going to simply take the effect into account and modify the lift designs. That's the simplest solution.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: Low Gravity and Fast Elevators - Unsolved/Workaround

Post by Amuscaria »

Can you adjust the gravity of the elevator sector to be higher?
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Re: Low Gravity and Fast Elevators - Unsolved/Workaround

Post by Sarah »

As in forcing the player to fall faster in that area...I never thought of that. And I could turn gravity back to normal when the lift is at its final destination. I just need to test. Thanks Eriance!



Edit:

No that didn't work either. The best I've been able to come up with was to create a dummy object that is placed within a dummy sector whose floor is the ceiling of the lift control sector. The dummy object sits on the floor, giving us the exact location of the lift floor. Now move the lift control sector and the dummy sector together, the same distance. Tag the dummy object and a little SetActorPosition magic and suddenly the player moves with the lift with little to no bumpiness.

Here's my code if anyone is interested:

Code: Select all

script 5 ENTER
{
    delay(35*3);
    
    FloorandCeiling_LowerByValue(1007, 90, 4095);
        delay(3);
    FloorandCeiling_LowerByValue(1009, 90, 4095);
    
    while(GetActorZ(4) - GetActorFloorZ(4) > 1032.0)
    {
        SetActorPosition(0, GetActorX(0), GetActorY(0), GetActorZ(5), 0);
            delay(1);
        SetFont("BIGFONT");
        printbold(s:"DREAMDUMMY Z =", f:GetActorZ(4) - GetActorFloorZ(4));     //This is for testing purposes            
    }
}

script 6 ENTER
{
    SpawnSpot("DREAMDUMMY", 4, 4, 0);
    SpawnSpot("DREAMDUMMY", 5, 5, 0);

    while(TRUE)
    {
        SetActorPosition(4, GetActorX(4), GetActorY(4), GetActorZ(0), 0);
            delay(1);
    }
}
Script 5 does all of the actual moving. Script 6 spawns the dummy objects. Dummy object 4 is used to arrive at a player Z based on setting the object to the players Z position and then figuring out the objects distance from the floor of its control sector. Dummy object 5 is connected to the lift.
Locked

Return to “Editing (Archive)”