
=============================================================================

  ====================     R3D Lifts October 2015     ====================

=============================================================================


 This test file explains how to create 3D lifts and refers to the:

   \Risen3D\R3DTEST\Gwads\3D_Lifts_Check.wad

 to aid explanation. The wad has six lifts of different types.

 This should only be read if you have an understanding of 3D lines and
 flats which are described in R3D_Structures.txt.

 Each lift uses one sector to control its height.

 This sector should be outside of the map and, in the case of the six in
 the wad, all of them are.

 Only elevator type lifts can be used triggered by line specials 227 to 234
 (but not 235 to 238 which are specifically excluded). Any deviation will
 cause an error report to be generated to help with map development.

 All lifts have a common requirement - they must be inside a containing
 sector which is static (i.e. does not itself move). This is to aid R3D
 in determining how to adjust the nodes build which, if given a moment's
 thought where you understand such matters, you may appreciate is some-
 what complicated. No understanding is actually required as the code
 sorts all of this out. But rigorous design is required - the code is
 not too forgiving if mistakes are made.

 All sectors forming a lift must have the same floor and ceiling heights
 and floor and ceiling pics that are used in constructing the lift. All
 the lift's lines must be 3D line types.

 In the following examples the sector(s) that form the 3D lift are
 called the lift sector(s), the sector that rises or falls when
 triggered is called the move sector and the sector that bounds the
 lift sector(s) is called the containing sector.

 In all six examples the sectors used to control the lift or define
 3D flats are shown due East (or to the right) of the lift. These are
 never drawn so are outside the playable map area.

 Lifts are numbered one to six starting with lift one at the top (when
 viewed in a map editor) down to lift six at the bottom.

 3D standard lines are referred to as 3DS and 3D flats lines as 3DF


 The command line switch -l3drep can also aid in developing 3D lifts
 as this prints out the move sector followed by all the sectors
 forming the lift. There is also fairly extensive error checking when
 a 3D lift is loaded which, should any be found, prints errors out to
 R3Ddebug.out in the Risen3D folder.


 LIFT ONE ===================================================================

 This example uses 3D standard lines and no 3D flat lines.

 -----------------------------------------------
 Type         Sectors     |  Line types
 -----------------------------------------------
                          |  in map   control
 -----------------------------------------------
 Containing    1          |  Normal    
 Lift          2          |  3DS       Normal
 Move          3          |            Normal
 -----------------------------------------------
 Connecting line 30
 -----------------------------------------------
 Height reference sectors  5, 6
 -----------------------------------------------
 Lift floor height reference sector (none)
 -----------------------------------------------
 3D flat texture sector (none)
 -----------------------------------------------
 Trigger lines  37, 39
 -----------------------------------------------


 The lift itself is comprised of 3DS lines (with 3 exceptions discussed
 below) all in S2. The containing sector (mentioned in the introduction
 above) is S1.
 
 Where a 3DS line lift is required then none of its lines are in the same
 sector as the move sector (nor can be). For this reason the method of
 linking is to use 3 lift sector lines adjacent to the move sector in
 this case L30, L40 and L41. These are and must be normal lines. It does
 not have to be 3 lines but 3 is the minimum required if the map is
 designed properly with no 2's lines having a sector staring into no-man's
 land.

 These three lines form a triangle on top of the move sector making it
 easier to follow when looking at the map.

 In this case the lines bounding the lift sector, S 3,are 30, 31, 32,
 33 and 42. The lines of interest are 30, 32 and 42.

 In order for the lift to work the line connecting the move sector to
 the 3D lift (L30 in this example) must have its backsector as the move
 sector. Lines 42 and 33 reference S5 and S6 and these sectors define
 the limit of movement which is set by their floorheights. So, in this
 case, the lift will go from a height of 0 to 256. The common lines
 connecting these sectors to the move sector must have their front-
 sector as the move sector.


 LIFT TWO ===============================================================

 This example uses 3D flats lines and no 3D standard lines.

 -----------------------------------------------
 Type         Sectors     |  Line types
 -----------------------------------------------
                          |  in map   control
 -----------------------------------------------
 Containing    9          |  Normal
 Lift          8, 10      |  3DF       Normal
 Move          8          |  3DF       Normal
 -----------------------------------------------
 Connecting line (none)
 -----------------------------------------------
 Height reference sectors  12, 13
 -----------------------------------------------
 Lift floorheight reference sector (none)
 -----------------------------------------------
 3D flat texture sector  11
 -----------------------------------------------
 Trigger lines  45, 47
 -----------------------------------------------

 Apart from the move sector's control lines the lift is built from 3DF
 lines. They take the same form as static 3D flat constructions; that
 is that the outer and inner sectors owned by a closed loop of 3DF
 lines are different. The lines themselves all share the same two sectors.

 Where making it a lift then all the 3DF lines' frontsectors use the same
 sector as the move sector. Note also that lines 58 and 69 which belong
 to the height reference sectors have the move sector 8 in their front-
 sectors. This must be the case else the lift will not function.

 There is an additional feature set with the containing and lift sectors
 S9 and S10. Their floors are set to a light level of 250. This has been
 done by setting S13's light level to 250 (which otherwise could be any
 thing as is never rendered) and then linking this using L67 and L68 to
 S9 and S10 using tags 12 and 3 with special 213 (set tagged sector's
 floor light level).
 

 LIFT THREE =============================================================

 This example uses 3D flats lines and no 3D standard lines.

 -----------------------------------------------
 Type         Sectors     |  Line types
 -----------------------------------------------
                          |  in map   control
 -----------------------------------------------
 Containing   44          |  Normal
 Lift         40, 45      |  3DF       Normal
 Move         40          |  3DF       Normal
 -----------------------------------------------
 Connecting line 249
 -----------------------------------------------
 Height reference sectors  41, 42
 -----------------------------------------------
 Lift floor height reference sector 47
 -----------------------------------------------
 3D flat texture sector  43
 -----------------------------------------------
 Trigger lines  260, 262
 -----------------------------------------------

 This lift is similar to lift two except that it does not have to lower
 to sector 45's floor height. The code, however, needs to know the low
 floor height of S45 and rather than scanning the 3DF lines it looks for
 a connected sector adjacent to S40 (the move sector). In this case it
 is S47. It is distinguished from the height reference sectors by having
 its line reversed. I.e. the move sector is in the L249's backsector. If
 this were not the case then the lift, when triggered down, would go
 from height 64 to 0.

 The floorheight of S47 must match that of S45 else the code will exit
 with an error report when the map is run.


 LIFT FOUR ==============================================================

 This example uses 3D flats lines and no 3D standard lines.

 -----------------------------------------------
 Type         Sectors     |  Line types
 -----------------------------------------------
                          |  in map   control
 -----------------------------------------------
 Containing   18          |  Normal
 Lift         14, 19, 21  |  3DF       Normal
 Move         14          |  3DF       Normal
 -----------------------------------------------
 Connecting line (none)
 -----------------------------------------------
 Height reference sectors  15, 16, 23
 -----------------------------------------------
 Lift floor height reference sector (none)
 -----------------------------------------------
 3D flat texture sectors  17, 22
 -----------------------------------------------
 Trigger lines  98, 100
 -----------------------------------------------

 This lift is similar to lift two except that it has three height
 settings and a compound 3D floor structure. To make compound
 structures then refer to R3D_Structures.txt in R3D_Docs\Editing and
 the example wad Nesting3DfloorsExample.wad together with the text
 file Nesting3DfloorsExample.txt both in R3DGames\R3DTEST\Gwads\


 LIFT FIVE ==============================================================

 This example uses 3D flats lines and 3D standard lines.

 -----------------------------------------------
 Type         Sectors     |  Line types
 -----------------------------------------------
                          |  in map   control
 -----------------------------------------------
 Containing   24          |  Normal
 Lift         26, 25      |  3DF/3DS   Normal
 Move         26          |  3DF       Normal
 -----------------------------------------------
 Connecting line (none)
 -----------------------------------------------
 Height reference sectors  27, 28, 29
 -----------------------------------------------
 Lift floor height reference sector (none)
 -----------------------------------------------
 3D flat texture sector  30
 -----------------------------------------------
 Trigger lines  184, 194, 195
 -----------------------------------------------

 This lift is similar to lift four other than it has a different
 compound structure and is triggered by a zombie in scroll floor
 sectors. It also uses both 3DF and 3DS lines where the 3DS front
 and back sectors are not the move sector. They will inherit the
 lift sector's height as it moves.

 This simple looking lift is more complex than one would think at
 first glance. The triggering is time dependant so appears some-
 what odd given there are only three trigger lines. This was to
 allow a delay when the trooper under the lift is crunched. The
 columns don't follow the normal plugin spec which was done to
 test the code. They should really follow the spec but it still
 works nonetheless.


 LIFT SIX ===============================================================

 This example uses 3D standard lines and no 3D flat lines.

 -----------------------------------------------
 Type         Sectors     |  Line types
 -----------------------------------------------
                          |  in map   control
 -----------------------------------------------
 Containing   39          |  Normal
 Lift         37          |  3DS       Normal
 Move         36          |            Normal
 -----------------------------------------------
 Connecting line 210
 -----------------------------------------------
 Height reference sectors  34, 35
 -----------------------------------------------
 Lift floor height reference sector (none)
 -----------------------------------------------
 3D flat texture sector  (none)
 -----------------------------------------------
 Trigger lines  201, 203
 -----------------------------------------------

 This lift is a variation on lift one in that it does not go down to
 the containing sector's floor height. Unlike 3DF lifts it does not
 need a reference sector to check the low floor height because this
 is already deducible from S37 itself (which, given it is connected
 by a reversed line to S36 means it is code compatible). In all the
 lifts monsters are blocked by having their lines flagged block enemy.
 As such the Baron of Hell can stray beyond the lift and when being
 crushed can escape. This shows that escape is possible as is usually
 the case with lifts in general (assuming the crushee does so before
 losing too much health).


