Editing Polyobject

From Eternity Wiki
Jump to navigationJump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
PolyObjects are special sets of one-sided linedefs which, unlike any other lines, can be moved on the map during gameplay. Unlike the Hexen implementation of PolyObjects, Eternity does not restrict these objects to one per subsector, and they are also allowed to move any distance from their spawn point, even across subsector boundaries.  
PolyObjects are special sets of one-sided linedefs which, unlike any other lines, can be moved on the map during gameplay. Unlike the Hexen and ZDoom implementation of PolyObjects, Eternity does not restrict these objects to one per subsector, and they are also allowed to move any distance from their spawn point, even across subsector boundaries.  


PolyObjects fully clip normal objects such as the player and enemies, optionally doing crushing damage depending upon the type of spawn spot used. They also block bullet tracers and monsters' lines of sight. They do not, however, clip sound propagation, so it may be necessary to use sound blocking lines near areas where PolyObjects are meant to function as a normal wall until they move.  
PolyObjects fully clip normal objects such as the player and enemies, optionally doing crushing damage depending upon the type of spawn spot used. They also block bullet tracers and monsters' lines of sight. They do not, however, clip sound propagation, so it may be necessary to use sound blocking lines near areas where PolyObjects are meant to function as a normal wall until they move.  
Line 5: Line 5:
Although Eternity does allow PolyObjects to move between different subsectors, this will only work properly if the subsectors on both sides of a line have the same properties (floor & ceiling heights, light level, and flat). However, since the implementation of [[dynaseg]]s, Eternity does not require a "PolyObject-aware" node builder.  
Although Eternity does allow PolyObjects to move between different subsectors, this will only work properly if the subsectors on both sides of a line have the same properties (floor & ceiling heights, light level, and flat). However, since the implementation of [[dynaseg]]s, Eternity does not require a "PolyObject-aware" node builder.  


Finally, Eternity allows PolyObjects to be used in DOOM-format maps via the use of [[ExtraData]]. See the subsections below for more information on how to create and move PolyObjects.  
Finally, unlike ZDoom, Eternity allows PolyObjects to be used in DOOM-format maps via the use of [[ExtraData]]. See the subsections below for more information on how to create and move PolyObjects.  
 
'''NOTE:''' Polyobjects must be convex, to be rendered properly.
 
{{Backto|Linedef types}}
{{Backto|Linedef types}}


Line 15: Line 12:
PolyObjects are a combination of a set of 1S lines, which are typically placed in a "control sector" area outside of the main map, and exactly two mapthings: one spawn spot, and one anchor point. There are two different methods for grouping lines into a PolyObject.  
PolyObjects are a combination of a set of 1S lines, which are typically placed in a "control sector" area outside of the main map, and exactly two mapthings: one spawn spot, and one anchor point. There are two different methods for grouping lines into a PolyObject.  


==='''Method 1: The <code>Polyobj_StartLine</code> Special'''===
*'''Method 1: The ''Polyobj_StartLine'' Special'''


:The <code>348:Polyobj_StartLine('''polyobj_id''', '''mirror_id''')</code> special marks the first line in a PolyObject which is made up of a cyclic set of linedefs (that is, each line "points toward" the next line, ending at the first vertex of the first line).  
:The Polyobj_StartLine special marks the first line in a PolyObject which is made up of a cyclic set of linedefs (that is, each line "points toward" the next line, ending at the first vertex of the first line).  


:Diagrammatic Example:  
:Diagrammatic Example:  
:[[File:Polyobjects_basic.png]]
:[[File:Polyobjects_basic.png]]
:Assume that the linedef '''A''' is assigned the <code>Polyobj_StartLine</code> special and has argument #1 set to "1" -- this is its '''PolyObject ID number''', which must be unique amongst all on the map, and must be a number greater than zero.  
:Assume that the linedef A is assigned the Polyobj_StartLine special and has argument #1 set to "1" -- this is its PolyObject ID number, which must be unique amongst all on the map, and must be a number greater than zero.  


