Linedef Executor Tutorial

From SRB2 Wiki

Jump to: navigation, search
This article or section should contain one or more images. Please spruce up the article by adding an image.

Ever wanted to put some really special things in your level? This tutorial will teach you one way to do that.

We're going to make a button that drains the acid out of a pit. So let's create a sector and give it a floor height of -256; this makes the pit. Give the sector the next unused tag; this should be Sector Tag 1. Make a control sector, giving it a ceiling height of 0 and a floor height of -256. Choose a linedef and make it Translucent, No Sides, and give it Linedef Tag 1, so that the acid appears in the pit. Give the control sector Death Pit (No Camera Modifications) and Sector Tag 2. Now create another control sector: this will be used to colormap the acid. Give one of its linedefs Linedef Tag 2. Now, let's set the color value. Make the front upper texture be #008000J, a mild-intensity dark green.

Now, we need to create the button. Create a 16 × 256 sector. Raise the height of the button to 64 fracunits and give it a floor flat of REDFLR. Go into Linedefs Mode and curve the long linedefs outward to make a circle, and make the walls be REDWALL. Now let's tell the game, "Whenever I step on the button, something happens." This is the sector effect Trigger Linedef Executor (Touch sector floor). Now, we need to tag this to a control sector so we can be a little more specific on our instructions. Go give the button the next unused tag, which happens to be Sector Tag 3.

Now make another control sector outside the map. Choose any linedef of it to edit. This is going to have Linedef Tag 3 so that it is triggered by the button. Now give it the linedef effect Trigger Linedef Executor (Trigger Once). This is because this can happen only one time. Your acid pit is not going to magically fill itself back up again, is it? (Well, it can if you so tell the game to, but that's a little more complicated and unnatural.)

You still didn't tell it what to do yet, just the conditions on when to trigger it. Once that tagged linedef is triggered, it will execute all the other linedef executors in that control sector. It needs to do two things. First of all, it needs to have the button be lowered to the ground. Second, it needs to drain the pit.

Button Lower

Choose another linedef in the control sector to edit. Give this linedef an action of Move Sector Floor. The game's doesn't have A.I., so you actually have to specify what to lower. Well, doesn't the button have Sector Tag 3 already? Indeed it does, so give the linedef Linedef Tag 6. You're still not done yet with this step. You have to specify how fast the button moves down. It's actually traditional for the button to be lowered slowly in SRB2. So go into Vertices mode and make the Move Sector Floor linedef have a length of 32 fracunits. And yet, we're still not done with this part.

Where does the button stop moving? We want it to stop moving once it is even with the rest of the map. The rest of the map has floor height 0. So make the control sector have floor height 0. Go test and see if the button works!

Acid Drain

Now we have to give it instructions on draining the acid. So select yet another linedef in the control sector. To attach the instructions to the acid itself and not the acid pit, we tag this to the acid control sector, so give it Linedef Tag 2. Think. What determines the top height of the acid pit? If you guessed "the acid's control sector's ceiling height," then you guessed right! (If you're wondering why this is so, click here to refresh your memory.) So give this a linedef action of Lower Ceiling By Line.

The speed of this linedef is determined by its X distance, whereas the amount to lower is determined by its Y distance. If you don't know what X and Y distance mean, look at the picture below. (I know, I don't have a picture yet, but I will once this becomes a regular article.)

As for which distances work, the same speed units apply as for Move Sector Floor. We also want the acid to drain at the same speed. So go into Vertices Mode and give the linedef an X distance of 32. It will lower from 0 to -256. 0 - (-256) = 256, so give the linedef a Y distance of 256.

Image:Warning_icon.png WAIT! It's not done yet. With the way you set up your linedef executors, you may have just altered the Move Sector Floor's linedef length by accident. If so, go into Vertices Mode and drag the vertex that doesn't connect those linedefs so that this length is 32 again.

And now we're done with that hassle. Whew. Test it out.

Could we have used Move Sector Ceiling? Yes, but it's good practice to do this when we already are using the control sector's heights for something else. Otherwise, you may, in certain scenarios, screw up the other linedef executors' instructions. Alternatively, we actually could have tagged the button to another control sector with linedef executors. It's perfectly acceptable to do so, especially if we want one action to get triggered once and another to get triggered every time.

Personal tools