=============================================================================

 Addendum.

 None of the examples above use a 3DS line lift with an embedded flats
 structure although such an animal lives in a wad in the R3DTEST\Gwads
 folder named R3Ddemo184_06.wad. This lift was so complex that no-one
 seemed to understand it plus, prior to the release of v220-31, it did
 not work properly with monsters especially the skulls. So why would
 anyone want to bother to freak their brain out with something that
 did not work? It does now, however.

 If you want to have a go yourself then in this demo lift there is a
 moving 3D floor flats pair with a static 3D flats pair above (the lower
 pair being in the centre of the 3DS line lift and the upper filling the
 hole made in the box upon which the megahealth sphere sits). As such it
 follows the plugin spec but is unusual (given 3D lifts are rare) in
 having both a moving and static flats stack.

 Stats for the lift in R3Ddemo184_06.wad (modified 15 November 2015,
 14:00:30) are as follows;

 This example uses 3D standard lines and 3D flat lines.

 -----------------------------------------------
 Type         Sectors        |  Line types
 -----------------------------------------------
                             |  in map   control
 -----------------------------------------------
 Containing  187             |  Normal
 Lift         36 37 39 52 55 |  3DF/3DS   Normal
 Move         40             |            Normal
 -----------------------------------------------
 Connecting line 1225
 -----------------------------------------------
 Height reference sectors  41, 42, 210
 -----------------------------------------------
 Lift floor height reference sector (none)
 -----------------------------------------------
 3D flat texture sector  29, 44
 -----------------------------------------------
 Trigger lines  201, 203
 -----------------------------------------------


g. jackson November 2015
