Nine Inch Heels Posted September 14, 2019 (edited) I've decided to write up a short primer to help people build "non-jank" looping conveyors for all manners of "voodoo scripts", and while I was at it, I figured I might as well talk timers too, due to how much these two things have in common within the realm of Boom-format mapping. What the supposed reader can learn here is how to build conveyors that will work equally across different source ports, which in turn keeps debugging and frustration at an absolute minimum. This is not going to be a super drawn-out step-by-step tutorial for people who are still wet behind the ears, however. Sound good? Then let's wait no longer... Simple loops: Spoiler The most basic way to build a looping script that will start (and keep!) running when the player triggers an action looks like this: Everything is contained within a sector of 56map units in height (just enough for DoomGuy, nice and snug), and consists of the following components:1. The "engine". An action 252 linedef with a length of 32 map units. (Important for identical behaviour across different source ports!) 2. A player1 start that acts as our "voodoo doll". 3. A ceiling lowered by 1 map unit (in a 56 high conveyor), which prevents the script from running unless a certain condition has been met, like a switch being pressed, or a tripwire being crossed. Lowering the ceiling in this setup by just 1 map unit is important, it keeps the delay at an absolute minimum, because there's virtually no waiting involved once it raises. 4. Two linedefs with the same tag. The green linedef on the right side has action 263 (WR,teleport to linedef with same tag, silent, reversed angle) assigned. Make sure both these linedefs have the same "orientation", it will keep the doll's momentum constant at all times, and therefore the loop is easier to "tune". You can put any actions you want to "remote-trigger" between the lowered ceiling piece and the teleport linedef (or use the linedefs of the ceiling piece as well). Just make sure that the doll never has "contact" with more than 8 different linedefs at a time, because spechits-overflows need to be avoided to prevent "glitches". Depending on how fast you want the loop to run, you can increase or shorten the length of the conveyor, but don't mess with the length of the action 252 linedef unless you absolutely have to for some reason! Also make sure the doll always has contact to the scrolling floor, so it doesn't get slowed down too much, or worse get stuck. When in doubt, build another engine for the floor parts beneath the ceiling pieces, too. Alternatively, use small enough sectors for blockers so your doll or monster doesn't "fall" into it, and lower the floor just a little bit to avoid contact between the thing you wish to scroll and any floor-piece that is not scrolling at all A loop that doesn't run indefinitely, and instead needs to be "re-triggered" to run: Spoiler See the highlighted parts? I simply added a control sector (55mu ceiling height because 56mu high conveyor) next to the ceiling piece (always make sure to keep it out of the doll's way like I did here), as well as a trigger in the conveyor that will lower the ceiling piece before the doll gets teleported (resetting the entire system in the process). I use a generalized ceiling action to lower the ceiling piece with "target" set to "lower to next adjacent", which is to make sure the ceiling piece gets lowered by just 1 map unit to keep the entire system as responsive as possible, even after dozens of repetitions. Remember why we put this in a 56 high conveyor and lowered the ceiling by just 1 map unit in order to stop the doll from moving? Right, this is why. Gotta keep it crisp and responsive. Now let's talk timers, and the math behind them: Spoiler You can build 'single use timers' as well as 'looping timers'. I'm not going to bother you with bland screenshots any longer, because the construction is very much the same as that of a looping conveyor (for single use timers you don't need to work in the teleport linedefs, or any other reset mechanisms). So how do we build a timer that lasts for X seconds? As I said above, ideally we use a 32 map unit action 252 linedef as our engine. This engine accelerates our voodoo doll to precisely 35 map units of speed per second, or 1 map unit per tic. And the best thing is that this engine functions equally in PrBoom+ and (G)ZDoom. So it's very easy and straight forward math from here on out. Let's say you want a timer of 1 minute. All you need to do is to multiply 60s with 35mu.... aaaaaand we get 2100 map units. Keep in mind that, as soon as the ceiling piece is out the way, there is a brief moment where our doll still accelerates, so if you want precision down to a fraction of a second, make sure to move the "end" of the timer a few mapunits closer to where the doll starts. Kinda ugly to look at in the editor, and difficult to keep anywhere near the spots where you want the scripted actions to happen, this kind of setup is slightly unwieldy. But there's a better way, if you want a compact setup... A ceiling "height" based timer: Spoiler Did you know that a generalized slow raising ceiling raises at 1 map unit per tic? Sounds familiar... You can easily translate the length of a simple timer into ceiling height. Here are a few tips how you can keep it simple: Put the conveyor in a sector with a ceiling height of 0, and a floor height of -56 (nice and snug, remember?). Now you can adjust your timer by simply entering the desired ceiling height in your map editor, for example -2100 (minus because we raise the ceiling until it reaches an absolute height of 0 and our doll can pass) if you want a minute, and you have yourself a super compact and easy to tune timer. And by the way, this also works exactly the same way in PrBoom+ and GZDoom. Remember when I said I wasn't gonna bother you with screenshots anymore? I lied... I have one more... Spoiler If, after reading this hastily thrown together primer, you still build your looping conveyors like this... ...Then you are an asshole! So there you have it. Easy, compact, reliable... and far from "witchcraft". I hope somebody gets some value out of this. Perhaps I will polish this up a little when I can be arsed, but until then... ...Be sure to like, comment, and subscribe, also SMASH that bell icon, so you never miss out on awesome new content like this in the future OLOLOL :P Edited November 3, 2021 by Nine Inch Heels 31 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.