Button Creation Tutorial

From SRB2 Wiki
Jump to: navigation, search
Warning_icon.png This article has been marked for deletion. If there is any reason that this page should not be deleted, then please discuss the article's status in its Talk page.

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.


Image:Warning_icon.png WARNING! This tutorial assumes that you have some basic knowledge of map editors, which means you know the difference between linedefs, sectors, and Things.

Contents

Basic Button

Falling Door

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. Now let's set the floor height to 32.
3. Now let's make our door. 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 Sectors Node and click on the button sector.
6. Change the sector effect to 80 - Trigger Linedef Executor - Floor Touch - One Player and set its tag number to 1.
7. Now make a control sector (a sector outside the level) and give it a floor height of 0.
8. Set one of its linedefs to action 302 - 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 403 - Linedef Executor: Move Tagged Sector's 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 403 - Linedef Executor: Move Tagged Sector's Floor.

Now let's 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.

Rising Door

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 100 - FOF: Solid, Opaque, 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 302 - Trigger Linedef Executor: Once.
25. Select another linedef from the same sector and set the tag to 3 and linedef action to action 403 - Linedef Executor: Move Tagged Sector's Floor.

Now the level should look something 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. Let's use the level we made for the basic button.

1. Set the button sector's floor height to 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 linedefs in the control sector to be tagged to the button's sector (tag 1).
5. Now go into sector mode and change the FOF action to 80 - Trigger Linedef Exec: Floor Touch.
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 403 - Linedef Executor: Move Tagged Sector's Floor to 403 - Linedef Executor: Move Tagged Sector's Ceiling.
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.

Making a Surrounding Platform

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 image:Button_Tutorial_5.png
14. Set the outside square to 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 100 - FOF: Solid, Opaque, Shadowcasting.
17. Set another linedef have a tag 5 and action 100 - FOF: Solid, Opaque, Shadowcasting.

Now test again and you will see a platform with the button in the air.

Pop-Up Button

This part of the tutorial will teach you how to make a button that does different things depending on the times you pressed it. This may be useful for a single button that opens and closes door. This part of the tutorial is more advanced then the other parts, so take caution. Let's 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 201 - FOF: Intangible, Translucent (this is to let you know if it falls down too fast or slow).
3. Go into sector mode and give this an unused tag (tag 6) and sector special 64 - Trigger Linedef Exec: Floor Touch.
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 302 - Trigger Linedef Executor: Once.
7. Now set the long linedef tag to the translucent one (tag 6) and action 403 - Linedef Executor: Move Tagged Sector's 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 302 - Trigger Linedef Executor: Once.
11. Now set one of its linedefs tag to an unused tag (tag 7) and action to 403 - Linedef Executor: Move Tagged Sector's Ceiling.
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 100 - FOF: Solid, Opaque, Shadowcasting.
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 302 - Trigger Linedef Executor: Once.
18. Set an unused linedef's tag to the translucent sector (tag 6) and set the action to 400 - Linedef Executor: Set Tagged Sector's Floor Height 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 64 - Trigger Linedef Exec: Floor Touch and give it 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 201 - FOF: Intangible, Translucent.
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 403 - Linedef Executor: Move Tagged Sector's Floor.
25. Set the short linedef tag to the FOF button (tag 4) and action to 302 - 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 302 - Trigger Linedef Executor: Once.
28. Copy this sector.
29. Change the tag of the linedef that has action 400 - Linedef Executor: Set Tagged Sector's Floor Height 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 302 - Trigger Linedef Executor: Once 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 example wad below to see how it works.

Example WAD: Popup1.wad

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 80 - Trigger Linedef Exec: Floor Touch.
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 302 - Trigger Linedef Executor: Once.
35. Set another linedef to tag 3 and the linedef action to action 403 - Linedef Executor: Move Tagged Sector's 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 302 - Trigger Linedef Executor: Once.
38. Set another linedef to tag 7 and the linedef action to action 404 Linedef Executor: Move tagged sector's ceiling.

Now let's 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 tags that were 4 to 7 (the trigger linedefs).
41. Change the tag of one with the shorter linedef to new unused (tag 9).
42. Change the tag of one with the longer linedef 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 64 - Trigger Linedef Exec: Floor Touch.
43. Have one of the control sectors linedef tag 1 and linedef action 201 - FOF: Intangible, Translucent.
44. Set the sector tag of that one to tag 9.
43. Have one of the control sectors linedef tag 5 and linedef action 201 - FOF: Intangible, Translucent.
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 302 - Trigger Linedef Executor: Once.
47. Set another of the linedefs to tag 10 and action 302 - Trigger Linedef Executor: Once.
48. Set another of the linedefs to tag 9 and action 400 - Linedef Executor: Set Tagged Sector's Floor Height 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 302 - Trigger Linedef Executor: Once.
51. Set another of the linedefs to tag 10 and action 302 - Trigger Linedef Executor: Once.
52. Set another of the linedefs to tag 10 and action 400 - Linedef Executor: Set Tagged Sector's Floor Height and Pic.
53. Make a control sector with ceiling height 88. 54. Set one of the linedefs to tag 9 and action 302 - Trigger Linedef Executor: Once.
55. Set another of the linedefs to tag 10 and action 302 - Trigger Linedef Executor: Once.
56. Set another of the linedefs to tag 4 and action 403 - Linedef Executor: Move Tagged Sector's Ceiling.

Now let's 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 302 - Trigger Linedef Executor: Once to action 301 - Trigger Linedef Executor: Each Time.

Let's 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 301 - Trigger Linedef Executor: Each Time changed to 300 - Trigger Linedef Executor: Continuous.
59. Do the same for the sectors created in steps 16, 19, and 8.

Let's 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 example wad below to see how it works.

Example WAD: Popup2.wad
Personal tools