Button Creation Tutorial
From SRB2 Wiki
If you want to use buttons to make secret passages appear, open doors, or something else, you can use linedef executors to do that. Keep in mind that you should keep button gimmicks to a minimum; button searching to complete a level is not a good gimmick.
| | WARNING! This tutorial assumes that you have some basic knowledge of map editors, which means you know the difference between linedefs, sectors, and Things. |
Basic Button
1. Start by making a small rectangular level with a floor height of 0 and ceiling height of 1600.
2. Make a 64 × 64 sector inside the level. This will be our button, lets set the floor height to 32.
3. Now lets make our door, it should be height of the level make the floor height to be 512.
4. Go into things mode and put your Player 1 Start near the button.
The level should look something like this.
5. Go into sector mode and click on the button sector.
6. Change the sector effect to 975 Trigger Linedef Executor (Touch Sector Floor) and set its tag number to 1.
7. Now make a control sector (a sector outside the level).
8. Set one of its linedefs to action 98 Trigger linedef Executor Once, and set its tag to 1.
9. Now use a different linedef in the same control sector and have its length to be 64 and set the linedef tag to 1.
10. Set the action to 106 move sector floor and its length to 64 in any direction (length determines speed).
Now the level should look something like this
Test it out. If you did everything right, the button should push down but nothing happens to the wall. We will fix that now.
11. In sector mode, select the wall sector and give it a tag of 2.
12. In linedef mode, select one of the unused linedefs in the control sector and give it a length of 64.
13. Set this linedef tag to 2.
14. Set the linedef action to 106.
Now lets test again. If done correctly it should lower the wall when you press the button. If you want to change the speed of the wall just change how long the linedef that is tagged to it, just be careful if you have other linedef executors that use the length of the linedef for something.
Now if you want the door to rise instead of fall down we are going to need to modify the level a bit.
15. Go to sector mode and select the wall sector.
16. Change the floor height to 0.
17. Make a new control sector. This control sector will make the wall a floor over floor.
18. Set the floor height to be 0 and the ceiling height to be 512.
19. Give the sector the next unused tag (should be 3).
20. Set one of the linedefs in this control sector tagged to the wall sector (should be 2) and give it action 25 shadowcasting.
21. Find the other control sector and find the linedef that was tagged to the wall (tag 2).
22. Now change the tag and action to 0.
23. Now make a new control sector with floor and ceiling height of 512.
24. Select one of its linedefs to be tagged to the button (tag 1) and set the action set to action 98 Trigger linedef Executor Once.
25. Select another linedef from the same sector and set the tag to 3 and linedef action to action 106 Move Sector Floor.
Now the level should look something like like this.
If done correctly the door should raise up. If you fly up as tails you can see a little platform, if you want to avoid that, you can either make the ceiling of the FOF higher, or make a FOF on top of it.
Floor over Floor button
Making a FOF button is very similar to making a basic one. Lets use the level we made for the basic button.
1. Set the button sector have a floor height of 0 and set the sector action to 0.
2. Make a new control sector.
3. Set the control sector's floor height to be 56 and have its ceiling height to be 88.
4. Set one of the linedef's tag of this sector to the button's sector (tag 1).
5. Now go into sector mode and change the FOF action to 975.
6. Change the tag to next unused tag (tag 4).
7. Find the control sector that changed the height of the button (should have both linedef tags set to 1).
8. Change the both the linedef tags in the sector to 4.
9. Now change the linedef with the action with 106 to 107.
10. Go into sector mode and change the ceiling height to 56.
11. Find to the control sector that changes the wall (should have one linedef tag set to 3 and the other to 1).
12. Change the linedef tag that is set to 1 to 4. Now the level should look something like this.
Now test it out, it should work, but you might want a platform to make the button look like its not just floating in midair.
13. Make a square around the button. It should look like this → 
14. Set the outside square have the next unused tag (tag 5).
15. Make a new control sector have a floor height of 48 and a ceiling height of 64.
16. Set one of its linedefs to tag 1 and action 25 shadowcasting.
17. Set another linedef have a tag 5 and action 25.
Now test again and you will see a platform with the button in the air.
Pop up button
So you want to make buttons pop up like SRB1 Remake? Lets continue from the Floor over Floor button example.
1. Make a new control sector with a floor height of 1000 and a ceiling height of 1000.
2. Set one of its linedefs to tag to the buttons sector (tag 1) and give it action 52 (Translucent, Intangible.) (this is to let you know if it falls down too fast or slow.)
3. Go into sector mode and give this a unused tag (tag 6) and sector special 974 Trigger Linedef Executor (Anywhere in sector).
4. Make a new control sector but this time have one of its linedefs to be long (512 should be enough).
5. Set its floor height to be 144.
6. Set the short linedef tag to the FOF button (tag 4) and action to 98 Trigger Linedef Executor Once.
7. Now set the long linedef tag to the translucent one (tag 6) and action 106 Move Sector Floor.
Now test this out. After you hit the button the wall should go up still and a sector should fall down over your head but it doesn't make the button pop up.
8. Make a new control sector.
9. Set the ceiling height to be 88.
10. Have one of its linedefs tagged to translucent sector (tag 6) and set the action to 98.
11. Now set have one of its linedefs tag to an unused tag (tag 7) and action to 107.
12. Now make a new control sector. This will be the second button which is hidden under the first one.
13. Set the floor height and ceiling height to 56 and set tag to the one that was previously unused (tag 7).
14. Now set one of its unused linedefs to the tag used for the button (tag 1) and action 25.
15. Make yet another control sector.
16. Set its ceiling height and floor height 1000.
17. Set one of its linedefs to be tagged to translucent sector (tag 6) and set the action to 98.
18. Set an unused linedef's tag to the translucent sector (tag 6) and set the action to 101 Set Floor Y and pic.
Now test it. If done right when you hit the translucent sector you should get a button to pop up and the translucent sector will be gone. What if we want to make the button pop up when you just walk off?
19. We need a new control sector with floor and ceiling height of 1000.
20. Set the sector special to 974 Trigger Linedef Executor (Anywhere in sector) and give it a the next unused tag (tag 8).
21. Set a linedef to tag the square that is outside the button (tag 5) and give it action 52 Translucent, intangible.
22. Make a control sector with a long linedef (640 should be enough).
23. Set the sector floor height to be 64.
24. Tag the long linedef to the new translucent sector (tag 8) and give it action 106 Move Sector Floor.
25. Set the short linedef tag to the FOF button (tag 4) and action to 98 Trigger Linedef Executor Once.
26. Find the sector that made the first translucent sector rise up (from step 15).
27. Set one of its unused linedefs tag other translucent one (tag 8) and set its action to 98 Trigger Linedef Executor once.
28. Copy this sector.
29. Change the tag of the linedef that has action 101 change Floor Y and pic to the tag of the new translucent sector (tag 8).
30. Find the control sector that made the button pop up (from step 8).
31. Set one of its unused linedefs to action 98 and tag it to the new translucent sector (tag 8).
Now go ahead and test it. If all is good, it should pop up when you step off it and the button and both translucent sectors go up. Jump up and the same thing happens. If you want to see a wad of how this is done, you can look at Popup1.wad to see how it works.
If you want the button to pop up and down continually, then we are going to have to change some of the properties of existing sectors. We are going to make the button that pops up lower the ceiling of the wall back to 0.
32. Go to the sector that was made in step 13 (it has tag 7) and change the sector effect to 975 Trigger Linedef Executor (Touch Sector Floor).
33. Make a new control sector with floor and ceiling height of 0.
34. Set one of its linedefs to tag 7 and set the action set to action 98 Trigger linedef Executor Once.
35. Set another linedef to tag 3 and the linedef action to action 106 Move Sector Floor.
36. Make another control sector with ceiling height of 54.
37. Set one of its linedefs to tag 7 and set the action set to action 98 Trigger linedef Executor Once.
38. Set another linedef to tag 7 and the linedef action to action 106 Move Sector Ceiling.
Now lets test it. When you jump on the button a second time, the ceiling of the wall should go down. But we want it to pop up again.
39. Copy the large control sectors made in step 4 and 22.
40. Change the the tags that were 4 to 7 (the trigger lindefs).
41. Change the tag of one with the shorter lindef to new unused (tag 9).
42. Change the tag of one with the longer lindef to new unused (tag 10).
41. Make two control sectors with floor and ceiling height of 1000.
42. Make both of them have sector type 974 Trigger Linedef Executor (Anywhere in sector).
43. Have one of the control sectors linedef tag 1 and lindef action 52 Translucent, intangible.
44. Set the sector tag of that one to tag 9.
43. Have one of the control sectors linedef tag 5 and lindef action 52 Translucent, intangible.
44. Set the sector tag of that one to tag 10.
45. Make a control sector with floor and ceiling heights of 1000.
46. Set one of the linedefs to tag 9 and action 98 Trigger linedef Executor Once.
47. Set another of the linedefs to tag 10 and action 98 Trigger linedef Executor Once.
48. Set another of the linedefs to tag 9 and action 101 Set Floor Y and pic.
49. Make a control sector with floor and ceiling heights of 1000.
50. Set one of the linedefs to tag 9 and action 98 Trigger linedef Executor Once.
51. Set another of the linedefs to tag 10 and action 98 Trigger linedef Executor Once.
52. Set another of the linedefs to tag 10 and action 101 Set Floor Y and pic.
53. Make a control sector with ceiling height 88.
54. Set one of the linedefs to tag 9 and action 98 Trigger linedef Executor Once.
55. Set another of the linedefs to tag 10 and action 98 Trigger linedef Executor Once.
56. Set another of the linedefs to tag 4 and action 107.
Now lets test this out. If you did everything correctly, the button should be able to pop up 3 times. We want it to loop, so we have one more step to take.
57. Make each one of the linedefs that was action 98 to action 97.
Lets test it out again. Pushing the button down seems to work fine, but its a bit hard to make it pop up again. So we have to change something.
58. Have the three most recent sectors have action 97 changed to 96.
59. Do the same for the sectors created in steps 16, 19, and 8.
Lets try this again, now it pops up and down any amount of times you want to press it. If you are satisfied with the speed of the translucent sectors, you can change then all to transparent. If you want to see a wad of how this is done, you can look at Popup2.wad to see how it works.





