Multi-property FOF

From SRB2 Wiki
Jump to navigation Jump to search
A multi-property FOF where each side has a different texture and scrolls at a different speed.

Multi-property FOFs are FOFs that allow each side to have its own properties, such as textures, effects and flags. They can be created by checking the Transfer Line flag on the control linedef for the FOF. For example, this allows for creating FOFs with different textures on each sides, applying different effects to each side (e.g., making one side scroll and the others stand still), or for making some sides climbable and some not. Note that this feature is slightly unstable, since it depends on the order of the linedefs in the control and target sector. It is advisable to construct both the control sector and the target sector(s) in one step and not change their geometry afterwards (for example by deleting or removing linedefs), to prevent the linedef order from being changed. Otherwise, the properties may not be initialized correctly, leading to missing or falsely applied textures.

FOF setup

Set up a regular FOF target sector (for instance, linedef type 100) like you would do normally. At first, you should start with a simple square FOF to practice this technique. To make sure the effect works correctly, give the control sector the same shape as the target sector – if the control sector and the target sector are too different, the target sector might exhibit unwanted effects such as missing or falsely applied textures. Some differences are unproblematic, such as different linedef lengths or angles, but you should generally make sure that the linedef numbers of the linedefs in each sector form a consecutive range, i.e., when going through the linedefs of the sector in clockwise or counterclockwise fashion, the linedef numbers should always increase by one from one linedef to the next, without skipping a number or mixing up the order. To ensure this, you should create both the control sector and the target sector in one step and not modify their shape afterwards.

To make the game handle each side of the FOF differently, check the Transfer Line flag on the FOF control linedef, where you would normally specify the texture for all sides at once. After doing this, you can give each of the control sector's linedefs a different front middle texture. The textures will show up in the target sector in the same order as they do in the control sector. This means that a linedef facing north will get its texture from the linedef in the control sector that's facing north as well.

Different effects

As an example of how special effects can be applied to multi-property FOFs, this tutorial will show you how to scroll every side of the FOF independently. Linedef type 505 is used for the scrolling effect. In addition to separate linedef specials, you can also give each linedef separate flags and texture offsets when the Transfer Line flag is checked.

First of all, give every unused linedef in the control sector linedef type 505. This will make them scroll according to their front side texture offsets. The offsets determine how fast the texture is scrolled. Positive values scroll the texture upwards/right, while negative values scroll them downwards/left. For this tutorial, you may want to use a different value for each linedef, to show how the effect works.

After you have applied a scrolling effect to every linedef, you will notice that you can't scroll the control linedef, because it already uses its linedef special to create the FOF. If you want this linedef to scroll as well, split it in the middle. The first one (counting clockwise) should now be used for scrolling, and the other one for FOF creation.

Samples

Sample 1

Example file: Sample-multitexturedfof.wad (MAP01) 
  • This example WAD shows a simple square FOF with multiple textures.
How to use
  • You may load this file into your favorite map editor, such as Zone Builder. Select MAP01 as the map to load.
  • You may also load this file in the game:
    1. Save Sample-multitexturedfof.wad into the addons folder of your SRB2 directory.
    2. Start SRB2, go to the Addons menu, and then select Sample-multitexturedfof.wad.
    3. Start the game in Single Player mode.
    4. Press the Console button (~), and type in the command MAP MAP01 to access the example map.
  • When you load this file in the game, it replaces Greenflower Zone Act 1.

Sample 2

Example file: Sample-multitexturedfof-scrolling.wad (MAP01) 
  • This example WAD shows an octagonal FOF with multiple textures.
  • All textures of this FOF scroll at different speeds.
How to use
  • You may load this file into your favorite map editor, such as Zone Builder. Select MAP01 as the map to load.
  • You may also load this file in the game:
    1. Save Sample-multitexturedfof-scrolling.wad into the addons folder of your SRB2 directory.
    2. Start SRB2, go to the Addons menu, and then select Sample-multitexturedfof-scrolling.wad.
    3. Start the game in Single Player mode.
    4. Press the Console button (~), and type in the command MAP MAP01 to access the example map.
  • When you load this file in the game, it replaces Greenflower Zone Act 1.