Synchronizing sector and line scroll speeds

Handy guides on how to do things, written by users for users.
Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.

Synchronizing sector and line scroll speeds

Postby Talon1024 » Sat May 11, 2019 12:23 am

I'm sure there have been at least some mappers who have wanted to synchronize the scroll speeds between walls and flats in order to create the illusion of the player being on a subway, train or some other kind of moving vehicle.

You may have thought that you could just assign the same numbers to Scroll_Texture_Left/Right/Up/Down and/or Scroll_Floor/Ceiling, but you found that when you did so, your flats and walls were scrolling at different speeds! I think these gotchas are some of those relics of ZDoom's history.

So this tutorial explains how to set up scrolling so that your walls and flats move at the same speed.

First of all, you'll need a "base speed", like 5. I think this is the amount of pixels the wall or flat will scroll each tic.

For Scroll_Texture_Left/Right/Up/Down:
Code: Select allExpand view
arg0 = base speed * 64

For Scroll_Wall, the x and y values are given in fixed point, so just multiply the base speed by 65536:
Code: Select allExpand view
x = base speed * 65536
y = base speed * 65536

Note that assigning a line the Scroll_Wall special does not immediately start scrolling the wall, unlike Scroll_Texture_Left/Right/Up/Down, so you'll need to use the special on a wall with a switch, or an ACS script.

For Scroll_Floor and Scroll_Ceiling:
Code: Select allExpand view
xMove = base speed * 32 + 128
yMove = base speed * 32 + 128
Joined: 27 Jun 2016
Github ID: Talon1024
Operating System: Debian-like Linux (Debian, Ubuntu, Kali, Mint, etc) 64-bit
Graphics Processor: nVidia with Vulkan support

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests