zscript-doc/api/level/Line.md

179 lines
5.2 KiB
Markdown
Raw Permalink Normal View History

2018-12-29 16:05:19 -08:00
# Line
Also known as a "linedef." A line segment with two sides and two vertices.
```
struct Line play
{
2019-08-14 03:32:51 -07:00
readonly Sector BackSector, FrontSector;
readonly double BBox[4];
readonly vector2 Delta;
readonly Side Sidedef[2];
readonly Vertex V1, V2;
2018-12-29 16:05:19 -08:00
2019-08-14 03:32:51 -07:00
readonly uint PortalIndex;
readonly uint PortalTransferred;
2018-12-29 16:05:19 -08:00
2019-08-14 03:32:51 -07:00
readonly int Health;
readonly int HealthGroup;
2018-12-29 20:04:32 -08:00
2019-08-14 03:32:51 -07:00
double Alpha;
uint Flags;
int ValidCount;
2018-12-29 16:05:19 -08:00
2019-08-14 03:32:51 -07:00
uint Activation;
int Args[5];
int LockNumber;
int Special;
2018-12-29 16:05:19 -08:00
2019-08-14 03:32:51 -07:00
int Index();
2018-12-29 16:05:19 -08:00
2019-08-14 03:32:51 -07:00
bool Activate(Actor activator, int side, int type);
bool RemoteActivate(Actor activator, int side, int type, vector3 pos);
2018-12-29 16:05:19 -08:00
2019-08-14 03:32:51 -07:00
Line GetPortalDestination();
bool IsLinePortal();
bool IsVisualPortal();
2018-12-29 16:05:19 -08:00
2019-08-14 03:32:51 -07:00
clearscope int GetHealth();
void SetHealth(int newhealth);
2018-12-29 20:04:32 -08:00
2019-08-14 03:32:51 -07:00
double GetUdmfFloat(name nm);
int GetUdmfInt(name nm);
string GetUdmfString(name nm);
2018-12-29 16:05:19 -08:00
}
```
2019-08-14 03:31:41 -07:00
### `BackSector`, `FrontSector`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The sector of the front and back sides of this line.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `BBox`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The top, bottom, left and right of the line, respective to array index.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Delta`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Equivalent to `V2 - V1`.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `V1`, `V2`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Returns the start and end points of this line segment, respectively.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Sidedef`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
The front and back sides of this line, 0 and 1 respectively. The aliases
`Line.Front` and `Line.Back` are provided as well.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `PortalIndex`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `PortalTransferred`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Health`
2018-12-29 20:04:32 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 20:04:32 -08:00
2019-08-14 03:31:41 -07:00
### `HealthGroup`
2018-12-29 20:04:32 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 20:04:32 -08:00
2019-08-14 03:31:41 -07:00
### `Alpha`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Alpha of the middle texture on both sides.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Flags`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Any combination of the following bit flags:
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
| Name | Description |
| ---- | ----------- |
| `ML_3DMIDTEX_IMPASS` | Middle texture will collide with projectiles and allow them to pass through. |
| `ML_3DMIDTEX` | Middle texture can be collided with and walked on as if it were a thin sector. |
| `ML_ADDTRANS` | Middle textures are drawn with additive translucency on both sides. |
| `ML_BLOCKEVERYTHING` | Line blocks everything. |
| `ML_BLOCKHITSCAN` | Line blocks hit scan attacks. |
| `ML_BLOCKING` | Line is solid and blocks everything but projectiles and hit scan attacks. |
| `ML_BLOCKMONSTERS` | Line blocks non-flying monsters. |
| `ML_BLOCKPROJECTILE` | Line blocks projectiles. |
| `ML_BLOCKSIGHT` | Line blocks line of sight. |
| `ML_BLOCKUSE` | Line blocks use actions. |
| `ML_BLOCK_FLOATERS` | Line blocks flying monsters. |
| `ML_BLOCK_PLAYERS` | Line blocks players. |
| `ML_CHECKSWITCHRANGE` | Checks the activator's vertical position as well as horizontal before activating. |
| `ML_CLIP_MIDTEX` | Applies `WALLF_CLIP_MIDTEX` to both sides. |
| `ML_DONTDRAW` | Never shown on the auto-map. |
| `ML_DONTPEGBOTTOM` | Lower texture is unpegged on both sides. |
| `ML_DONTPEGTOP` | Upper texture is unpegged on both sides. |
| `ML_FIRSTSIDEONLY` | Special can only be activated from the front side. |
| `ML_MAPPED` | Always shown on the auto-map. |
| `ML_MONSTERSCANACTIVATE` | Monsters may activate this line. |
| `ML_RAILING` | Line is a railing that can be jumped over. |
| `ML_REPEAT_SPECIAL` | Special may be activated multiple times. |
| `ML_SECRET` | Line will be shown as one-sided on the auto-map. |
| `ML_SOUNDBLOCK` | Blocks sound propagation after two lines with this flag. |
| `ML_TWOSIDED` | Line has a back side. |
| `ML_WRAP_MIDTEX` | Applies `WALLF_WRAP_MIDTEX` to both sides. |
| `ML_ZONEBOUNDARY` | Reverb zone boundary. |
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `ValidCount`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Don't use this.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Activation`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Args`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Arguments of the line's special action.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `LockNumber`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Special`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Number of the special action to be executed when this line is activated.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Index`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Returns the index of this line.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Activate`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `RemoteActivate`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `GetPortalDestination`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `IsLinePortal`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `IsVisualPortal`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `GetHealth`
2018-12-29 20:04:32 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 20:04:32 -08:00
2019-08-14 03:31:41 -07:00
### `SetHealth`
2018-12-29 20:04:32 -08:00
2019-08-14 03:31:41 -07:00
TODO
2018-12-29 20:04:32 -08:00
2019-08-14 03:31:41 -07:00
### `GetUdmfFloat`, `GetUdmfInt`, `GetUdmfString`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Gets a named UDMF property attached to this linedef.
2018-12-29 16:05:19 -08:00
<!-- EOF -->