:Starting from line '''A''', the engine will go from vertex to vertex, adding the first line found which shares the current line's second vertex as its first vertex. In this example, since the object is closed as is required, the process will end at the first vertex of line '''A''', and there will be four lines in the PolyObject (note that unlike Hexen, there is NO limit to the number of lines that can be placed in one PolyObject).  
:Starting from line A, the engine will go from vertex to vertex, adding the first line found which shares the current line's second vertex as its first vertex. In this example, since the object is closed as is required, the process will end at the first vertex of line A, and there will be four lines in the PolyObject (note that unlike Hexen, there is NO limit to the number of lines that can be placed in one PolyObject).  


:Now, once the lines are added, it is necessary to define the control objects. Points '''B''' and '''C''' are the two required objects:  
:Now, once the lines are added, it is necessary to define the control objects. Points B and C are the two required objects:  
:* '''B''': This is the PolyObject's anchor point (type EEPolyObjAnchor with DoomEd #9300). It defines the point relative to which all the lines in the PolyObject will be translated to the spawn point. This object's angle must be set to the same value as the StartLine's first argument (the '''PolyObject ID'''). There must be one and only one of these objects for each '''PolyObject ID'''.  
:* B: This is the PolyObject's anchor point (type EEPolyObjAnchor with DoomEd #9300). It defines the point relative to which all the lines in the PolyObject will be translated to the spawn point. This object's angle must be set to the same value as the StartLine's first argument (the PolyObject ID). There must be one and only one of these objects for each PolyObject ID.  
:* '''C''': This is the PolyObject's spawn point (one of EEPolyObjSpawnSpot [9301] or EEPolyObjSpawnSpotCrush [9302]). It defines the point where the PolyObject will initially spawn on the map. The anchor point will be translated to this exact location, and all lines in the PolyObject will maintain their relative positions to it. This object must also have its angle field set to the same value as both the StartLine's first argument and the anchor point's angle field. There must be one and only one of these objects for each PolyObject ID. Use 9302 to cause the PolyObject to do crushing damage to things that block it while it is in motion.  
:* C: This is the PolyObject's spawn point (one of EEPolyObjSpawnSpot [9301] or EEPolyObjSpawnSpotCrush [9302]). It defines the point where the PolyObject will initially spawn on the map. The anchor point will be translated to this exact location, and all lines in the PolyObject will maintain their relative positions to it. This object must also have its angle field set to the same value as both the StartLine's first argument and the anchor point's angle field. There must be one and only one of these objects for each PolyObject ID. Use 9302 to cause the PolyObject to do crushing damage to things that block it while it is in motion.  


:Note that when you use this method, the other lines belonging to the PolyObject can be given their own line specials, including ones which affect the PolyObject itself. When the player presses the PolyObject, the specials will work as expected.  
:Note that when you use this method, the other lines belonging to the PolyObject can be given their own line specials, including ones which affect the PolyObject itself. When the player presses the PolyObject, the specials will work as expected.  


:The complete arguments to <code>Polyobj_StartLine('''polyobj_id''', '''mirror_id''')</code> are as follows:  
:The complete arguments to Polyobj_StartLine are as follows:  
:* ''polyobj_id'' : the unique ID number (greater than zero) of the PolyObject  
:* ''polyobj_id'' : the unique ID number (greater than zero) of the PolyObject  
:* ''mirror_id'' : the ID number of a PolyObject that you want to mirror every action that affects this PolyObject. This number cannot be the same as the PolyObject's own ID.  
:* ''mirror_id'' : the ID number of a PolyObject that you want to mirror every action that affects this PolyObject. This number cannot be the same as the PolyObject's own ID.  
Line 37: Line 34:
:In order to use this line special in a DOOM-format map, it is necessary to use [[ExtraData]]. In that case, you must give the line you want to have the Polyobj_StartLine special the ExtraData linedef control special (#270) instead, and then specify Polyobj_StartLine and its arguments in its corresponding ExtraData linedef record.  
:In order to use this line special in a DOOM-format map, it is necessary to use [[ExtraData]]. In that case, you must give the line you want to have the Polyobj_StartLine special the ExtraData linedef control special (#270) instead, and then specify Polyobj_StartLine and its arguments in its corresponding ExtraData linedef record.  


==='''Method 2: The <code>Polyobj_ExplicitLine</code> Special'''===
*'''Method 2: The ''Polyobj_ExplicitLine'' Special '''


:The <code>349:Polyobj_ExplicitLine('''linedef_tag''', '''linedef_tag''', '''mirror_id''')</code> special demarcates every line that will be added to a PolyObject and the exact order in which the lines will be added. This affords a bit more flexibility in the construction of PolyObjects at the price of not allowing any other line specials to be placed on the object itself.  
:The Polyobj_ExplicitLine special demarcates every line that will be added to a PolyObject and the exact order in which the lines will be added. This affords a bit more flexibility in the construction of PolyObjects at the price of not allowing any other line specials to be placed on the object itself.  


:Diagrammatic Example:  
:Diagrammatic Example:  
:[[File:Polyobjects_adv.png]]
:[[File:Polyobjects_adv.png]]
:Assume that the linedefs labeled 1 through 4 are assigned (via [[ExtraData]]) the <code>Polyobj_ExplicitLine</code> special, all have argument '''#1''' set to "1" -- this is its PolyObject ID number (which must be unique amongst all on the map, and must be a number greater than zero), and argument '''#2''' set also to whatever their tag is (in this case again it's ''1'').
:Assume that the linedefs labeled 1 through 4 are assigned the Polyobj_ExplicitLine special, all have argument #1 set to "1" -- this is its PolyObject ID number, which must be unique amongst all on the map, and must be a number greater than zero -- and all have argument #2 set to the integer values 1 through 4, corresponding to their labels in the diagram.  


:The game engine will search through all linedefs in the entire map for ones with the current '''PolyObject ID''' in argument '''#1''' and a value greater than zero in argument '''#2'''. The lines will be collected and then sorted by the '''LineDef id'''.
:The game engine will search through all linedefs in the entire map for ones with the current PolyObject ID in argument #1 and a value greater than zero in argument #2. The lines will be collected and then sorted by the value in their second argument and added to the PolyObject in that order. Note that unlike Hexen, it is not necessary for the numbers in the second argument to be sequential (ie, a sequence such as { 5, 10, 15, 20 } would also work).  


:Now, once the lines are added, it is necessary to define the control objects. This is exactly the same as it is for the <code>StartLine(...)</code> special above.  
:Now, once the lines are added, it is necessary to define the control objects. This is exactly the same as it is for the StartLine special above.  
:* '''B''': This is the PolyObject's anchor point (type EEPolyObjAnchor with DoomEd #9300). It defines the point relative to which all the lines in the PolyObject will be translated to the spawn point. This object's angle must be set to the same value as the <code>ExplicitLines'</code> first argument (the '''PolyObject ID'''). There must be one and only one of these objects for each '''PolyObject ID'''.  
:* B: This is the PolyObject's anchor point (type EEPolyObjAnchor with DoomEd #9300). It defines the point relative to which all the lines in the PolyObject will be translated to the spawn point. This object's angle must be set to the same value as the ExplicitLines' first argument (the PolyObject ID). There must be one and only one of these objects for each PolyObject ID.  
:* '''C''': This is the PolyObject's spawn point (one of EEPolyObjSpawnSpot [9301] or EEPolyObjSpawnSpotCrush [9302]). It defines the point where the PolyObject will initially spawn on the map. The anchor point will be translated to this exact location, and all lines in the PolyObject will maintain their relative positions to it. This object must also have its angle field set to the same value as both the ExplicitLines' first argument and the anchor point's angle field. There must be one and only one of these objects for each '''PolyObject ID'''. Use 9302 to cause the PolyObject to do crushing damage to things that block it while it is in motion.  
:* C: This is the PolyObject's spawn point (one of EEPolyObjSpawnSpot [9301] or EEPolyObjSpawnSpotCrush [9302]). It defines the point where the PolyObject will initially spawn on the map. The anchor point will be translated to this exact location, and all lines in the PolyObject will maintain their relative positions to it. This object must also have its angle field set to the same value as both the ExplicitLines' first argument and the anchor point's angle field. There must be one and only one of these objects for each PolyObject ID. Use 9302 to cause the PolyObject to do crushing damage to things that block it while it is in motion.  


:The complete arguments to <code>Polyobj_ExplicitLine('''linedef_tag''', '''linedef_tag''', '''mirror_id''')</code> are as follows:  
:The complete arguments to Polyobj_ExplicitLine are as follows:  
:* ''polyobj_id'' : the unique ID number (greater than zero) of the PolyObject  
:* ''polyobj_id'' : the unique ID number (greater than zero) of the PolyObject  
:* ''linedef_tag'' : specifies the order in which the line will be added to the PolyObject. This number should be unique amongst all lines to be added to the same object, and must be a value greater than zero.  
:* ''number'' : specifies the order in which the line will be added to the PolyObject. This number should be unique amongst all lines to be added to the same object, and must be a value greater than zero.  
:* ''mirror_id'' : the ID number of a PolyObject that you want to mirror every action that affects this PolyObject. This number cannot be the same as the PolyObject's own ID.  
:* ''mirror_id'' : the ID number of a PolyObject that you want to mirror every action that affects this PolyObject. This number cannot be the same as the PolyObject's own ID.  


:In order to use this line special in a DOOM-format map, it is necessary to use ExtraData. In that case, you can either give the lines you want to have the Polyobj_ExplicitLine special the ExtraData linedef control special (#270) instead, and then specify Polyobj_ExplicitLine and its arguments in all the corresponding ExtraData linedef records; or simply use the line special normally, and specify the ExtraData record number in the linedef's tag, specifying only the arguments inside the ExtraData record.
:In order to use this line special in a DOOM-format map, it is necessary to use ExtraData. In that case, you can either give the lines you want to have the Polyobj_ExplicitLine special the ExtraData linedef control special (#270) instead, and then specify Polyobj_ExplicitLine and its arguments in all the corresponding ExtraData linedef records; or simply use the line special normally, and specify the ExtraData record number in the linedef's tag, specifying only the arguments inside the ExtraData record.


===Note===
====Note====
As of EE 3.37.00, thing type 9303 is available, which is similar to the ZDoom damaging polyobject type.
As of EE 3.37.00, thing type 9303 is available, which is similar to the ZDoom damaging polyobject type.


Line 131: Line 128:


====[https://s3-eu-west-1.amazonaws.com/eternity/polyobjects_adv.wad PolyObject Advanced Demo]====
====[https://s3-eu-west-1.amazonaws.com/eternity/polyobjects_adv.wad PolyObject Advanced Demo]====
A demonstration of rotating and translating PolyObjects made with <code>PolyObj_ExplicitLine()</code> Plays on '''Doom 2''' / '''Map01'''. The map is linked to an [[ExtraData]] lump (via [[EMAPINFO]]). It shows how more advanced PolyObjects can be constructed and moved to fake 3D objects. It also includes PolyObject Doors discussed in the next section of this article.
A demonstration of rotating and translating PolyObjects made with <code>PolyObj_ExplicitLine()</code> Plays on '''Doom 2''' / '''Map01'''. The map is linked to an [[ExtraData]] lump (via [[EMAPINFO]]). It shows how more advanced PolyObjects can be constructed and moved to fake 3D objects.


It is recommended that you play go through  the first Demo in the series and open the Demo WAD in a WAD manager program like '''SLADE3''' or '''XWE''' to read the '''ExtraData''' and '''ACS''' scripts together with provided comments.
It is recommended that you play go through  the first Demo in the series and open the Demo WAD in a WAD manager program like '''SLADE3''' or '''XWE''' to read the '''ExtraData''' and '''ACS''' scripts together with provided comments.
Line 207: Line 204:
}  (...)
}  (...)
</pre>
</pre>
==Polyobjects with portals==
:See [[Linked_portals#Polyobject_portals | Polyobject portals]]


[[category:Editing reference]]
[[category:Editing reference]]
Please note that all contributions to Eternity Wiki are considered to be released under the GNU Free Documentation License 1.2 (see Eternity Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page: