split files

pull/1/head
an 2018-12-29 19:05:19 -05:00
parent 9f48cfbc70
commit 2a712d6933
63 changed files with 6968 additions and 6852 deletions

View File

@ -25,7 +25,9 @@ Table of Contents
* [Include directives](#include-directives)
* [Types](#types)
* [Integers](#integers)
* [Symbols](#symbols)
* [Floating-point types](#floating-point-types)
* [Symbols](#symbols-1)
* [Strings](#strings)
* [Names](#names)
* [Color](#color)
@ -423,6 +425,18 @@ Some types have aliases as well:
| `short` | `int16` |
| `ushort` | `uint16` |
### Symbols
Integer types have symbols attached which can be accessed by `typename.name`, for instance `int.Max`.
- `Max`
Maximum value of type.
- `Min`
Minimum value of type.
## Floating-point types
Floating-point types hold exponents, generally represented as regular decimal numbers. There are two such types available to ZScript:
@ -434,6 +448,58 @@ Floating-point types hold exponents, generally represented as regular decimal nu
| `float64` | Yes | Alias for `double`. |
| `float32` | No | 32-bit floating-point number. Not implemented correctly, unusable. |
### Symbols
Floating-point types have symbols attached which can be accessed by `typename.name`, for instance `double.Infinity`.
- `Dig`
Number of decimal digits in type.
- `Epsilon`
ε value of type.
- `Infinity`
∞ value of type.
- `Mant_Dig`
Number of mantissa bits in type.
- `Max`
Maximum value of type.
- `Max_Exp`
Maximum exponent bits value of type.
- `Max_10_Exp`
Maximum exponent of type.
- `Min_Denormal`
Minimum positive subnormal value of type.
- `Min_Exp`
Minimum exponent bits value of type.
- `Min_Normal`
Minimum value of type.
- `Min_10_Exp`
Minimum exponent of type.
- `NaN`
Not-a-Number value of type.
## Strings
| Name | Usable as argument |

4537
2-api.md

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

102
api-actor-State.md Normal file
View File

@ -0,0 +1,102 @@
# State
Represents a state on an `Actor` or `StateProvider`. Data in `State` is read-only and is copied as needed to its respective locations for modification, as it is merely a look into the global constant state table.
```
struct State
{
readonly uint8 Frame;
readonly State NextState;
readonly int Sprite;
readonly int16 Tics;
readonly int Misc1;
readonly int Misc2;
readonly uint16 TicRange;
readonly uint8 UseFlags;
readonly bool bCANRAISE;
readonly bool bDEHACKED;
readonly bool bFAST;
readonly bool bFULLBRIGHT;
readonly bool bNODELAY;
readonly bool bSAMEFRAME;
readonly bool bSLOW;
int DistanceTo(State other);
bool ValidateSpriteFrame();
textureid, bool, vector2 GetSpriteTexture(int rotation, int skin = 0, vector2 scale = (0, 0));
}
```
- `Frame`
The sprite frame of this state.
- `NextState`
A pointer to the next state in the global state table.
- `Sprite`
The sprite ID of this state.
- `Tics`
The number of game ticks this state lasts.
- `Misc1`
- `Misc2`
Primarily used in DeHackEd compatibility. Don't use this.
- `TicRange`
The maximum amount of tics to add for random tic durations, or `0` if the duration is not random. For example, `TNT1 A random(5, 7)` would have a `Tics` value of `5` and a `TicRange` of `2`.
- `UseFlags`
The scope of this state. See *Action Scoping*. Can have any of the `DefaultStateUsage` flags.
- `bCANRAISE`
State has the `CANRAISE` flag, allowing `A_VileChase` to target this actor for healing without entering an infinitely long state.
- `bDEHACKED`
`true` if the state has been modified by DeHackEd.
- `bFAST`
State has the `FAST` flag, halving the duration when fast monsters is enabled.
- `bFULLBRIGHT`
State has the `BRIGHT` flag, making it fully bright regardless of other lighting conditions.
- `bNODELAY`
State has the `NODELAY` flag, forcing the associated action function to be run if the actor is in its first tic.
- `bSAMEFRAME`
`true` if the state's frame is to be kept from the last frame used, i.e., is `#`.
- `bSLOW`
State has the `SLOW` flag, doubling the duration when slow monsters is enabled.
- `DistanceTo`
Returns the offset between this state and `other` in the global frame table. Only works if both states are owned by the same actor.
- `ValidateSpriteFrame`
Returns `true` if the sprite frame actually exists.
- `GetSpriteTexture`
Returns the texture, if the texture should be flipped horizontally, and scaling of this state's sprite. Scaling will return `scale` unless `skin` is nonzero. `skin` determines the player skin used.
<!-- EOF -->

81
api-base-Array.md Normal file
View File

@ -0,0 +1,81 @@
# Array
While ZScript does not have proper user-facing generics, `Array` is one such type that does have a type parameter. It mirrors the internal `TArray` type.
```
struct Array<Type>
{
void Clear();
void Copy(array<Type> other);
void Delete(uint index, int deletecount = 1);
uint Find(Type item) const;
void Grow(uint amount);
void Insert(uint index, Type item);
uint Max() const;
void Move(array<Type> other);
bool Pop();
uint Push(Type item);
uint Reserve(uint amount);
void Resize(uint amount);
void ShrinkToFit();
uint Size() const;
}
```
- `Clear`
Clears out the entire array.
- `Copy`
Copies another array's contents into this array.
- `Delete`
Deletes `count` object(s) at `index`. Moves objects after them into their place.
- `Find`
Finds the index of `item` in the array, or `Size` if it couldn't be found.
- `Grow`
Ensures the array can hold at least `amount` new members.
- `Insert`
Inserts `item` at `index`. Moves objects after `index` to the right.
- `Max`
Returns the allocated size of the array.
- `Move`
Moves another array's contents into this array.
- `Pop`
Deletes the last item in the array. Returns `false` if there are no items in the array.
- `Push`
Places `item` at the end of the array, calling `Grow` if necessary.
- `Reserve`
Adds `amount` new entries at the end of the array, increasing `Size`. Calls `Grow` if necessary.
- `Resize`
Changes the allocated array size to `amount`. Deletes members if `amount` is smaller than `Size`.
- `ShrinkToFit`
Shrinks the allocated array size `Max` to `Size`.
- `Size`
Returns the amount of objects in the array.
<!-- EOF -->

75
api-base-CVar.md Normal file
View File

@ -0,0 +1,75 @@
# CVar
A **C**onsole **Var**iable, either defined in `CVARINFO` or by the engine. **Not serializable. Do not use as a member unless marked as `transient`.**
All Get and Set operations will work regardless of the real type of the CVar, as they aren't "strongly" typed.
```
struct CVar
{
static CVar FindCVar(name n);
static CVar GetCVar(name n, PlayerInfo player = null);
bool GetBool();
double GetFloat();
int GetInt();
string GetString();
void SetBool(bool v);
void SetFloat(double v);
void SetInt(int v);
void SetString(string v);
int GetRealType();
int ResetToDefault();
}
```
- `FindCVar`
Returns a server CVar by name, or `null` if none is found.
- `GetCVar`
Returns a user or server CVar by name, with `player` as the user if applicable, or `null` if none is found.
- `GetBool`
Returns a boolean representing the value of the CVar, or `false` if it cannot be represented.
- `GetFloat`
Returns a float representing the value of the CVar, or `0.0` if it cannot be represented.
- `GetInt`
Returns an integer representing the value of the CVar, or `0` if it cannot be represented.
- `GetString`
Returns a string representing the value of the CVar. CVars can always be represented as strings.
- `SetBool`
- `SetFloat`
- `SetInt`
- `SetString`
Sets the representation of the CVar to `v`. May only be used on mod-defined CVars.
- `GetRealType`
Returns the type of the CVar as it was defined, which may be one of the following:
| Name |
| ---- |
| `CVar.CVAR_Bool` |
| `CVar.CVAR_Color` |
| `CVar.CVAR_Float` |
| `CVar.CVAR_Int` |
| `CVar.CVAR_String` |
- `ResetToDefault`
Resets the CVar to its default value and returns 0. The purpose of the return is unknown. May only be used on mod-defined CVars.
<!-- EOF -->

12
api-base-Color.md Normal file
View File

@ -0,0 +1,12 @@
# Color
Colors simply store red, green, blue and alpha components. Each component has a range 0 to 255, inclusive.
```
struct Color
{
uint8 r, g, b, a;
}
```
<!-- EOF -->

16
api-base-FixedArray.md Normal file
View File

@ -0,0 +1,16 @@
# Type[N]
Fixed-size arrays have a size method attached to them for convenience purposes.
```
struct Type[N]
{
uint Size() const;
}
```
- `Size`
Returns the size of the array. This is a compile-time constant.
<!-- EOF -->

44
api-base-Object.md Normal file
View File

@ -0,0 +1,44 @@
# Object
The base class of all `class` types.
```
class Object
{
bool bDESTROYED;
class GetClass();
string GetClassName();
class GetParentClass();
virtualscope void Destroy();
virtual virtualscope void OnDestroy();
}
```
- `bDESTROYED`
This object wants to be destroyed but has not yet been garbage collected.
- `GetClass`
Returns the class type of this object.
- `GetClassName`
Returns a string representation of the class type of this object.
- `GetParentClass`
Returns the class type of this object's parent class.
- `Destroy`
Destroys this object. Do not use the object after calling this. References to it will be invalidated.
- `OnDestroy`
Called just before the object is collected by the garbage collector. **Not deterministic** unless the object is linked into the thinker list, in which case it is destroyed earlier in a deterministic setting. Not all `Thinker`s are linked into this list, so be careful when overriding this. Any `Actor` will generally be safe.
<!-- EOF -->

109
api-base-String.md Normal file
View File

@ -0,0 +1,109 @@
# String
Strings have many methods attached to them for manipulating text.
```
struct String
{
static vararg string Format(string format, ...);
vararg void AppendFormat(string format, ...);
string CharAt(int pos) const;
int CharCodeAt(int pos) const;
string Filter();
int IndexOf(string substr, int startIndex = 0) const;
string Left(int len) const;
uint Length() const;
string Mid(int pos = 0, int len = int.Max) const;
void Remove(int index, int amount);
void Replace(string pattern, string replacement);
int RightIndexOf(string substr, int endIndex = int.Max) const;
void Split(out array<string> tokens, string delimiter, EmptyTokenType keepEmpty = TOK_KEEPEMPTY) const;
double ToDouble() const;
int ToInt(int base = 0) const;
void ToLower();
void ToUpper();
void Truncate(int newlen);
deprecated("3.5.1") int LastIndexOf(string substr, int endIndex = int.Max) const;
}
```
- `Format`
Creates a string using a format string and any amount of arguments.
- `AppendFormat`
Works like `Format`, but appends the result to the string.
- `CharAt`
Returns the character at `pos` as a new string.
- `CharCodeAt`
Returns the character at `pos` as an integer.
- `Filter`
Replaces escape sequences in a string with escaped characters as a new string.
- `IndexOf`
Returns the first index of `substr` starting from the left at `start`.
- `Left`
Returns the first `len` characters as a new string.
- `Length`
Returns the number of characters in this string.
- `Mid`
Returns `len` characters starting at `pos` as a new string.
- `Remove`
Removes `amount` characters starting at `index` in place.
- `Replace`
Replaces all instances of `pattern` with `replacement` in place.
- `RightIndexOf`
Returns the first index of `substr` starting from the right at `end`.
- `Split`
Splits the string by each `delimiter` into `tokens`. `keepEmpty` may be either `TOK_SKIPEMPTY` (the default) or `TOK_KEEPEMPTY`, which will keep or discard empty strings found while splitting.
- `ToDouble`
Interprets the string as a double precision floating point number.
- `ToInt`
Interprets the string as a base `base` integer, guessing the base if it is `0`.
- `ToLower`
Converts all characters in the string to lowercase in place.
- `ToUpper`
Converts all characters in the string to uppercase in place.
- `Truncate`
Truncates the string to `len` characters in place.
- `LastIndexOf`
Broken. Use `RightIndexOf` instead.
<!-- EOF -->

16
api-base-StringTable.md Normal file
View File

@ -0,0 +1,16 @@
# StringTable
The localized string table as defined by `LANGUAGE`.
```
struct StringTable
{
static string Localize(string val, bool prefixed = true);
}
```
- `Localize`
Returns the localized variant of `val`. If `prefixed` is `true`, the string is returned as-is unless it is prefixed with `$` where the `$` character itself is ignored. **Not deterministic** unless there is only one variant of `val`. This is generally fine because this should only be used for visual strings anyway.
<!-- EOF -->

76
api-base-Thinker.md Normal file
View File

@ -0,0 +1,76 @@
# Thinker
A class representing any object in the game that runs logic every game tick, i.e., "thinks." Most classes derive from `Thinker`, directly or indirectly.
All thinkers are grouped by their "stat" number, or "statnum," which specifies the ordering of which thinkers are run, first to last. There are 127 stat numbers total, 20 of which are not used by the engine and may be used for any purpose.
The user-defined stat numbers begin at `Thinker.STAT_USER` and end at `Thinker.STAT_USER_MAX`. Do not attempt to use normal integers as stat numbers except as relative to these two.
(Note to authors: These tables are not alphabetically organized as their ordering is meaningful.)
Thinkers which do not think and are elided from many checks:
| Name | Description |
| ---- | ----------- |
| `Thinker.STAT_INFO` | Info queue (used by `SpecialSpot` and its descendants.) |
| `Thinker.STAT_DECAL` | Decals that cannot be deleted. |
| `Thinker.STAT_AUTODECAL` | Decals that can be deleted (were not placed by the map.) |
| `Thinker.STAT_CORPSEPOINTER` | An entry in Hexen's corpse queue. |
| `Thinker.STAT_TRAVELLING` | Any actor travelling between maps in a hub. |
| `Thinker.STAT_STATIC` | Thinkers persistent across maps. |
Thinkers which do think and are mandatory to many checks:
| Name | Description |
| ---- | ----------- |
| `Thinker.STAT_SCROLLER` | Texture scrollers and carriers. |
| `Thinker.STAT_PLAYER` | All `PlayerPawn` actors. |
| `Thinker.STAT_BOSSTARGET` | `BossBrain` targets. |
| `Thinker.STAT_LIGHTNING` | Lightning as used by Hexen. |
| `Thinker.STAT_DECALTHINKER` | Decal animators. |
| `Thinker.STAT_INVENTORY` | All `Inventory` items. |
| `Thinker.STAT_LIGHT` | Sector lighting thinkers. |
| `Thinker.STAT_LIGHTTRANSFER` | Sector lighting transfer thinkers. |
| `Thinker.STAT_EARTHQUAKE` | Quake effects. |
| `Thinker.STAT_MAPMARKER` | All `MapMarker` actors. |
| `Thinker.STAT_DLIGHT` | Dynamic lights. |
| `Thinker.STAT_DEFAULT` | Anything not in any other category. Most actors go here. |
| `Thinker.STAT_SECTOREFFECT` | Sector effects that cause floor or ceiling movement. |
| `Thinker.STAT_ACTORMOVER` | All `ActorMover` actors. |
| `Thinker.STAT_SCRIPTS` | The ACS VM. |
| `Thinker.STAT_BOT` | All bot logic. This is not bound to their actor. |
```
class Thinker play
{
const TICRATE;
virtual void ChangeStatNum(int stat);
virtual void PostBeginPlay();
virtual void Tick();
static clearscope int Tics2Seconds(int tics);
}
```
- `TICRATE`
The number of game ticks in a second. This value is always `int(35)`.
- `ChangeStatNum`
Changes the statnum of this `Thinker`.
- `PostBeginPlay`
Called at the very end of this Thinker's initialization.
- `Tick`
Called every game tick. The order between this thinker's `Tick` and every other thinker in the same statnum is unspecified.
- `Tics2Seconds`
Roughly converts a number of tics to an integral amount of seconds. Equivalent to `tics / TICRATE`.
<!-- EOF -->

32
api-base-Vector.md Normal file
View File

@ -0,0 +1,32 @@
# Vector2/Vector3
Vectors have builtin methods and `Vector3` in particular has a swizzle operator.
```
struct Vector2
{
double x, y;
double Length() const;
vector2 Unit() const;
}
struct Vector3
{
double x, y, z;
vector2 xy;
double Length() const;
vector3 Unit() const;
}
```
- `Length`
Returns the length (magnitude) of the vector.
- `Unit`
Returns a normalized vector. Equivalent to `vec / vec.Length()`.
<!-- EOF -->

View File

@ -0,0 +1,26 @@
# BrokenLines
A container representing an array of lines of text that have been broken up to fit the screen and clipping region.
```
class BrokenLines
{
int Count();
string StringAt(int line);
int StringWidth(int line);
}
```
- `Count`
Returns the amount of lines in this container.
- `StringAt`
Returns the text of line `line`.
- `StringWidth`
Returns the width (in pixels) of line `line`.
<!-- EOF -->

28
api-drawing-Console.md Normal file
View File

@ -0,0 +1,28 @@
# Console
Basic access to console functionality.
```
struct Console
{
static void HideConsole();
static void MidPrint(Font font, string text, bool bold = false);
static vararg void Printf(string fmt, ...);
}
```
- `HideConsole`
Hides the console if it is open and `GameState` is not `GS_FULLCONSOLE`.
- `MidPrint`
Prints `text` (possibly a `LANGUAGE` string if prefixed with `$`) in `font` to the middle of the screen for 1½ seconds. Will print even if the player is a spectator if `bold` is `true`. Uses the `msgmidcolor` CVar for non-bold messages and `msgmidcolor2` for bold messages.
This is the function used internally by ACS' `Print` and `PrintBold` functions.
- `Printf`
Prints a formatted string to the console.
<!-- EOF -->

53
api-drawing-Font.md Normal file
View File

@ -0,0 +1,53 @@
# Font
A font as defined in `FONTDEFS` or a bitmap font file. **Not serializable. Do not use as a member unless marked as `transient`.**
```
struct Font
{
static Font FindFont(name fontname);
static int FindFontColor(name color);
static Font GetFont(name fontname);
int GetCharWidth(int code);
string GetCursor();
int GetHeight();
int StringWidth(string code);
BrokenLines BreakLines(string text, int maxlen);
}
```
- `FindFont`
Gets a font as defined in `FONTDEFS`.
- `FindFontColor`
Returns the color range enumeration for a named color.
- `GetFont`
Gets a font either as defined in `FONTDEFS` or a ZDoom/bitmap font.
- `GetCharWidth`
Returns the width in pixels of a character code.
- `GetCursor`
Returns the string used as a blinking cursor graphic for this font.
- `GetHeight`
Returns the line height of the font.
- `StringWidth`
Returns the width in pixels of the string.
- `BreakLines`
Breaks `text` up into a `BrokenLines` structure according to the screen and clip region, as well as appropriately accounting for a maximum width in pixels of `maxlen`.
<!-- EOF -->

21
api-drawing-GIFont.md Normal file
View File

@ -0,0 +1,21 @@
# GIFont
A font as defined in `MAPINFO`/GameInfo.
```
struct GIFont
{
name Color;
name FontName;
}
```
- `Color`
The color of the font.
- `FontName`
The name of the font.
<!-- EOF -->

106
api-drawing-Screen.md Normal file
View File

@ -0,0 +1,106 @@
# Screen
Functions for drawing various things to the screen.
Note: There are no longer any fully paletted renderers in GZDoom as of version 3.5. Alternate palette index parameters are generally ignored now.
```
struct Screen
{
static vararg void DrawChar(Font font, int normalcolor, double x, double y, int character, ...);
static vararg void DrawShape(textureid tex, bool animate, Shape2D s, ...);
static vararg void DrawText(Font font, int normalcolor, double x, double y, string text, ...);
static vararg void DrawTexture(textureid tex, bool animate, double x, double y, ...);
static void Clear(int left, int top, int right, int bottom, color cr, int palcolor = -1);
static void Dim(color cr, double amount, int x, int y, int w, int h);
static void DrawFrame(int x, int y, int w, int h);
static void DrawLine(int x0, int y0, int x1, int y1, color cr);
static void DrawThickLine(int x0, int y0, int x1, int y1, double thickness, color cr);
static double GetAspectRatio();
static int GetHeight();
static int GetWidth();
static color PaletteColor(int index);
static vector2, vector2 VirtualToRealCoords(vector2 pos, vector2 size, vector2 vsize, bool vbottom = false, bool handleaspect = true);
static void ClearClipRect();
static int, int, int, int GetClipRect();
static int, int, int, int GetViewWindow();
static void SetClipRect(int x, int y, int w, int h);
}
```
- `DrawChar`
TODO
- `DrawShape`
TODO
- `DrawText`
TODO
- `DrawTexture`
TODO
- `Clear`
Draws a rectangle from `top left` to `bottom right` in screen coordinates of `cr` color. Does not support translucent colors. `palcolor` is a palette index to use as a color in paletted renderers or `-1` for automatic conversion from the given RGB color.
- `Dim`
Draws a rectangle at `x y` of `w h` size in screen coordinates of `cr` color. Does not support translucent colors, but `amount` may be used to specify the translucency in a range of 0-1 inclusive.
- `DrawFrame`
Draws a frame around a rectangle at `x y` of `w h` size in screen coordinates, using the border graphics as defined in `MAPINFO`/GameInfo.
- `DrawLine`
Draws a one pixel wide line from `x0 y0` to `x1 y1` in screen coordinates of color `cr`. Does not support translucent colors.
- `DrawThickLine`
Draws a `thickness` pixel wide line from `x0 y0` to `x1 y1` in screen coordinates of color `cr`. Supports translucent colors.
- `GetAspectRatio`
Returns the aspect ratio of the screen.
- `GetHeight`
Returns the height of the screen.
- `GetWidth`
Returns the width of the screen.
- `PaletteColor`
Returns a `color` for a given palette index.
- `VirtualToRealCoords`
TODO
- `ClearClipRect`
Clears the clipping rectangle if there is one.
- `GetClipRect`
Returns the clipping rectangle's `x`/`y`/`w`/`h`.
- `GetViewWindow`
Returns the 3D viewing window, which may be smaller than the screen size with any given `screenblocks` setting.
- `SetClipRect`
Sets the clipping rectangle to restrict further drawing to the region starting at `x y` of size `w h` in screen coordinates.
<!-- EOF -->

37
api-drawing-Shape2D.md Normal file
View File

@ -0,0 +1,37 @@
# Shape2D
Represents an arbitrary polygonal 2D shape.
```
class Shape2D
{
void Clear(int which = C_Verts | C_Coords | C_Indices);
void PushCoord(vector2 c);
void PushTriangle(int a, int b, int c);
void PushVertex(vector2 v);
}
```
- `Clear`
Clears data out of a shape. Uses these as a bit flag:
| Name | Description |
| ---- | ----------- |
| `Shape2D.C_Coords` | Clears texture coordinates. |
| `Shape2D.C_Indices` | Clears vertex indices. |
| `Shape2D.C_Verts` | Clears vertices. |
- `PushCoord`
Pushes a texture coordinate into the shape buffer.
- `PushTriangle`
Pushes the indices of a triangle into the shape buffer.
- `PushVertex`
Pushes a vertex into the shape buffer.
<!-- EOF -->

90
api-drawing-TexMan.md Normal file
View File

@ -0,0 +1,90 @@
# TexMan
The **Tex**ture **Man**ager is used for loading, finding, replacing and getting information on textures.
```
struct TexMan
{
static textureid CheckForTexture(string name, int usetype, int flags = TexMan.TryAny);
static int CheckRealHeight(textureid tex);
static string GetName(textureid tex);
static vector2 GetScaledOffset(textureid tex);
static vector2 GetScaledSize(textureid tex);
static int, int GetSize(textureid tex);
static void ReplaceTextures(string from, string to, int flags);
static void SetCameraToTexture(Actor viewpoint, string texture, double fov);
}
```
- `CheckForTexture`
Returns a `textureid` for the texture named `name`. `usetype` may be one of the following, which selects what kind of texture to find:
| Name | Description |
| ---- | ----------- |
| `TexMan.Type_Any` | Returns any kind of texture. |
| `TexMan.Type_Autopage` | Returns an auto-map background graphic. (TODO: needs example) |
| `TexMan.Type_Build` | Returns a tile from a BUILD TILES entry. |
| `TexMan.Type_Decal` | Unknown. (TODO) |
| `TexMan.Type_FirstDefined` | Unknown. (TODO) |
| `TexMan.Type_Flat` | Returns any flat, i.e. `FLOOR0_1`. |
| `TexMan.Type_FontChar` | Unknown. (TODO) |
| `TexMan.Type_MiscPatch` | Unknown. (TODO) |
| `TexMan.Type_Null` | Returns the null graphic. Ignores `name`. |
| `TexMan.Type_Override` | Unknown. (TODO) |
| `TexMan.Type_SkinGraphic` | Unknown. (TODO) |
| `TexMan.Type_SkinSprite` | Unknown. (TODO) |
| `TexMan.Type_Sprite` | Returns a sprite, i.e. `MEDIA0`. |
| `TexMan.Type_WallPatch` | Returns an uncomposited patch, i.e. `DOOR2_1`. |
| `TexMan.Type_Wall` | Returns any composited wall texture, i.e. `STARTAN2`. |
`flags` may be any of the following combined (with the bitwise OR operator `|`:)
| Name | Description |
| ---- | ----------- |
| `TexMan.AllowSkins` | Unknown. (TODO) |
| `TexMan.DontCreate` | Will never create a new texture when searching. |
| `TexMan.Overridable` | Unknown. (TODO) |
| `TexMan.ReturnFirst` | Unknown. (TODO) |
| `TexMan.ShortNameOnly` | Will force use of a short name when searching. |
| `TexMan.TryAny` | Default. Unknown. (TODO) |
- `CheckRealHeight`
TODO
- `GetName`
Returns the original name of a `textureid`.
- `GetScaledOffset`
TODO
- `GetScaledSize`
TODO
- `GetSize`
Returns the width and height of a `textureid`.
- `ReplaceTextures`
Replaces textures named `from` with `to` within the map. `flags` may be used to filter out certain textures from being replaced:
| Name | Description |
| ---- | ----------- |
| `TexMan.NOT_BOTTOM` | Filters out linedef bottom textures. |
| `TexMan.NOT_CEILING` | Filters out ceiling flats. |
| `TexMan.NOT_FLAT` | Filters out any flat texture. |
| `TexMan.NOT_FLOOR` | Filters out floor flats. |
| `TexMan.NOT_MIDDLE` | Filters out linedef middle textures. |
| `TexMan.NOT_TOP` | Filters out linedef upper textures. |
| `TexMan.NOT_WALL` | Filters out any linedef texture. |
- `SetCameraToTexture`
Sets the camera texture (as defined in `ANIMDEFS`) `texture` to the viewpoint of `viewpoint` with a fov of `fov`.
<!-- EOF -->

43
api-drawing-TextureID.md Normal file
View File

@ -0,0 +1,43 @@
# TextureID
Texture IDs can be explicitly converted to integers, but not the other way around. You can add and subtract integers with a `textureid`, however. (This only works with the integer on the right hand side.)
```
struct TextureID
{
bool Exists() const;
bool IsNull() const;
bool IsValid() const;
void SetInvalid();
void SetNull();
}
```
- `Exists`
Checks if the texture exists within the texture manager at all.
- `IsNull`
Checks if the texture is the null index (`0`.)
- `IsValid`
Checks if the texture index is not the invalid index (`-1`.)
- `SetInvalid`
Sets the texture index to `-1`.
- `SetNull`
Sets the texture index to `0`.
The proper way to zero-initialize a `textureid` is:
```
textureid tex;
tex.SetNull();
```
<!-- EOF -->

67
api-files-Wads.md Normal file
View File

@ -0,0 +1,67 @@
# Wads
The `Wads` group of functions allow you to access the virtual file system by reading from loaded archives. Note that all archive operations are **not deterministic** unless all users have the exact same files loaded. This is generally fine even if they are not exactly the same, but be careful to not do things which may collide with what another mod is doing.
As a summary of how the virtual file system works, files of various kinds are loaded from *archives* into a structure of *lumps* and *namespaces*. The term *lump* in this document refers to any file object loaded from an archive which has its name truncated to 8 characters and its extension stripped, and the term *file* refers to any actual file within a real folder structure. Archives which have real folder structures are referred to in this document as *resource archives* or *resources*. The other two types of supported archives are *Doom Wad* (commonly just "Wad") and *Blood* `RFF` files. The latter is useless. The former, *Doom Wads*, are most commonly used for maps, map sets, older mods and all commercially available games including Doom, Heretic &al. The currently supported resource archive file types include `PKZIP` (`.zip`, `.pk3`, `.pkz`), 7-Zip (`.7z`, `.pk7`), BUILD `GRP` (`.grp`), Quake `PAK` (`.pak`), and folders. Single files can also be loaded as archives, containing only themselves.
In short:
- *Lump* refers to an object from any archive type with an 8 character filename (extension removed.)
- *File* refers to fully qualified object from a resource archive, which can also be used as a lump through its truncated name.
- *Archives* are real files or folders which hold *lumps*.
- *Resource archives* are archives with a folder structure for determining lump namespaces, and also store fully qualified paths for files.
- *Wad files* are archives which hold only lumps, and use markers for determining lump namespaces.
| Name | Description | Resource path | Wad file marker |
| ---- | ----------- | ------------- | --------------- |
| `ns_acslibrary` | ACS libraries. | `/acs/` | `A_START`/`A_END` |
| `ns_bloodmisc` | Unused. | N/A | N/A |
| `ns_bloodraw` | Blood `RAW` format sounds. Found only in `RFF` files. | N/A | N/A |
| `ns_bloodsfx` | Blood `SFX` format sounds. Found only in `RFF` files. | N/A | N/A |
| `ns_colormaps` | Boom color maps. | `/colormaps/` | `C_START`/`C_END` |
| `ns_flats` | Flat textures. | `/flats/` | `FF_START`/`FF_END` |
| `ns_global` | The global namespace, which is the root of any archive. | `/` | None |
| `ns_graphics` | Miscellaneous graphics. | `/graphics/` | None |
| `ns_hidden` | Used for filtered files that did not match this game. | N/A | N/A |
| `ns_hires` | Deprecated high-resolution textures. | `/hires/` | `HI_START`/`HI_END` |
| `ns_music` | Music files. | `/music/` | None |
| `ns_newtextures` | Generic texture files, usable as patches or flats. | `/textures/` | `TX_START`/`TX_END` |
| `ns_patches` | Texture patches. | `/patches/` | None |
| `ns_sounds` | Sound files. | `/sounds/` | None |
| `ns_sprites` | Sprites are all contained in this namespace. | `/sprites/` | `S_START`/`S_END` or `SS_START`/`SS_END` |
| `ns_strifevoices` | Strife voice files. | `/voices/` | `V_START`/`V_END` |
| `ns_voxels` | Volumetric pixel (voxel) models. | `/voxels/` | `VX_START`/`VX_END` |
Additionally, `ns_specialzipdirectory` denotes the start of the specialized resource archive folder namespaces, which are normally under `ns_global`.
```
struct Wads
{
static int CheckNumForFullName(string name);
static int CheckNumForName(string name, int ns, int wadnum = -1, bool exact = false);
static int FindLump(string name, int startlump = 0, FindLumpNamespace ns = Wads.GlobalNamespace);
static string ReadLump(int lump);
}
```
- `CheckNumForFullName`
Returns the handle of the first file named `name`, matching only the full path to it, including the extension, or `-1` if the file was not found. Only works with files defined in resource archives.
- `CheckNumForName`
Returns the handle of the first lump named `name` within namespace `ns`. If `wadnum` is not `-1`, then it signifies, if `exact` is false, the number of the last archive to search in, or the only archive to search in if `exact` is `true`.
Note there is currently no way to actually *get* the number of an archive, even the current one. The only guarantee is that archive `0` will be the base archive (`gzdoom.pk3`.)
- `FindLump`
Returns the handle of the first lump named `name` starting at `startlump` (zero indicates the first lump) in either the global namespace or any namespace. `ns` can be either `Wads.GlobalNamespace` or `Wads.AnyNamespace` to specify this. Returns `-1` if there are no lumps with that name left.
This function can be used in a loop to find all lumps with a specified name.
- `ReadLump`
Reads the whole contents of `lump` into a string and returns the result. If `lump` is not valid, returns an empty string. Note that binary lumps can be loaded this way and the string's length will be correct according to the lump's size even if null characters are present in the lump.
<!-- EOF -->

41
api-global-DEHInfo.md Normal file
View File

@ -0,0 +1,41 @@
# DEHInfo
Static DeHackEd information.
```
struct DEHInfo
{
readonly int BFGCells;
readonly int BlueAC;
readonly double ExplosionAlpha;
readonly uint8 ExplosionStyle;
readonly int MaxSoulsphere;
readonly int NoAutofreeze;
}
```
- `BFGCells`
The amount of ammunition `A_FireBFG` will deplete. Default is 40.
- `BlueAC`
Multiple of 100 for `BlueArmor`'s `Armor.SaveAmount`. Default is 2 for 200 armor.
- `ExplosionAlpha`
For actors with the `DEHEXPLOSION` flag, the alpha to set the actor to on explosion.
- `ExplosionStyle`
For actors with the `DEHEXPLOSION` flag, the render style to be applied on explosion.
- `MaxSoulsphere`
The `Inventory.MaxAmount` for `Soulsphere`. Default is 200.
- `NoAutofreeze`
Overrides generic freezing deaths if not zero, making all actors act as if they had the `NOICEDEATH` flag.
<!-- EOF -->

View File

@ -0,0 +1,51 @@
# FOptionMenuSettings
Defaults for `OptionMenu`s as defined in `MENUDEF`'s `OptionMenuSettings` block and `MAPINFO`/GameInfo.
```
struct FOptionMenuSettings
{
int mTitleColor;
int mFontColor;
int mFontColorValue;
int mFontColorMore;
int mFontColorHeader;
int mFontColorHighlight;
int mFontColorSelection;
int mLineSpacing;
}
```
- `mTitleColor`
TODO
- `mFontColor`
TODO
- `mFontColorValue`
TODO
- `mFontColorMore`
TODO
- `mFontColorHeader`
TODO
- `mFontColorHighlight`
TODO
- `mFontColorSelection`
TODO
- `mLineSpacing`
The spacing in virtual pixels between two lines in an `OptionMenu`.
<!-- EOF -->

View File

@ -0,0 +1,81 @@
# GameInfoStruct
Static information from `MAPINFO`/GameInfo.
```
struct GameInfoStruct
{
double Armor2Percent;
string ArmorIcon1;
string ArmorIcon2;
name BackpackType;
int GameType;
double GibFactor;
array<name> InfoPages;
bool IntermissionCounter;
bool NoRandomPlayerClass;
string mBackButton;
name mSliderColor;
GIFont mStatScreenEnteringFont;
GIFont mStatScreenFinishedFont;
GIFont mStatScreenMapNameFont;
}
```
- `Armor2Percent`
TODO
- `ArmorIcon1`
TODO
- `ArmorIcon2`
TODO
- `BackpackType`
TODO
- `GameType`
TODO
- `GibFactor`
TODO
- `InfoPages`
TODO
- `IntermissionCounter`
TODO
- `NoRandomPlayerClass`
TODO
- `mBackButton`
TODO
- `mSliderColor`
TODO
- `mStatScreenEnteringFont`
TODO
- `mStatScreenFinishedFont`
TODO
- `mStatScreenMapNameFont`
TODO
<!-- EOF -->

419
api-global-LevelLocals.md Normal file
View File

@ -0,0 +1,419 @@
# LevelLocals
Most map-relative data is stored in this structure.
```
struct LevelLocals
{
// Map data
array<Line> Lines;
array<Sector> Sectors;
array<Side> Sides;
internal array<SectorPortal> SectorPortals;
readonly array<Vertex> Vertexes;
// Stats
int Found_Items;
int Found_Secrets;
int Killed_Monsters;
int Total_Items;
int Total_Monsters;
int Total_Secrets;
// Time
readonly int MapTime;
readonly int ParTime;
readonly int StartTime;
readonly int SuckTime;
readonly int Time;
readonly int TotalTime;
// Map sequencing
readonly int Cluster;
readonly int ClusterFlags;
readonly string LevelName;
readonly int LevelNum;
readonly string MapName;
string NextMap;
string NextSecretMap;
readonly int MapType;
// Music
readonly string Music;
readonly int MusicOrder;
// Sky
readonly textureid SkyTexture1;
readonly textureid SkyTexture2;
float SkySpeed1;
float SkySpeed2;
// Physics
play double AirControl
play double AirFriction;
play int AirSupply;
play double Gravity;
// State
bool AllMap;
bool Frozen;
// Static info
string F1Pic;
readonly bool ActOwnSpecial;
readonly bool AllowRespawn;
readonly bool CheckSwitchRange;
readonly int FogDensity;
readonly bool Infinite_Flight;
readonly bool MissilesActivateImpact;
readonly bool MonsterFallingDamage;
readonly bool MonstersTelefrag;
readonly bool NoInventoryBar;
readonly bool NoMonsters;
readonly bool No_Dlg_Freeze;
readonly int OutsideFogDensity;
readonly float PixelStretch;
readonly bool PolyGrind;
readonly int SkyFog;
readonly bool SndSeqTotalCtrl;
readonly double TeamDamage;
double GetUDMFFloat(int type, int index, name key);
int GetUDMFInt(int type, int index, name key);
string GetUDMFString(int type, int index, name key);
bool ExecuteSpecial(int special, Actor activator, Line linedef, bool lineside, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0, int arg5 = 0);
void ChangeSky(textureid sky1, textureid sky2);
string FormatMapName(int mapnamecolor);
string GetChecksum() const;
void SetInterMusic(string nextmap);
string TimeFormatted(bool totals = false);
bool IsCrouchingAllowed() const;
bool IsFreelookAllowed() const;
bool IsJumpingAllowed() const;
static void GiveSecret(Actor activator, bool printmsg = true, bool playsound = true);
static void RemoveAllBots(bool fromlist);
static void StartSlideshow(name whichone = 'none');
static void WorldDone();
static clearscope vector3 SphericalCoords(vector3 viewpoint, vector3 targetPos, vector2 viewAngles = (0, 0), bool absolute = false);
static clearscope vector2 Vec2Diff(vector2 v1, vector2 v2);
static clearscope vector2 Vec2Offset(vector2 pos, vector2 dir, bool absolute = false);
static clearscope vector3 Vec2OffsetZ(vector2 pos, vector2 dir, double atz, bool absolute = false);
static clearscope vector3 Vec3Diff(vector3 v1, vector3 v2);
static clearscope vector3 Vec3Offset(vector3 pos, vector3 dir, bool absolute = false);
}
```
- `Lines`
TODO
- `Sectors`
TODO
- `Sides`
TODO
- `SectorPortals`
TODO
- `Vertexes`
TODO
- `Found_Items`
TODO
- `Found_Secrets`
TODO
- `Killed_Monsters`
TODO
- `Total_Items`
TODO
- `Total_Monsters`
TODO
- `Total_Secrets`
TODO
- `MapTime`
TODO
- `ParTime`
TODO
- `StartTime`
TODO
- `SuckTime`
TODO
- `Time`
TODO
- `TotalTime`
TODO
- `Cluster`
TODO
- `ClusterFlags`
TODO
- `LevelName`
TODO
- `LevelNum`
TODO
- `MapName`
TODO
- `NextMap`
TODO
- `NextSecretMap`
TODO
- `MapType`
TODO
- `Music`
TODO
- `MusicOrder`
TODO
- `SkyTexture1`
TODO
- `SkyTexture2`
TODO
- `SkySpeed1`
TODO
- `SkySpeed2`
TODO
- `AirControl`
TODO
- `AirSupply`
TODO
- `Gravity`
TODO
- `AllMap`
TODO
- `Frozen`
TODO
- `F1Pic`
TODO
- `ActOwnSpecial`
TODO
- `AllowRespawn`
TODO
- `CheckSwitchRange`
TODO
- `FogDensity`
TODO
- `Infinite_Flight`
TODO
- `MissilesActivateImpact`
TODO
- `MonsterFallingDamage`
TODO
- `MonstersTelefrag`
TODO
- `NoInventoryBar`
TODO
- `NoMonsters`
TODO
- `No_Dlg_Freeze`
TODO
- `OutsideFogDensity`
TODO
- `PixelStretch`
TODO
- `PolyGrind`
TODO
- `SkyFog`
TODO
- `SndSeqTotalCtrl`
TODO
- `TeamDamage`
TODO
- `GetUDMFFloat`
TODO
- `GetUDMFInt`
TODO
- `GetUDMFString`
TODO
- `ExecuteSpecial`
TODO
- `ChangeSky`
TODO
- `FormatMapName`
TODO
- `GetChecksum`
TODO
- `SetInterMusic`
TODO
- `TimeFormatted`
TODO
- `IsCrouchingAllowed`
TODO
- `IsFreelookAllowed`
TODO
- `IsJumpingAllowed`
TODO
- `GiveSecret`
TODO
- `RemoveAllBots`
TODO
- `StartSlideshow`
TODO
- `WorldDone`
TODO
- `SphericalCoords`
TODO
- `Vec2Diff`
TODO
- `Vec2Offset`
TODO
- `Vec2OffsetZ`
TODO
- `Vec3Diff`
TODO
- `Vec3Offset`
TODO
<!-- EOF -->

102
api-global-data-Client.md Normal file
View File

@ -0,0 +1,102 @@
# Client
TODO
```
KeyBindings AutomapBindings;
KeyBindings Bindings;
readonly Font BigFont;
readonly int CleanHeight;
readonly int CleanHeight_1;
readonly int CleanWidth;
readonly int CleanWidth_1;
readonly int CleanXFac;
readonly int CleanXFac_1;
readonly int CleanYFac;
readonly int CleanYFac_1;
readonly Font ConFont;
readonly Font IntermissionFont;
readonly Font SmallFont;
readonly Font SmallFont2;
ui float BackbuttonAlpha;
ui int BackbuttonTime;
ui int MenuActive;
ui BaseStatusBar StatusBar;
int LocalViewPitch;
```
- `AutomapBindings`
TODO
- `Bindings`
TODO
- `BigFont`
The `bigfont` for the current game.
- `CleanHeight`
The current screen height divided by `CleanYFac`. **Not deterministic.**
- `CleanHeight_1`
The current screen height divided by `CleanYFac_1`. **Not deterministic.**
- `CleanWidth`
The current screen width divided by `CleanXFac`. **Not deterministic.**
- `CleanWidth_1`
The current screen width divided by `CleanYFac_1`. **Not deterministic.**
- `CleanXFac`
Integral scaling factor for horizontal positions to scale from 320x200 to the current virtual resolution. **Not deterministic.**
- `CleanXFac_1`
Integral scaling factor for horizontal positions to scale from 320x200 to the current virtual resolution, accounting for aspect ratio differences. **Not deterministic.**
- `CleanYFac`
Integral scaling factor for vertical positions to scale from 320x200 to the current virtual resolution. **Not deterministic.**
- `CleanYFac_1`
Integral scaling factor for vertical positions to scale from 320x200 to the current virtual resolution, accounting for aspect ratio differences. **Not deterministic.**
- `ConFont`
The console font.
- `IntermissionFont`
The font used in intermission screens.
- `SmallFont`
The `smallfnt` for the current game.
- `SmallFont2`
The alternate `smallfnt`.
- `BackbuttonAlpha`
Alpha of the back button in menus.
- `BackbuttonTime`
The time until the back button starts fading out in menus.
- `MenuActive`
The current active menu state. One of:

View File

@ -0,0 +1,39 @@
# Constants
TODO
```
const MAXPLAYERNAME;
const MAXPLAYERS;
const DEFMELEERANGE;
const MISSILERANGE;
const PLAYERMISSILERANGE;
const SAWRANGE;
```
- `MAXPLAYERNAME`
The maximum length of a player name.
- `MAXPLAYERS`
The maximum amount of players in game.
- `DEFMELEERANGE`
The range where melee will be used for monsters, and the range for the player's melee attacks.
- `MISSILERANGE`
The maximum range for monster missile/hit-scan attacks.
- `PLAYERMISSILERANGE`
The maximum range for player missile/hit-scan attacks.
- `SAWRANGE`
The range of Doom's Chainsaw weapon.
<!-- EOF -->

81
api-global-data-Game.md Normal file
View File

@ -0,0 +1,81 @@
# Game State
TODO
```
readonly bool AutomapActive;
readonly bool DemoPlayback;
play uint GameAction;
readonly int GameState;
readonly int GameTic;
readonly uint8 GlobalFreeze;
play LevelLocals Level;
int ValidCount;
```
- `AutomapActive`
`true` if the auto-map is currently open on the client. **Not deterministic.**
- `DemoPlayback`
User is watching a demo.
- `GameAction`
Current global game action. May be one of:
| Name | Description |
| ---- | ----------- |
| `ga_autoloadgame` | Don't use this. |
| `ga_autosave` | Creates an autosave. |
| `ga_completed` | Don't use this. |
| `ga_fullconsole` | Don't use this. |
| `ga_loadgamehideicon` | Don't use this. |
| `ga_loadgameplaydemo` | Don't use this. |
| `ga_loadgame` | Don't use this. |
| `ga_loadlevel` | Don't use this. |
| `ga_newgame2` | Don't use this. |
| `ga_newgame` | Don't use this. |
| `ga_nothing` | Does nothing. |
| `ga_playdemo` | Don't use this. |
| `ga_recordgame` | Don't use this. |
| `ga_savegame` | Don't use this. |
| `ga_screenshot` | Takes a screenshot. |
| `ga_slideshow` | Don't use this. |
| `ga_togglemap` | Toggles the auto-map. |
| `ga_worlddone` | Don't use this. |
- `GameState`
Current global game state. May be one of:
| Name | Description |
| ---- | ----------- |
| `GS_DEMOSCREEN` | Inside a level but watching a demo in the main menu. |
| `GS_FINALE` | Reading a cluster end text or at the end sequence. |
| `GS_FULLCONSOLE` | Outside of a level, console only. |
| `GS_HIDECONSOLE` | Outside of a level, console hidden (i.e. main menu.) |
| `GS_INTERMISSION` | In between levels. |
| `GS_LEVEL` | Inside a level. |
| `GS_STARTUP` | Game not yet initialized. |
| `GS_TITLELEVEL` | Watching a `TITLEMAP` in the main menu. |
- `GameTic`
Number of game tics passed since engine initialization. **Not deterministic.**
- `GlobalFreeze`
TODO: I have no idea what the difference between this and `Level.Frozen` is.
- `Level`
All level info as defined in `LevelLocals`.
- `ValidCount`
Don't use this.
<!-- EOF -->

View File

@ -0,0 +1,54 @@
# Static Info
TODO
```
readonly array<class<Actor>> AllActorClasses;
readonly array<PlayerClass> PlayerClasses;
readonly array<PlayerSkin> PlayerSkins;
readonly array<Team> Teams;
play DEHInfo DEH;
readonly GameInfoStruct GameInfo;
readonly FOptionMenuSettings OptionMenuSettings;
readonly textureid SkyFlatNum;
readonly Weapon WP_NOCHANGE;
```
- `AllActorClasses`
As the name implies, an array of every actor class type reference.
- `PlayerClasses`
An array of all player classes as defined in `MAPINFO`/GameInfo and `KEYCONF`.
- `PlayerSkins`
An array of all player skins as defined in `SKININFO` and `S_SKIN`.
- `Teams`
An array of all teams. Maximum index is `Team.Max`.
- `DEH`
Static DeHackEd information.
- `GameInfo`
Static information from `MAPINFO`/GameInfo.
- `OptionMenuSettings`
Defaults for `OptionMenu`s as defined in `MENUDEF`'s `OptionMenuSettings` block and `MAPINFO`/GameInfo.
- `SkyFlatNum`
The texture ID for sky flats. `F_SKY1` by default in Doom.
- `WP_NOCHANGE`
A constant denoting that the weapon the player is currently holding shouldn't be switched from.
<!-- EOF -->

33
api-global-data-Player.md Normal file
View File

@ -0,0 +1,33 @@
# Players
TODO
```
readonly int ConsolePlayer;
readonly bool Multiplayer;
readonly int Net_Arbitrator;
readonly bool PlayerInGame[MAXPLAYERS];
play PlayerInfo Players[MAXPLAYERS];
```
- `ConsolePlayer`
Number of the player running the client. **Not deterministic.**
- `Multiplayer`
Game is networked.
- `Net_Arbitrator`
Number of the player who initiated or currently hosts the game.
- `PlayerInGame`
`true` if the player is currently in-game.
- `Players`
`PlayerInfo` structures for each player.
<!-- EOF -->

View File

@ -0,0 +1,18 @@
# Class Handling
TODO
```
Type GetDefaultByType(class<Actor> type);
Type New(class typename = ThisClass);
```
- `GetDefaultByType`
Returns an object containing the default values for each member of the `Actor` type provided as they would be set in `BeginPlay`. **Note that the return value cannot be serialized and if stored must be marked as `transient`.** The returned object is a pseudo-object which is stored only in-memory.
- `New`
Typically spelled lowercase (`new`), creates an object with type `typename`. Defaults to using the class of the calling object.
<!-- EOF -->

66
api-global-func-Game.md Normal file
View File

@ -0,0 +1,66 @@
# Game
TODO
```
string G_SkillName();
int G_SkillPropertyInt(int p);
double G_SkillPropertyFloat(int p);
vector3, int G_PickDeathmatchStart();
vector3, int G_PickPlayerStart(int pnum, int flags = 0);
```
- `G_SkillName`
The name of the skill in play.
- `G_SkillPropertyInt`
Returns a skill property. `p` may be:
| Name |
| ---- |
| `SKILLP_ACSReturn` |
| `SKILLP_AutoUseHealth` |
| `SKILLP_DisableCheats` |
| `SKILLP_EasyBossBrain` |
| `SKILLP_EasyKey` |
| `SKILLP_FastMonsters` |
| `SKILLP_Infight` |
| `SKILLP_NoPain` |
| `SKILLP_PlayerRespawn` |
| `SKILLP_RespawnLimit` |
| `SKILLP_Respawn` |
| `SKILLP_SlowMonsters` |
| `SKILLP_SpawnFilter` |
- `G_SkillPropertyFloat`
Returns a skill property. `p` may be:
| Name |
| ---- |
| `SKILLP_Aggressiveness` |
| `SKILLP_AmmoFactor` |
| `SKILLP_ArmorFactor` |
| `SKILLP_DamageFactor` |
| `SKILLP_DropAmmoFactor` |
| `SKILLP_FriendlyHealth` |
| `SKILLP_HealthFactor` |
| `SKILLP_MonsterHealth` |
- `G_PickDeathmatchStart`
Returns the position and angle of a random death-match start location.
- `G_PickPlayerStart`
Returns the position and angle of a player start for player `pnum`. `flags` may be:
| Name | Description |
| ---- | ----------- |
| `PPS_FORCERANDOM` | Always picks a random player spawn for this player. |
| `PPS_NOBLOCKINGCHECK` | Does not check if an object is blocking the player spawn. |
<!-- EOF -->

43
api-global-func-Math.md Normal file
View File

@ -0,0 +1,43 @@
# Math
TODO
```
Type Abs(Type n);
double ATan2(double y, double x);
uint BAM(double angle);
Type Clamp(Type n, Type minimum, Type maximum);
Type Max(Type n, Type maximum);
Type Min(Type n, Type minimum);
double VectorAngle(double x, double y);
```
- `Abs`
Returns `|n|` (absolute of `n`.)
- `ATan2`
Computes the arctangent of `y / x` using the arguments' signs to determine the correct quadrant.
- `BAM`
Returns a byte angle of `angle` (`degrees * (0x40000000 / 90.0)`.)
- `Clamp`
Returns `n` if `n` is more than `minimum` and less than `maximum`, or either of those values if it is not.
- `Max`
Returns `n` if `n` is less than `maximum`, or `maximum`.
- `Min`
Returns `n` if `n` is more than `minimum`, or `minimum`.
- `VectorAngle`
Same as `ATan2`, but with arguments reversed.
<!-- EOF -->

38
api-global-func-Random.md Normal file
View File

@ -0,0 +1,38 @@
# Random Number Generation
All of these functions may have `[identifier]` between the function name and the argument list to specify a named RNG table to use. This special syntax applies only to these functions.
```
double FRandom(double min, double max);
double FRandomPick(double...);
int Random(int min = 0, int max = 255);
int Random2(uint mask = uint.Max);
int RandomPick(int...);
void SetRandomSeed(uint num);
```
- `FRandom`
Returns a random float between `min` and `max`.
- `FRandomPick`
Same as `RandomPick`, but with floats.
- `Random`
Returns a random integer between `min` and `max`.
- `Random2`
Returns a random integer value between `-mask` and `mask`. `mask` is used as a bit mask, so it is recommended to use a value of one less than a power of two (i.e. 3, 7, 15, 31, 63, 127, 255...)
- `RandomPick`
Returns one of the provided parameters randomly.
- `SetRandomSeed`
Sets the seed of the RNG table to `num`.
<!-- EOF -->

81
api-global-func-Sound.md Normal file
View File

@ -0,0 +1,81 @@
# Sound
TODO
```
void SetMusicVolume(float vol);
bool S_ChangeMusic(string name, int order = 0, bool looping = true, bool force = false);
float S_GetLength(sound id);
void S_PauseSound(bool notmusic, bool notsfx);
void S_ResumeSound(bool notsfx);
void S_Sound(sound id, int channel, float volume = 1, float attenuation = ATTN_NORM);
```
- `SetMusicVolume`
Sets the volume of the music relative to the user's volume. Range is 0-1, inclusive.
- `S_ChangeMusic`
Changes the music to `name`. If `name` is `"*"`, the music will be set to the default music for this level. Will loop if `looping` is `true`. `force` will force the music to play even if a playlist (from the `playlist` console command) is playing.
`order` may mean something different based on the music format:
| Format | Meaning |
| ------ | ------- |
| Tracker music (`.mod`, `.xm`, etc.) | Specifies the order the song will start at. |
| Multi-track `.ogg`, `.flac`, etc. | Specifies the track to begin playing at. |
| Any other format | No meaning, will be ignored. |
- `S_GetLength`
Returns the length of a sound in seconds. **Potentially non-deterministic if all users in a networked game are not using the same sounds.**
- `S_PauseSound`
Pauses music if `notmusic` is `false` and all game sounds if `notsfx` is `false`. Used for instance in the time stop power-up.
- `S_ResumeSound`
Resumes playing music and, if `notsfx` is `false`, all game sounds as well.
- `S_Sound`
Plays a sound (as defined in `SNDINFO`) from the calling object if it has world presence (is an actor or sector etc.)
`channel` may be:
| Name | Description |
| ---- | ----------- |
| `CHAN_AUTO` | Automatically assigns the sound to a free channel (if one exists.) |
| `CHAN_BODY` | For footsteps and generally anything else. |
| `CHAN_ITEM` | For item pickups. |
| `CHAN_VOICE` | For player grunts. |
| `CHAN_WEAPON` | For weapon noises. |
| `CHAN_5` | Extra sound channel. |
| `CHAN_6` | Extra sound channel. |
| `CHAN_7` | Extra sound channel. |
`channel` may also have the following flags applied with the binary OR operator `|`:
| Name | Description |
| ---- | ----------- |
| `CHAN_LISTENERZ` | Sound ignores height entirely, playing at the listener's vertical position. |
| `CHAN_LOOP` | Continues playing the sound on loop until it is stopped manually. |
| `CHAN_MAYBE_LOCAL` | Does not play sound to other players if the silent pickup compatibility flag is enabled. |
| `CHAN_NOPAUSE` | Does not pause in menus or when `S_PauseSound` is called. |
| `CHAN_NOSTOP` | Does not start a new sound if the channel is already playing something. |
| `CHAN_UI` | Does not record sound in saved games or demos. |
Additionally, `CHAN_PICKUP` is equivalent to `CHAN_ITEM | CHAN_MAYBE_LOCAL`.
`attenuation` determines the drop-off distance of the sound. The higher the value, the quicker it fades. Constants include:
| Name | Value | Description |
| ---- | ----- | ----------- |
| `ATTN_IDLE` | `1.001` | Uses Doom's default sound attenuation. |
| `ATTN_NONE` | `0` | Does not drop off at all, plays throughout the whole map. |
| `ATTN_NORM` | `1` | Drops off using the `close_dist` and `clipping_dist` defined in `SNDINFO`. Default. |
| `ATTN_STATIC` | `3` | Drops off quickly, at around 512 units. |
<!-- EOF -->

18
api-global-func-System.md Normal file
View File

@ -0,0 +1,18 @@
# System
TODO
```
uint MSTime();
vararg void ThrowAbortException(string format, ...);
```
- `MSTime`
Returns the number of milliseconds since the engine was started. **Not deterministic.**
- `ThrowAbortException`
Kills the VM and ends the game (without exiting) with a formatted error.
<!-- EOF -->

View File

@ -0,0 +1,32 @@
# InterBackground
A class containing an animated intermission background.
```
class InterBackground play
{
static InterBackground Create(WBStartStruct wbs);
virtual void DrawBackground(int curstate, bool drawsplat, bool pointeron);
virtual bool LoadBackground(bool isenterpic);
virtual void UpdateAnimatedBack();
}
```
- `Create`
TODO
- `DrawBackground`
TODO
- `LoadBackground`
TODO
- `UpdateAnimatedBack`
TODO
<!-- EOF -->

32
api-inter-PatchInfo.md Normal file
View File

@ -0,0 +1,32 @@
# PatchInfo
Either a patch or string depending on external configurations.
```
struct PatchInfo play
{
int mColor;
Font mFont;
textureid mPatch;
void Init(GIFont gifont);
}
```
- `mColor`
The color of the font, if this is a string.
- `mFont`
The font, if this is a string, or `null`.
- `mPatch`
The patch, if this is a patch, or an invalid texture.
- `Init`
Initializes the structure. If `gifont.Color` is `'Null'`, and `gifont.FontName` is a valid patch, `mPatch` will be set accordingly. Otherwise, if the font has a color or the patch is invalid, `gifont.FontName` is used to set `mFont` (or it is defaulted to `BigFont`.)
<!-- EOF -->

401
api-inter-StatusScreen.md Normal file
View File

@ -0,0 +1,401 @@
# StatusScreen
The base class for intermission status screens. Any status screen used by `MAPINFO`/GameInfo must be derived from this class.
Status screens have four stages:
- `StatCount`, where the stats are counted and displayed.
- `ShowNextLoc`, where the next map is shown as "ENTERING (map name)" and in episodic maps, the world map.
- `NoState`, at the very end of this process, where the last frame is drawn and the intermission is exited.
- `LeavingIntermission`, which is used only to signify that all stages are done and the status screen has been exited.
These are provided as constants in `StatusScreen`. The starting stage is `StatCount`.
```
class StatusScreen abstract play
{
const NG_STATSY;
const SHOWNEXTLOCDELAY;
const SP_STATSX;
const SP_STATSY;
const SP_TIMEX;
const SP_TIMEY;
const TITLEY;
InterBackground BG;
WBPlayerStruct Plrs[MAXPLAYERS];
WBStartStruct WBS;
int AccelerateStage;
int BCnt;
int Cnt;
int Cnt_Deaths[MAXPLAYERS];
int Cnt_Frags[MAXPLAYERS];
int Cnt_Items[MAXPLAYERS];
int Cnt_Kills[MAXPLAYERS];
int Cnt_Par;
int Cnt_Pause;
int Cnt_Secret[MAXPLAYERS];
int Cnt_Time;
int Cnt_Total_Time;
int CurState;
int DoFrags;
int Me;
int NG_State;
bool NoAutoStartMap;
bool PlayerReady[MAXPLAYERS];
int Player_Deaths[MAXPLAYERS];
bool SNL_PointerOn;
int SP_State;
float ShadowAlpha;
int Total_Deaths;
int Total_Frags;
PatchInfo Entering;
PatchInfo Finished;
PatchInfo MapName;
textureid Items;
textureid Kills;
textureid P_Secret;
textureid Par;
textureid Secret;
textureid Sucks;
textureid Timepic;
string LNameTexts[2];
int DrawCharPatch(Font fnt, int charcode, int x, int y, int translation = Font.CR_UNTRANSLATED, bool nomove = false);
void DrawEL();
int DrawLF();
int DrawName(int y, textureid tex, string levelname);
int DrawNum(Font fnt, int x, int y, int n, int digits, bool leadingzeros = true, int translation = Font.CR_UNTRANSLATED);
int DrawPatchText(int y, PatchInfo pinfo, string stringname);
void DrawPercent(Font fnt, int x, int y, int p, int b, bool show_total = true, int color = Font.CR_UNTRANSLATED);
void DrawTime(int x, int y, int t, bool no_sucks = false);
bool AutoSkip();
virtual void Drawer();
virtual void End();
virtual void Start(WBStartStruct wbs_);
virtual void StartMusic();
virtual void Ticker();
protected virtual void DrawNoState();
protected virtual void DrawShowNextLoc();
protected virtual void DrawStats();
protected virtual void InitNoState();
protected virtual void InitShowNextLoc();
protected virtual void InitStats();
protected virtual void UpdateNoState();
protected virtual void UpdateShowNextLoc();
protected virtual void UpdateStats();
protected void CheckForAccelerate();
protected int FragSum(int playernum);
static int, int, int GetPlayerWidths();
static color GetRowColor(PlayerInfo player, bool highlight);
static void GetSortedPlayers(in out array<int> sorted, bool teamplay);
static void PlaySound(sound snd);
}
```
- `NG_STATSY`
TODO
- `SHOWNEXTLOCDELAY`
TODO
- `SP_STATSX`
TODO
- `SP_STATSY`
TODO
- `SP_TIMEX`
TODO
- `SP_TIMEY`
TODO
- `TITLEY`
The Y position (in 320x200 pixels) to draw the top of the "finished" and "entering" texts. Used by `DrawEL` and `DrawLF`.
- `BG`
The `InterBackground` object for this intermission, set by `Start` with the initial `WBS` object.
- `Plrs`
The value of `WBS.Plyr` when `Start` was called. Usually not changed, so essentially equivalent to `WBS.Plyr`.
- `WBS`
The `WBStartStruct` passed to this class via the `Start` function.
- `AccelerateStage`
Used to signify to the current stage that it should go quicker or be skipped entirely.
- `BCnt`
TODO
- `Cnt`
TODO
- `Cnt_Deaths`
TODO
- `Cnt_Frags`
TODO
- `Cnt_Items`
TODO
- `Cnt_Kills`
TODO
- `Cnt_Par`
TODO
- `Cnt_Pause`
TODO
- `Cnt_Secret`
TODO
- `Cnt_Time`
TODO
- `Cnt_Total_Time`
TODO
- `CurState`
The current stage the intermission is in.
- `DoFrags`
TODO
- `Me`
The value of `WBS.PNum` when `Start` was called. Usually not changed, so essentially equivalent to `WBS.PNum`.
- `NG_State`
TODO
- `NoAutoStartMap`
TODO
- `PlayerReady`
Used in networked games to signify when each player is ready to continue to the next map. Set by `CheckForAccelerate`.
- `Player_Deaths`
TODO
- `SNL_PointerOn`
TODO
- `SP_State`
Used in single-player status screens during the `StatCount` stage for indicating the current round of statistics to count up.
- `ShadowAlpha`
TODO
- `Total_Deaths`
TODO
- `Total_Frags`
TODO
- `Entering`
TODO
- `Finished`
TODO
- `MapName`
TODO
- `Items`
The "ITEMS" (default `WIOSTI`) graphic.
- `Kills`
The "KILLS" (default `WIOSTK`) graphic.
- `P_Secret`
The "SECRET" (default `WISCRT2`) graphic.
- `Par`
The "PAR" (default `WIPAR`) graphic.
- `Secret`
The "SCRT" (default `WIOSTS`) graphic.
- `Sucks`
The "SUCKS" (default `WISUCKS`) graphic.
- `Timepic`
The "TIME" (default `WITIME`) graphic.
- `LNameTexts`
TODO
- `DrawCharPatch`
TODO
- `DrawEL`
TODO
- `DrawLF`
TODO
- `DrawName`
TODO
- `DrawNum`
TODO
- `DrawPatchText`
TODO
- `DrawPercent`
TODO
- `DrawTime`
TODO
- `AutoSkip`
TODO
- `Drawer`
Called by `WI_Drawer`, which is called every frame when `GameState` is `GS_INTERMISSION`.
- `End`
Called when the intermission should end. Default behaviour is to set `CurState` to `LeavingIntermission` and remove bots in death-match. Generally, `Level.WorldDone` should be called directly after this.
- `Start`
Called by `WI_Start` after the `WBStartStruct` is populated, sounds are stopped and the screen blend is set to black. Sets up initial values and runs `InitStats`.
- `StartMusic`
Called in the first tick by `Ticker` to set the intermission music.
- `Ticker`
Called by `WI_Ticker`, which is called every game tick when `GameState` is `GS_INTERMISSION`.
- `DrawNoState`
Called by `Drawer` when `CurState` is `NoState` or any other non-state.
- `DrawShowNextLoc`
Called by `Drawer` when `CurState` is `ShowNextLoc` and, by default, `DrawNoState` after setting `SNL_PointerOn` to `true`.
- `DrawStats`
Called by `Drawer` directly after drawing the animated background when `CurState` is `StatCount`.
- `InitNoState`
Called by `UpdateShowNextLoc` to initiate the `NoState` stage.
- `InitShowNextLoc`
Called by `UpdateStats` to initiate the `ShowNextLoc` stage.
- `InitStats`
Called by `Start` to initiate the `StatCount` stage.
- `UpdateNoState`
Called by `Ticker` when `CurState` is `NoState` or any other non-state. Exits the intermission by calling `End` and `Level.WorldDone` when appropriate.
- `UpdateShowNextLoc`
Called by `Ticker` when `CurState` is `ShowNextLoc`. Runs `InitNoState` when appropriate and alternates `SNL_PointerOn`.
- `UpdateStats`
Called by `Ticker` when `CurState` is `StatCount`. Runs `InitShowNextLoc` when appropriate.
- `CheckForAccelerate`
Updates the values of `AccelerateStage` and `PlayerReady` according to each player's inputs.
- `FragSum`
Returns the number of frags player `playernum` has accumulated against all currently in-game players. This is different from `WBPlayerStruct.FragCount` because it is counted dynamically, i.e. if a player leaves the count will be changed. This is only useful for game modes where frags do not count as score.
- `GetPlayerWidths`
TODO
- `GetRowColor`
TODO
- `GetSortedPlayers`
TODO
- `PlaySound`
Plays a UI sound at full volume using `S_Sound`.
<!-- EOF -->

View File

@ -0,0 +1,42 @@
# WBPlayerStruct
Information for each individual player for a `StatusScreen`.
```
struct WBPlayerStruct
{
int SItems;
int SKills;
int SSecret;
int STime;
int FragCount;
int Frags[MAXPLAYERS];
}
```
- `SItems`
The number of items this player acquired.
- `SKills`
The number of monsters this player killed.
- `SSecret`
The number of secrets this player found.
- `STime`
The time this player finished the level at, in ticks. (This is the same for all players.)
- `FragCount`
The total amount of frags this player scored against all players.
- `Frags`
The number of frags this player scored against each other player.
<!-- EOF -->

View File

@ -0,0 +1,96 @@
# WBStartStruct
Information passed into the `StatusScreen` class when an intermission starts.
```
struct WBStartStruct
{
WBPlayerStruct Plyr[MAXPLAYERS];
int PNum;
int Finished_Ep;
int Next_Ep;
string Current;
string Next;
string NextName;
textureid LName0;
textureid LName1;
int MaxFrags;
int MaxItems;
int MaxKills;
int MaxSecret;
int ParTime;
int SuckTime;
int TotalTime;
}
```
- `Plyr`
The `WBPlayerStruct` for each player.
- `PNum`
The index of the player to show stats for.
- `Finished_Ep`
The cluster of the finished map, minus one.
- `Next_Ep`
The cluster of the next map, minus one.
- `Current`
The name of the map that was finished.
- `Next`
The name of the next map.
- `NextName`
The printable name of the next map.
- `LName0`
Texture ID of the level name of the map that was finished.
- `LName1`
Texture ID of the level name of the map being entered.
- `MaxFrags`
Unknown purpose, not actually used by any part of the engine.
- `MaxItems`
The maximum number of acquired items in the map.
- `MaxKills`
The maximum number of killed monsters in the map.
- `MaxSecret`
The maximum number of found secrets in the map.
- `ParTime`
The par time of the map, in ticks.
- `SuckTime`
The suck time of the map, in minutes.
- `TotalTime`
The total time for the whole game, in ticks.
<!-- EOF -->

5
api-level-F3DFloor.md Normal file
View File

@ -0,0 +1,5 @@
# F3DFloor
Currently empty. Does not expose any information.
<!-- EOF -->

31
api-level-FColorMap.md Normal file
View File

@ -0,0 +1,31 @@
# FColorMap
Describes the coloring of a sector.
```
struct FColorMap
{
uint8 BlendFactor;
uint8 Desaturation;
color FadeColor;
color LightColor;
}
```
- `BlendFactor`
TODO: "This is for handling Legacy-style color maps which use a different formula to calculate how the color affects lighting."
- `Desaturation`
How much to desaturate colors in this sector. Range is 0 to 255, inclusive.
- `FadeColor`
The color of fog in this sector. None if all components are 0.
- `LightColor`
The color of the sector. Default if all components are 0.
<!-- EOF -->

155
api-level-Line.md Normal file
View File

@ -0,0 +1,155 @@
# Line
Also known as a "linedef." A line segment with two sides and two vertices.
```
struct Line play
{
readonly Sector BackSector, FrontSector;
readonly double BBox[4];
readonly vector2 Delta;
readonly Side Sidedef[2];
readonly Vertex V1, V2;
readonly uint PortalIndex;
readonly uint PortalTransferred;
double Alpha;
uint Flags;
int ValidCount;
uint Activation;
int Args[5];
int LockNumber;
int Special;
int Index();
bool Activate(Actor activator, int side, int type);
bool RemoteActivate(Actor activator, int side, int type, vector3 pos);
Line GetPortalDestination();
bool IsLinePortal();
bool IsVisualPortal();
double GetUDMFFloat(name nm);
int GetUDMFInt(name nm);
string GetUDMFString(name nm);
}
```
- `BackSector`, `FrontSector`
The sector of the front and back sides of this line.
- `BBox`
The top, bottom, left and right of the line, respective to array index.
- `Delta`
Equivalent to `V2 - V1`.
- `V1`, `V2`
Returns the start and end points of this line segment, respectively.
- `Sidedef`
The front and back sides of this line, 0 and 1 respectively. The aliases `Line.Front` and `Line.Back` are provided as well.
- `PortalIndex`
TODO
- `PortalTransferred`
TODO
- `Alpha`
Alpha of the middle texture on both sides.
- `Flags`
Any combination of the following bit flags:
| 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. |
- `ValidCount`
Don't use this.
- `Activation`
TODO
- `Args`
Arguments of the line's special action.
- `LockNumber`
TODO
- `Special`
Number of the special action to be executed when this line is activated.
- `Index`
Returns the index of this line.
- `Activate`
TODO
- `RemoteActivate`
TODO
- `GetPortalDestination`
TODO
- `IsLinePortal`
TODO
- `IsVisualPortal`
TODO
- `GetUDMFFloat`, `GetUDMFInt`, `GetUDMFString`
Gets a named UDMF property attached to this linedef.
<!-- EOF -->

View File

@ -0,0 +1,22 @@
# LineIdIterator
Iterates over line indices with a specified tag.
```
class LineIdIterator
{
static LineIdIterator Create(int tag);
int Next();
}
```
- `Create`
Creates a new iterator over lines with tag `tag`.
- `Next`
Returns the index of the current line and advances the iterator. Returns -1 when the list is exhausted.
<!-- EOF -->

73
api-level-SecPlane.md Normal file
View File

@ -0,0 +1,73 @@
# SecPlane
TODO
```
struct SecPlane play
{
double D;
double NegiC;
vector3 Normal;
void ChangeHeight(double hdiff);
double GetChangedHeight(double hdiff) const;
double HeightDiff(double oldd, double newd = 0.0) const;
bool IsEqual(SecPlane other) const;
bool IsSlope() const;
int PointOnSide(vector3 pos) const;
double PointToDist(vector2 xy, double z) const;
double ZAtPointDist(vector2 v, double dist) const;
clearscope double ZAtPoint(vector2 v) const;
}
```
- `D`
TODO
- `NegiC`
TODO
- `Normal`
TODO
- `ChangeHeight`
TODO
- `GetChangedHeight`
TODO
- `HeightDiff`
TODO
- `IsEqual`
TODO
- `IsSlope`
TODO
- `PointOnSide`
TODO
- `PointToDist`
TODO
- `ZAtPointDist`
TODO
- `ZAtPoint`
TODO
<!-- EOF -->

41
api-level-SecSpecial.md Normal file
View File

@ -0,0 +1,41 @@
# SecSpecial
TODO
```
struct SecSpecial play
{
int DamageAmount;
int16 DamageInterval;
name DamageType;
int Flags;
int16 LeakyDamage;
int16 Special;
}
```
- `DamageAmount`
TODO
- `DamageInterval`
TODO
- `DamageType`
TODO
- `Flags`
TODO
- `LeakyDamage`
TODO
- `Special`
TODO
<!-- EOF -->

734
api-level-Sector.md Normal file
View File

@ -0,0 +1,734 @@
# Sector
TODO
```
struct Sector play
{
readonly FColormap ColorMap;
readonly color SpecialColors[5];
Actor SoundTarget;
int16 Special;
int16 LightLevel;
int16 SeqType;
int Sky;
name SeqName;
readonly vector2 CenterSpot;
int ValidCount;
Actor ThingList;
double Friction, MoveFactor;
int TerrainNum[2];
SectorEffect FloorData;
SectorEffect CeilingData;
SectorEffect LightingData;
uint8 SoundTraversed;
int8 StairLock;
int PrevSec;
int NextSec;
readonly array<Line> Lines;
readonly SecPlane FloorPlane;
readonly SecPlane CeilingPlane;
readonly Sector HeightSec;
uint BottomMap, MidMap, TopMap;
double Gravity;
name DamageType;
int DamageAmount;
int16 DamageInterval;
int16 LeakyDamage;
readonly uint16 ZoneNumber;
uint Flags;
uint16 MoreFlags;
SectorAction SecActTarget;
internal uint Portals[2];
readonly int PortalGroup;
readonly int SectorNum;
int Index();
double, Sector, F3DFloor NextHighestCeilingAt(double x, double y, double bottomz, double topz, int flags = 0);
double, Sector, F3DFloor NextLowestFloorAt(double x, double y, double z, int flags = 0, double steph = 0);
void RemoveForceField();
static Sector PointInSector(vector2 pt);
bool PlaneMoving(int pos);
int GetFloorLight();
int GetCeilingLight();
Sector GetHeightSec();
void TransferSpecial(Sector model);
void GetSpecial(out SecSpecial spec);
void SetSpecial(SecSpecial spec);
int GetTerrain(int pos);
void CheckPortalPlane(int plane);
double, Sector HighestCeilingAt(vector2 a);
double, Sector LowestFloorAt(vector2 a);
double, double GetFriction(int plane);
void SetXOffset(int pos, double o);
void AddXOffset(int pos, double o);
double GetXOffset(int pos);
void SetYOffset(int pos, double o);
void AddYOffset(int pos, double o);
double GetYOffset(int pos, bool addbase = true);
void SetXScale(int pos, double o);
double GetXScale(int pos);
void SetYScale(int pos, double o);
double GetYScale(int pos);
void SetAngle(int pos, double o);
double GetAngle(int pos, bool addbase = true);
void SetBase(int pos, double y, double o);
void SetAlpha(int pos, double o);
double GetAlpha(int pos);
int GetFlags(int pos);
int GetVisFlags(int pos);
void ChangeFlags(int pos, int and, int or);
int GetPlaneLight(int pos);
void SetPlaneLight(int pos, int level);
void SetColor(color c, int desat = 0);
void SetFade(color c);
void SetFogDensity(int dens);
double GetGlowHeight(int pos);
color GetGlowColor(int pos);
void SetGlowHeight(int pos, double height);
void SetGlowColor(int pos, color color);
void SetSpecialColor(int pos, color color);
textureid GetTexture(int pos);
void SetTexture(int pos, textureid tex, bool floorclip = true);
double GetPlaneTexZ(int pos);
void SetPlaneTexZ(int pos, double val, bool dirtify = false);
void ChangeLightLevel(int newval);
void SetLightLevel(int newval);
int GetLightLevel();
void AdjustFloorClip();
bool IsLinked(Sector other, bool ceiling);
bool PortalBlocksView(int plane);
bool PortalBlocksSight(int plane);
bool PortalBlocksMovement(int plane);
bool PortalBlocksSound(int plane);
bool PortalIsLinked(int plane);
void ClearPortal(int plane);
double GetPortalPlaneZ(int plane);
vector2 GetPortalDisplacement(int plane);
int GetPortalType(int plane);
int GetOppositePortalGroup(int plane);
double CenterFloor();
double CenterCeiling();
bool TriggerSectorActions(Actor thing, int activation);
int MoveFloor(double speed, double dest, int crush, int direction, bool hexencrush, bool instant = false);
int MoveCeiling(double speed, double dest, int crush, int direction, bool hexencrush);
Sector NextSpecialSector(int type, Sector prev);
double, Vertex FindLowestFloorSurrounding();
double, Vertex FindHighestFloorSurrounding();
double, Vertex FindNextHighestFloor();
double, Vertex FindNextLowestFloor();
double, Vertex FindLowestCeilingSurrounding();
double, Vertex FindHighestCeilingSurrounding();
double, Vertex FindNextLowestCeiling();
double, Vertex FindNextHighestCeiling();
double FindShortestTextureAround();
double FindShortestUpperAround();
Sector FindModelFloorSector(double floordestheight);
Sector FindModelCeilingSector(double floordestheight);
int FindMinSurroundingLight(int max);
double, Vertex FindLowestCeilingPoint();
double, Vertex FindHighestFloorPoint();
void SetEnvironment(string env);
void SetEnvironmentID(int envnum);
SeqNode StartSoundSequenceID(int chan, int sequence, int type, int modenum, bool nostop = false);
SeqNode StartSoundSequence(int chan, name seqname, int modenum);
SeqNode CheckSoundSequence(int chan);
void StopSoundSequence(int chan);
bool IsMakingLoopingSound();
bool IsSecret();
bool WasSecret();
void ClearSecret();
double GetUDMFFloat(name nm);
int GetUDMFInt(name nm);
string GetUDMFString(name nm);
}
```
- `ColorMap`
TODO
- `SpecialColors`
TODO
- `SoundTarget`
TODO
- `Special`
TODO
- `LightLevel`
TODO
- `SeqType`
TODO
- `Sky`
TODO
- `SeqName`
TODO
- `CenterSpot`
TODO
- `ValidCount`
TODO
- `ThingList`
TODO
- `Friction`
TODO
- `MoveFactor`
TODO
- `TerrainNum`
TODO
- `FloorData`
TODO
- `CeilingData`
TODO
- `LightingData`
TODO
- `SoundTraversed`
TODO
- `StairLock`
TODO
- `PrevSec`
TODO
- `NextSec`
TODO
- `Lines`
TODO
- `FloorPlane`
TODO
- `CeilingPlane`
TODO
- `HeightSec`
TODO
- `BottomMap`
TODO
- `MidMap`
TODO
- `TopMap`
TODO
- `Gravity`
TODO
- `DamageType`
TODO
- `DamageAmount`
TODO
- `DamageInterval`
TODO
- `LeakyDamage`
TODO
- `ZoneNumber`
TODO
- `Flags`
TODO
- `MoreFlags`
TODO
- `SecActTarget`
TODO
- `Portals`
TODO
- `PortalGroup`
TODO
- `SectorNum`
TODO
- `Index`
TODO
- `NextHighestCeilingAt`
TODO
- `NextLowestFloorAt`
TODO
- `RemoveForceField`
TODO
- `PointInSector`
TODO
- `PlaneMoving`
TODO
- `GetFloorLight`
TODO
- `GetCeilingLight`
TODO
- `GetHeightSec`
TODO
- `TransferSpecial`
TODO
- `GetSpecial`
TODO
- `SetSpecial`
TODO
- `GetTerrain`
TODO
- `CheckPortalPlane`
TODO
- `HighestCeilingAt`
TODO
- `LowestFloorAt`
TODO
- `GetFriction`
TODO
- `SetXOffset`
TODO
- `AddXOffset`
TODO
- `GetXOffset`
TODO
- `SetYOffset`
TODO
- `AddYOffset`
TODO
- `GetYOffset`
TODO
- `SetXScale`
TODO
- `GetXScale`
TODO
- `SetYScale`
TODO
- `GetYScale`
TODO
- `SetAngle`
TODO
- `GetAngle`
TODO
- `SetBase`
TODO
- `SetAlpha`
TODO
- `GetAlpha`
TODO
- `GetFlags`
TODO
- `GetVisFlags`
TODO
- `ChangeFlags`
TODO
- `GetPlaneLight`
TODO
- `SetPlaneLight`
TODO
- `SetColor`
TODO
- `SetFade`
TODO
- `SetFogDensity`
TODO
- `GetGlowHeight`
TODO
- `GetGlowColor`
TODO
- `SetGlowHeight`
TODO
- `SetGlowColor`
TODO
- `SetSpecialColor`
TODO
- `GetTexture`
TODO
- `SetTexture`
TODO
- `GetPlaneTexZ`
TODO
- `SetPlaneTexZ`
TODO
- `ChangeLightLevel`
TODO
- `SetLightLevel`
TODO
- `GetLightLevel`
TODO
- `AdjustFloorClip`
TODO
- `IsLinked`
TODO
- `PortalBlocksView`
TODO
- `PortalBlocksSight`
TODO
- `PortalBlocksMovement`
TODO
- `PortalBlocksSound`
TODO
- `PortalIsLinked`
TODO
- `ClearPortal`
TODO
- `GetPortalPlaneZ`
TODO
- `GetPortalDisplacement`
TODO
- `GetPortalType`
TODO
- `GetOppositePortalGroup`
TODO
- `CenterFloor`
TODO
- `CenterCeiling`
TODO
- `TriggerSectorActions`
TODO
- `MoveFloor`
TODO
- `MoveCeiling`
TODO
- `NextSpecialSector`
TODO
- `FindLowestFloorSurrounding`
TODO
- `FindHighestFloorSurrounding`
TODO
- `FindNextHighestFloor`
TODO
- `FindNextLowestFloor`
TODO
- `FindLowestCeilingSurrounding`
TODO
- `FindHighestCeilingSurrounding`
TODO
- `FindNextLowestCeiling`
TODO
- `FindNextHighestCeiling`
TODO
- `FindShortestTextureAround`
TODO
- `FindShortestUpperAround`
TODO
- `FindModelFloorSector`
TODO
- `FindModelCeilingSector`
TODO
- `FindMinSurroundingLight`
TODO
- `FindLowestCeilingPoint`
TODO
- `FindHighestFloorPoint`
TODO
- `SetEnvironment`
TODO
- `SetEnvironmentID`
TODO
- `StartSoundSequenceID`
TODO
- `StartSoundSequence`
TODO
- `CheckSoundSequence`
TODO
- `StopSoundSequence`
TODO
- `IsMakingLoopingSound`
TODO
- `IsSecret`
TODO
- `WasSecret`
TODO
- `ClearSecret`
TODO
- `GetUDMFFloat`
TODO
- `GetUDMFInt`
TODO
- `GetUDMFString`
TODO
<!-- EOF -->

22
api-level-SectorEffect.md Normal file
View File

@ -0,0 +1,22 @@
# SectorEffect
A thinker which is attached to a sector and effects it in some way.
```
class SectorEffect : Thinker
{
protected Sector m_Sector;
Sector GetSector();
}
```
- `m_Sector`
The sector this effect is attached to.
- `GetSector`
Returns the sector this effect is attached to.
<!-- EOF -->

110
api-level-Side.md Normal file
View File

@ -0,0 +1,110 @@
# Side
Also known as a "sidedef." One of the textured sides of a line. Each sidedef has three portions: Upper, middle, and lower. The middle texture is special as it can have translucency.
The three portions of a sidedef can be referred to with:
| Name | Description |
| ---- | ----------- |
| `Side.Top` | The upper portion. |
| `Side.Mid` | The middle portion. |
| `Side.Bottom` | The lower portion. |
```
struct Side play
{
readonly Line Linedef;
readonly Sector Sector;
uint8 Flags;
int16 Light;
int Index();
clearscope Vertex V1();
clearscope Vertex V2();
textureid GetTexture(int which);
double GetTextureXOffset(int which);
double GetTextureYOffset(int which);
double GetTextureXScale(int which);
double GetTextureYScale(int which);
void SetTexture(int which, textureid tex);
void SetTextureXOffset(int which, double offset);
void SetTextureYOffset(int which, double offset);
void SetTextureXScale(int which, double scale);
void SetTextureYScale(int which, double scale);
void AddTextureXOffset(int which, double delta);
void AddTextureYOffset(int which, double delta);
void MultiplyTextureXScale(int which, double delta);
void MultiplyTextureYScale(int which, double delta);
double GetUDMFFloat(name nm);
int GetUDMFInt(name nm);
string GetUDMFString(name nm);
}
```
- `Linedef`
The line this side belongs to.
- `Sector`
The sector this side belongs to.
- `Flags`
Any combination of the following bit flags:
| Name | Description |
| ---- | ----------- |
| `WALLF_ABSLIGHTING` | Light is absolute instead of relative to the sector. |
| `WALLF_CLIP_MIDTEX` | Clips the middle texture when it goes under the floor or above the ceiling. |
| `WALLF_LIGHT_FOG` | The wall's lighting will ignore fog effects. |
| `WALLF_NOAUTODECALS` | Don't attach decals to this surface. |
| `WALLF_NOFAKECONTRAST` | Disables the "fake contrast" effect for this side. |
| `WALLF_POLYOBJ` | This sidedef belongs to a polyobject. |
| `WALLF_SMOOTHLIGHTING` | Applies a unique contrast at all angles. |
| `WALLF_WRAP_MIDTEX` | Repeats the middle texture infinitely on the vertical axis. |
- `Light`
The light level of this side. Relative to the sector lighting unless `WALLF_ABSLIGHTING`.
- `Index`
Returns the index of this side.
- `V1`, `V2`
Returns the start and end points of this sidedef, respectively.
- `GetTexture`, `SetTexture`
Gets or sets the texture of one portion of the sidedef.
- `GetTextureXOffset`, `SetTextureXOffset`, `AddTextureXOffset`
Gets, sets or adds to the texture portion's horizontal offset.
- `GetTextureYOffset`, `SetTextureYOffset`, `AddTextureYOffset`
Gets, sets or adds to the texture portion's vertical offset.
- `GetTextureXScale`, `SetTextureXScale`, `MultiplyTextureXScale`
Gets, sets or multiplies the texture portion's horizontal scale.
- `GetTextureYScale`, `SetTextureYScale`, `MultiplyTextureYScale`
Gets, sets or multiplies the texture portion's vertical scale.
- `GetUDMFFloat`, `GetUDMFInt`, `GetUDMFString`
Gets a named UDMF property attached to this sidedef.
<!-- EOF -->

16
api-level-Vertex.md Normal file
View File

@ -0,0 +1,16 @@
# Vertex
A point in world space.
```
struct Vertex play
{
readonly vector2 P;
}
```
- `P`
The point this object represents.
<!-- EOF -->

42
api-player-PlayerClass.md Normal file
View File

@ -0,0 +1,42 @@
# PlayerClass
A player class as defined in either `MAPINFO`/GameInfo or `KEYCONF`.
```
struct PlayerClass
{
uint Flags;
array<int> Skins;
class<Actor> Type;
bool CheckSkin(int skin);
void EnumColorsets(out array<int> data);
name GetColorsetName(int setnum);
}
```
- `Flags`
Not currently implemented correctly, `PCF_NOMENU` does not exist in ZScript, but its value is `1` if you need to check for that.
- `Skins`
Skin indices available to this player class.
- `Type`
The class type reference for this player class.
- `CheckSkin`
Checks if `skin` is in `Skins`.
- `EnumColorsets`
TODO
- `GetColorsetName`
TODO
<!-- EOF -->

68
api-player-PlayerSkin.md Normal file
View File

@ -0,0 +1,68 @@
# PlayerSkin
A player skin as defined in `SKININFO` or `S_SKIN`.
```
struct PlayerSkin
{
int CrouchSprite;
string Face;
uint8 Gender;
int NameSpc;
bool OtherGame;
uint8 Range0End;
uint8 Range0Start;
vector2 Scale;
string SkinName;
int Sprite;
}
```
- `CrouchSprite`
The crouching sprite ID for this skin.
- `Face`
Prefix for statusbar face graphics.
- `Gender`
Default gender of the skin. May be one of the following:
| Name | Value | Description |
| ---- | :---: | ----------- |
| `GENDER_FEMALE` | `1` | Feminine. |
| `GENDER_MALE` | `0` | Masculine. |
| `GENDER_NEUTRAL` | `2` | Neutral. |
| `GENDER_OTHER` | `3` | Other (robot, zombie, etc.) |
- `NameSpc`
If this skin was defined in S_SKIN, this is the lump ID of the marker itself.
- `OtherGame`
The player skin is made for another game and needs to be color remapped differently.
- `Range0End`
The end index of the translation range to be used for changing the player sprite's color.
- `Range0Start`
The beginning index of the translation range to be used for changing the player sprite's color.
- `Scale`
The scaling factor used for the player sprite.
- `SkinName`
Name of the skin.
- `Sprite`
The sprite ID for this skin.
<!-- EOF -->

27
api-player-Team.md Normal file
View File

@ -0,0 +1,27 @@
# Team
A team as defined in `TEAMINFO`.
```
struct Team
{
const Max;
const NoTeam;
string mName;
}
```
- `Max`
The maximum number of teams.
- `NoTeam`
A constant index for a player with no team.
- `mName`
The name of the team.
<!-- EOF -->

42
api-sound-SeqNode.md Normal file
View File

@ -0,0 +1,42 @@
# SeqNode
A sound sequence (`SNDSEQ`) node.
```
class SeqNode
{
static name GetSequenceSlot(int sequence, int type);
static void MarkPrecacheSounds(int sequence, int type);
void AddChoice(int seqnum, int type);
bool AreModesSame(name n, int mode1);
bool AreModesSameID(int sequence, int type, int mode1);
name GetSequenceName();
}
```
- `GetSequenceSlot`
TODO
- `MarkPrecacheSounds`
TODO
- `AddChoice`
TODO
- `AreModesSame`
TODO
- `AreModesSameID`
TODO
- `GetSequenceName`
TODO
<!-- EOF -->

135
api-wep-PSprite.md Normal file
View File

@ -0,0 +1,135 @@
# PSprite
A **P**layer **Sprite**, paradoxically, is not the player themself, but the sprite *within their view*, such as their weapon. PSprites are arbitrarily layered by number, somewhat similar to `HUDMessage`s. They are drawn ordered from lowest to highest.
The predefined layers are:
| Name | Value | Description |
| ---- | :---: | ----------- |
| `PSprite.Flash` | `1000` | The layer used by `A_GunFlash` for gun flashes. |
| `PSprite.StrifeHands` | `-1` | The hands brought up by `A_ItBurnsItBurns` when the player in Strife dies of fire. |
| `PSprite.TargetCenter` | `int.Max - 2` | The middle of the targeting system view in Strife. |
| `PSprite.TargetLeft` | `int.Max - 1` | The left side of the targeting system view in Strife. |
| `PSprite.TargetRight` | `int.Max` | The right side of the targeting system view in Strife. |
| `PSprite.Weapon` | `1` | The default layer for all weapons. |
```
class PSprite play
{
readonly State CurState;
readonly int ID;
readonly PSprite Next;
readonly PlayerInfo Owner;
double Alpha;
Actor Caller;
bool FirstTic;
int Frame;
double OldX;
double OldY;
bool ProcessPending;
spriteid Sprite;
int Tics;
double X;
double Y;
bool bADDBOB;
bool bADDWEAPON;
bool bCVARFAST;
bool bFLIP;
bool bPOWDOUBLE;
void SetState(State newstate, bool pending = false);
void Tick();
}
```
- `CurState`
TODO
- `ID`
TODO
- `Next`
TODO
- `Owner`
TODO
- `Alpha`
The amount of translucency of the PSprite, range 0-1 inclusive.
- `Caller`
TODO
- `FirstTic`
TODO
- `Frame`
Frame number of the sprite.
- `OldX`
TODO
- `OldY`
TODO
- `ProcessPending`
TODO
- `Sprite`
The sprite to display on this layer.
- `Tics`
The number of game ticks before the next state takes over.
- `X`
The offset from the weapon's normal resting position on the horizontal axis.
- `Y`
The offset from the weapon's normal resting position on the vertical axis. Note that `32` is the real resting position because of `A_Raise`.
- `bADDBOB`
Adds the weapon's bobbing to this layer's offset.
- `bADDWEAPON`
Adds the weapon layer's offsets to this layer's offset.
- `bCVARFAST`
Layer will respect `sv_fastweapons`.
- `bFLIP`
Flips the weapon visually horizontally.
- `bPOWDOUBLE`
Layer will respect `PowerDoubleFiringSpeed`.
- `SetState`
TODO
- `Tick`
Called by `PlayerPawn::TickPSprites` to advance the frame.
<!-- EOF -->

1464
glossary-classes.md Normal file

File diff suppressed because it is too large Load Diff

84
glossary-concepts.md Normal file
View File

@ -0,0 +1,84 @@
# Concepts
* [Action Scoping](#action-scoping)
* [Object Scoping](#object-scoping)
* [Format String](#format-string)
* [Sprite](#sprite)
* [Game Tick](#game-tick)
* [Interpolation](#interpolation)
TODO
## Action Scoping
On classes derived from Actor, states and methods can be scoped to a certain subset of uses. This is mainly to differentiate actions which take place in inventory items and weapons, and actions which take place in the actual game map, for disambiguating the `self` pointer usage. The available scopes are:
| Name | Description |
| ---- | ----------- |
| `actor` | Actions are called from an actual map object. |
| `item` | Actions are called from an inventory item. |
| `overlay` | Actions are called from a weapon overlay. |
| `weapon` | Actions are called from a weapon. |
These can be defined either in the `states` block header as-is, or in `Actor`'s `DefaultStateUsage` property with the following bit flags:
| Name | Scope |
| ---- | ----- |
| `SUF_ACTOR` | `actor` |
| `SUF_ITEM` | `item` |
| `SUF_OVERLAY` | `overlay` |
| `SUF_WEAPON` | `weapon` |
## Object Scoping
Most objects are subject to object scoping, which restricts the way data can be used in certain contexts. This is to ensure that the game simulation does not get changed by the UI, for instance, or that the game simulation doesn't read from the UI and break network synchronization. In other words, it is to prevent a multitude of errors that arise when data is modified or read from the wrong places.
There are three scopes in ZScript: Play, UI, and Data (also known as "`clearscope`.") The Play scope is used for objects that are part of the game simulation and interact with the world in some way or another, while the UI scope is for objects that have no correlation with the world besides perhaps reading information from it. The Data scope is shared between the two, and must be used carefully.
Here is a chart of data access possibilities for each scope:
| | Data scope | Play scope | UI scope |
| - | ---------- | ---------- | ---------- |
| From Data context | Read/write | Read-only | No access |
| From Play context | Read/write | Read/write | No access |
| From UI context | Read/write | Read-only | Read/write |
## Format String
A format string is a string that specifies the format of a conversion from arbitrary data to a contiguous character string. A format string contains normal characters and *conversion specifiers*. See [this page](https://en.cppreference.com/w/c/io/fprintf) for more information. Differences between C's `printf` and ZScript formats include:
- Since there's no `char` type, `int` is used for `%c`.
- `%s` also works for `name`.
- No `%n` specifier.
- An additional conversion specifier `%B` exists which converts a number to binary.
- An additional conversion specifier `%H` exists which works like `%g` but automatically selects the smallest appropriate precision.
## Sprite
A sprite is stored in two numbers: the *sprite ID* (represented by the `spriteid` type or sometimes `int`) and the *sprite frame* (represented by an `int` or `uint8` usually.) The rotation is generally irrelevant as only the `0` (front rotation) frame is used in most contexts. The sprite frame is, unlike the file and state block representations, not a character, but an integer. The number `0` for instance represents the letter `A`, `1` to `B`, etc.
For more information on sprites and rotations, please refer to [the relevant Doom Wiki article](https://doomwiki.org/wiki/Sprite).
## Game Tick
The Doom engine, as long as it has existed and into every faithful-enough port of it, no matter how different from the source material, runs the game simulation in the same way:
- Input events are processed.
Keyboard, mouse, gamepad, etc. if a local player, the demo file if watching a demo, packets over the internet in networked games.
- The game is *ticked*.
Every 1/35th of a second that passes, a new "game tick" takes place, also referred to as *gametic*, *tick* or simply *tic*.
- The game is rendered.
All information from the *current* game tick is rendered. This usually happens more often than the game is actually ticked. In ZDoom, Eternity Engine, and some other ports, the information is interpolated between the last and current game tick when there is extra time available to give smoother rendering.
For more information on ticks, please refer to [the relevant Doom Wiki article](https://doomwiki.org/wiki/Tic).
## Interpolation
TODO
<!-- EOF -->

281
glossary-examples.md Normal file
View File

@ -0,0 +1,281 @@
# Examples
* [Class headers](#class-headers)
* [Class definitions](#class-definitions)
* [Property definitions](#property-definitions)
* [Structure definitions](#structure-definitions)
* [Enumeration definitions](#enumeration-definitions)
* [Constant definitions](#constant-definitions)
* [Include directives](#include-directives)
* [Function argument lists](#function-argument-lists)
* [Expression statements](#expression-statements)
* [Conditional statements](#conditional-statements)
* [Switch statements](#switch-statements)
* [Control flow statements](#control-flow-statements)
* [Multi-assignment statements](#multi-assignment-statements)
* [Member declarations](#member-declarations)
Code examples for ZScript demonstrating various features.
## Class headers
Various class headers.
```
class MyCoolObject // automatically inherits Object
class MyCoolScopedObject play // has Play scope
class MyCoolThinker : Thinker // inherits Thinker
class MyCoolActor : Actor replaces OtherActor
class MyCoolInterface abstract // can only be inherited
```
## Class definitions
Basic class definition with a member variable and member function.
```
class BasicClass
{
int m_thing;
void changeThing()
{
m_thing = 500;
}
}
```
Alternate syntax usage.
```
class TheWholeFileIsAClassOhNo;
int m_mymember;
// end of file
```
## Property definitions
A class with some properties.
```
class MyCoolActor : Actor
{
default
{
MyCoolActor.MyCoolMember 5000;
MyCoolActor.MyCoolMemberList 501, 502;
}
int m_myCoolMember;
int m_coolMember1, m_coolMember2;
property MyCoolMember: m_myCoolMember;
property MyCoolMemberList: m_coolMember1, m_coolMember2;
}
```
## Structure definitions
Simple structure.
```
struct MyCoolStructure
{
int x;
int y;
int z;
}
```
## Enumeration definitions
Basic enumeration.
```
enum MyCoolEnum
{
A, // has value int(0)
B, // 1 ...
C, // 2 ...
D // and 3
}
```
Less trivial example.
```
enum MyCoolerEnum : int16
{
A = 500, // has value int16(500)
B, // 501
C = 200,
D, // 201
E, // 202
};
```
## Constant definitions
Making an integer constant from a double.
```
const MyCoolInt = int(777.7777);
```
## Include directives
Basic includes.
```
#include "zscript/MyCoolMod/MyCoolClasses.zsc"
```
## Function argument lists
With the function:
```
void fn(int one, int two, int a = 0, int b = 0);
```
One could do the following:
```
fn(4, 5);
fn(5, 6, 7);
fn(6, 7, 8, 9);
```
Or using named default arguments,
```
fn(5, 6, a: 7);
fn(6, 7, b: 8);
fn(7, 8, a: 9, b: 10);
// equivalent to:
fn(5, 6, 7);
// (no equivalent, must use above)
fn(7, 8, 9, 10);
```
## Expression statements
Some basic expressions.
```
myCoolFunction(5, 4);
m_myCoolMember = 500;
5 * 5; // does nothing of course, but valid
```
## Conditional statements
Simple conditional.
```
if(a)
b();
```
Simple conditional, with else statement and a block.
```
if(a)
{
b();
c = d;
}
else
e = f;
```
## Switch statements
A switch demonstrating fall-through and default cases.
```
switch(a)
{
case 500: Console.Printf("a is 500"); break;
case 501: Console.Printf("a is 501"); // falls through to next case
case 502: Console.Printf("a is 501 or 502"); break;
default:
Console.Printf("not sure what a is!");
// break is implied here
}
```
## Control flow statements
Use of `continue`.
```
for(int i = 0; i < 50; i++)
{
if(i == 25) continue; // don't do anything on 25!
doThing(i);
}
```
Use of `break`.
```
for(int i = 0; i < 50; i++)
{
if(i == 25) break; // exit the loop at 25!
doThing(i);
}
```
Use of `return` in various contexts.
```
void returnsNothing()
{
if(m_thing != 50) return; // exit early if m_thing isn't 50.
doThing(m_thing);
}
int returnsInt()
{
if(m_thing == 50)
return 50; // m_thing is 50, so return 50.
return 0; // must have a return eventually
}
int, int returnsTwoInts()
{
return 1, 2; // returns 1 and 2.
}
```
## Multi-assignment statements
Getting the actor out of `A_SpawnItemEx`.
```
Actor mo;
bool spawned;
[spawned, mo] = A_SpawnItemEx("MyCoolActor");
```
## Member declarations
Some basic member variables.
```
int m_myCoolInt;
int m_coolInt1, m_coolInt2, m_coolInt3;
int[10] m_coolIntArray;
private int m_coolPrivateInt;
protected meta int m_coolMetaInt;
```
<!-- EOF -->

83
glossary-structures.md Normal file
View File

@ -0,0 +1,83 @@
# Structures
Here is a full list of all structures in ZScript as of GZDoom 3.7.0. There are 74 structures total. Note that some of these are merely implementation details and should not be used in code.
```
Struct
├ AutoUseHealthInfo
├ Console
├ ConsoleEvent
├ CVar
├ DamageTypeDefinition
├ DehInfo
├ Destructible
├ DropItem
├ DynArray_F32
├ DynArray_F64
├ DynArray_I16
├ DynArray_I32
├ DynArray_I8
├ DynArray_Obj
├ DynArray_Ptr
├ DynArray_String
├ F3DFloor
├ FCheckPosition
├ FColormap
├ FLineTraceData
├ Font
├ FOptionMenuSettings
├ FRailParams
├ FStateParamInfo
├ FTranslatedLineTarget
├ GameInfoStruct
├ GIFont
├ HealthGroup
├ InputEvent
├ JoystickConfig
├ KeyBindings
├ LevelLocals
├ Line
├ LinkContext
├ LookExParams
├ MugShot
├ OptionValues
├ PatchInfo
├ PlayerClass
├ PlayerEvent
├ PlayerInfo
├ PlayerSkin
├ RenderEvent
├ ReplaceEvent
├ SavegameManager
├ SaveGameNode
├ SBarInfo
├ Screen
├ SecPlane
├ SecSpecial
├ Sector
├ SectorPortal
├ Shader
├ Side
├ State
├ StrifeDialogueNode
├ StrifeDialogueReply
├ StringStruct
├ StringTable
├ Team
├ TerrainDef
├ TexMan
├ TraceResults
├ Translation
├ UiEvent
├ UserCmd
├ Vertex
├ VisStyle
├ Wads
├ WBPlayerStruct
├ WBStartStruct
├ WeaponSlots
├ WorldEvent
└ _
```
<!-- EOF -->

500
glossary-versions.md Normal file
View File

@ -0,0 +1,500 @@
# Versions
* [Version 3.1](#version-31)
* [Version 3.2](#version-32)
* [Version 3.2.1](#version-321)
* [Version 3.2.2](#version-322)
* [Version 3.2.3](#version-323)
* [Version 3.2.4](#version-324)
* [Version 3.2.5](#version-325)
* [Version 3.3](#version-33)
* [Version 3.3.1](#version-331)
* [Version 3.3.2](#version-332)
* [Version 3.4](#version-34)
* [Version 3.5](#version-35)
* [Version 3.5.1](#version-351)
* [Version 3.6](#version-36)
* [Version 3.7](#version-37)
Here is a list of differences between ZScript versions.
## Version 3.1
- Added `Actor::CheckFakeFloorTriggers`.
- Added `Actor::ORIG_FRICTION_FACTOR`.
- Added `Actor::ORIG_FRICTION`.
- Added `HarmonyStatusBar`.
- Added `LAF_OVERRIDEZ`.
- Added `LevelLocals::AllowRespawn`.
- Added `LevelLocals::IsCrouchingAllowed`.
- Added `LevelLocals::IsFreelookAllowed`.
- Added `LevelLocals::IsJumpingAllowed`.
- Added `ListMenuItemSlider::mDrawX`.
- Added `LocalViewPitch`.
- Added `PlayerInfo::Cmd`.
- Added `PlayerInfo::IsTotallyFrozen`.
- Added `PlayerInfo::Original_Cmd`.
- Added `PlayerInfo::Uncrouch`.
- Added `PlayerPawn::BestWeapon`.
- Added `PlayerPawn::Bob`.
- Added `PlayerPawn::CROUCHSPEED`.
- Added `PlayerPawn::CalcHeight`.
- Added `PlayerPawn::CheckAirSupply`.
- Added `PlayerPawn::CheckCheats`.
- Added `PlayerPawn::CheckCrouch`.
- Added `PlayerPawn::CheckDegeneration`.
- Added `PlayerPawn::CheckEnvironment`.
- Added `PlayerPawn::CheckFOV`.
- Added `PlayerPawn::CheckFrozen`.
- Added `PlayerPawn::CheckJump`.
- Added `PlayerPawn::CheckMoveUpDown`.
- Added `PlayerPawn::CheckMusicChange`.
- Added `PlayerPawn::CheckPitch`.
- Added `PlayerPawn::CheckPoison`.
- Added `PlayerPawn::CheckUndoMorph`.
- Added `PlayerPawn::CheckUse`.
- Added `PlayerPawn::CheckWeaponButtons`.
- Added `PlayerPawn::CheckWeaponChange`.
- Added `PlayerPawn::CheckWeaponFire`.
- Added `PlayerPawn::CrouchMove`.
- Added `PlayerPawn::DeathThink`.
- Added `PlayerPawn::FireWeaponAlt`.
- Added `PlayerPawn::FireWeapon`.
- Added `PlayerPawn::ForwardThrust`.
- Added `PlayerPawn::HandleMovement`.
- Added `PlayerPawn::MovePlayer`.
- Added `PlayerPawn::PlayerThink`.
- Added `PlayerPawn::TURN180_TICKS`.
- Added `PlayerPawn::TickPSprites`.
- Added `PlayerPawn::TweakSpeeds`.
- Added `SBarInfo::GetProtrusion`.
- Added `SVEFlagSpot*`.
- Added `SVELight`.
- Added `UserCmd`.
- Added `offsetz` parameter to `Actor::LineAttack`.
- Added override for `DoomStatusBar::DrawAutomapHUD`.
- Added override for `SBarInfoWrapper::GetProtrusion`.
- Made `PlayerInfo::Cls` not `readonly`.
## Version 3.2
- Added `+DYNAMICLIGHT.ADDITIVE`.
- Added `+DYNAMICLIGHT.ATTENUATE`.
- Added `+DYNAMICLIGHT.SUBTRACTIVE`.
- Added `+ZDOOMTRANS`.
- Added `Actor::A_SoundVolume`.
- Added `Actor::CameraFOV`.
- Added `Actor::CheckPortalTransition`.
- Added `Actor::FloatBobStrength`.
- Added `Actor::RenderHidden`.
- Added `Actor::RenderRequired`.
- Added `ActorRenderFeatureFlag`.
- Added `DropItem::Amount`.
- Added `FCheckPosition::PortalGroup`.
- Added `Font::CR_FIRE`.
- Added `Font::CR_ICE`.
- Added `Font::CR_SAPPHIRE`.
- Added `Font::CR_TEAL`.
- Added `Font::TEXTCOLOR_FIRE`.
- Added `Font::TEXTCOLOR_ICE`.
- Added `Font::TEXTCOLOR_SAPPHIRE`.
- Added `Font::TEXTCOLOR_TEAL`.
- Added `LevelLocals::GiveSecret`.
- Added `Shader`.
- Added `String::IndexOf`.
- Added `String::LastIndexOf`.
- Added `String::ToDouble`.
- Added `String::ToInt`.
- Added `String::ToLower`.
- Added `String::ToUpper`.
- Added `TEXTCOLOR_FIRE`.
- Added `TEXTCOLOR_ICE`.
- Added `TEXTCOLOR_SAPPHIRE`.
- Added `TEXTCOLOR_TEAL`.
- Added `Thinker::STAT_USER_MAX`.
- Added `Thinker::STAT_USER`.
- Changed `Screen::SetCameraToTexture`'s `fov` parameter to `double`.
- Fixed `BlockLinesIterator::Create*` returning the wrong type.
## Version 3.2.1
- Added `GameInfoStruct::mSliderColor`.
## Version 3.2.2
- Added `Actor::Warp`.
- Added `CVar::GetBool`.
- Added `CVar::SetBool`.
- Added `EmptyTokenType`.
- Added `LAF_ABSOFFSET`.
- Added `LAF_ABSPOSITION`.
- Added `LAF_TARGETISSOURCE`.
- Added `PlayerPawn::GetClassicFlight`.
- Added `String::Remove`.
- Added `String::Split`.
- Added `TexMan::GetName`.
- Added `Wads::CheckNumForFullName`.
- Added `Wads::FindLumpNamespace`.
- Added `Wads::FindLump`.
- Added `Wads::ReadLump`.
- Added `endIndex` parameter for `String::LastIndexOf`.
- Added `offsetforward` and `offsetside` parameters for `Actor::LineAttack`.
- Made `Array::Find` be `const`.
- Made `Array::Max` be `const`.
## Version 3.2.3
- Made `Ceiling::CreateCeiling` be `static`.
## Version 3.2.4
- Added `DMG_NO_PAIN`.
## Version 3.2.5
- Added `Actor::CheckMove`.
- Added `ECheckMoveFlags`.
- Added `LevelLocals::PixelStretch`.
- Added `LevelLocals::Vec2Diff`.
- Added `LevelLocals::Vec3Diff`.
- Added `SKILLP_PlayerRespawn`.
- Added `Screen::DrawLine`.
- Added `alpha2` parameter to `Actor::A_SetBlend`.
- Changed `Thinker::Tics2Seconds`' logic.
## Version 3.3
- Added `Actor::ACS_ScriptCall`.
- Added `Actor::Distance2DSquared`.
- Added `Actor::Distance3DSquared`.
- Added `Actor::FriendlySeeBlocks`.
- Added `Actor::GetRadiusDamage`.
- Added `Actor::LineTrace`.
- Added `Array` specialization for `Object`.
- Added `BaseStatusBar::AttachMessage`.
- Added `BaseStatusBar::DI_MIRROR`.
- Added `BaseStatusBar::DetachAllMessages`.
- Added `BaseStatusBar::DetachMessageID`.
- Added `BaseStatusBar::DetachMessage`.
- Added `BaseStatusBar::EHUDMSGLayer`.
- Added `CHAN_LOOP`.
- Added `DynamicLight::SpotInnerAngle`.
- Added `DynamicLight::SpotOuterAngle`.
- Added `ETrace*`, `ELineTier`, `ELineTraceFlags`.
- Added `FLineTargetData`.
- Added `HudMessageBase`.
- Added `Inventory::AltHUDIcon`.
- Added `LevelLocals::ChangeSky`.
- Added `LevelLocals::GetChecksum`.
- Added `LevelLocals::SkySpeed1`.
- Added `LevelLocals::SkySpeed2`.
- Added `LevelLocals::SkyTexture1`.
- Added `LevelLocals::SkyTexture2`.
- Added `LineTracer`.
- Added `Object::S_GetLength`.
- Added `OptionMenuItemCommand::mCloseOnSelect`.
- Added `OptionMenuItemLabeledSubmenu`.
- Added `OptionMenuItemOptionBase::IsGrayed`.
- Added `ReverbEdit`.
- Added `Screen::GetViewWindow`.
- Added `Sector::CeilingData`.
- Added `Sector::FloorData`.
- Added `Sector::LightingData`.
- Added `SectorEffect::GetSector`.
- Added `SpotLight* classes`.
- Added `StaticEventHandler::PostUiTick`.
- Added `StaticEventHandler::WorldLineActivated`.
- Added `StaticEventHandler::WorldLinePreActivated`.
- Added `StrifeDialogueNode::MenuClassName`.
- Added `StrifeDialogueNode::UserData`.
- Added `TraceResults`.
- Added `WorldEvent::ActivatedLine`.
- Added `WorldEvent::ShouldActivate`.
- Default parameters in overridden virtual functions are now an error.
- Made `SecPlane::HeightDiff` be `const`.
- Made `SecPlane::ZatPoint` be `clearscope`.
- Made `Side::V1` be `clearscope`.
- Made `Side::V2` be `clearscope`.
- Made `Weapon::CheckAmmo` and `Weapon::DepleteAmmo` be `virtual`.
- Renamed `DynamicLight::ELightType::SpotLight` to `DummyLight`.
## Version 3.3.1
- Made `A_SetSize`'s `radius` parameter have a default.
- Made `Side::Sector` and `Side::Linedef` be `readonly`.
- Made all `DehInfo` members `readonly`.
- Made all `State` members `readonly`.
## Version 3.3.2
- Added `Line::Activate`.
- Added `Line::RemoteActivate`.
- Added `SPAC`.
## Version 3.4
- Added "`internal`" keyword.
- Added `Actor::OnGiveSecret`.
- Added `DTA_Color`.
- Added `DTA_Desaturate`.
- Added `DTA_FlipY`.
- Added `DTA_SrcHeight`.
- Added `DTA_SrcWidth`.
- Added `DTA_SrcX`.
- Added `DTA_SrcY`.
- Added `LevelLocals::Vec2OffsetZ`.
- Added `LevelLocals::Vec2Offset`.
- Added `LevelLocals::Vec3Offset`.
- Added `Line::ESide`.
- Added `WorldEvent::ActivationType`.
- Changed `PlayerPawn::ResetAirSupply`'s `playgasp` default to `true`.
- Made `LevelLocals::SectorPortals` be `internal`.
- Made `Sector::Portals` be `internal`.
## Version 3.5
- Added `DTA_LegacyRenderStyle`.
- Added `MeansOfDeath` parameter to `Actor::Die`.
- Added `Menu::SetVideoMode`.
- Added `Screen::DrawShape`.
- Added `Shape2D`.
- Replaced `ListMenuItemPlayerDisplay::mTranslation` with `mBaseColor` and `mAddColor`.
## Version 3.5.1
- Added `String::RightIndexOf`.
- Deprecated `String::LastIndexOf`.
- Made `Actor::AbsAngle` be `clearscope`.
- Made `Actor::AngleToVector` be `clearscope`.
- Made `Actor::BobSin` be `clearscope`.
- Made `Actor::DeltaAngle` be `clearscope`.
- Made `Actor::FindState` be `clearscope`.
- Made `Actor::GetDefaultSpeed` be `clearscope`.
- Made `Actor::GetDropItems` be `clearscope`.
- Made `Actor::Normalize180` be `clearscope`.
- Made `Actor::RotateVector` be `clearscope`.
## Version 3.6
- Added `Actor::A_CheckForResurrection`.
- Added `Actor::A_RaiseSelf`.
- Added `Actor::CanRaise`.
- Added `Actor::Revive`.
- Added `DMG_EXPLOSION`.
- Added `GLTextureGLOptions`.
- Added `Inventory::OnDrop`.
- Added `LevelLocals::SphericalCoords`.
- Added `Screen::DrawThickLine`.
- Added `StaticEventHandler::CheckReplacement`.
- Added `StaticEventHandler::NewGame`.
- Added `TRF_SOLIDACTORS`, `TRF_BLOCKUSE`, and `TRF_BLOCKSELF`.
- Made `StatusScreen::End` be `virtual`.
## Version 3.7
- Added "`flagdef`" keyword.
- Added `"AddShaded"` RenderStyle.
- Added `"ColorAdd"` RenderStyle.
- Added `"ColorBlend"` RenderStyle.
- Added `"Multiply"` RenderStyle.
- Added `ALF_NOWEAPONCHECK`.
- Added `Actor::AimBulletMissile`.
- Added `Actor::ApplyKickBack`.
- Added `Actor::Blocking3DFloor`.
- Added `Actor::BlockingCeiling`.
- Added `Actor::BlockingFloor`.
- Added `Actor::CanResurrect`.
- Added `Actor::CheckFor3DCeilingHit`.
- Added `Actor::CheckFor3DFloorHit`.
- Added `Actor::CheckMonsterUseSpecials`.
- Added `Actor::CheckSplash`.
- Added `Actor::DaggerAlert`.
- Added `Actor::DefMorphTicks`.
- Added `Actor::DestroyAllInventory`.
- Added `Actor::DisplayNameTag`.
- Added `Actor::DoGiveInventory`.
- Added `Actor::DoTakeInventory`.
- Added `Actor::GetAge`.
- Added `Actor::GetLevelSpawnTime`.
- Added `Actor::Grind`.
- Added `Actor::InitSpawnedItem`.
- Added `Actor::Morph`.
- Added `Actor::MorphedDeath`.
- Added `Actor::RadiusAttack`.
- Added `Actor::RailAttack`.
- Added `Actor::RaiseActor`.
- Added `Actor::RestoreRenderStyle`.
- Added `Actor::ShouldSpawn`.
- Added `Actor::SpawnLineAttackBlood`.
- Added `Actor::SpawnTime`.
- Added `Actor::Substitute`.
- Added `Actor::TriggerPainChance`.
- Added `Actor::UnMorph`.
- Added `Actor::VelIntercept`.
- Added `Actor::bBounceOnUnrippables`.
- Added `Actor::bDontBounceOnSky`.
- Added `Actor::bNOFRICTIONBOUNCE`.
- Added `Actor::bNOFRICTION`.
- Added `AllClasses`.
- Added `Alpha` parameter to `Screen::DrawLine`.
- Added `Alpha` parameter to `Screen::DrawThickLine`.
- Added `AltHud`.
- Added `AmbientSound::MarkAmbientSounds`.
- Added `AutoUseHealthInfo`.
- Added `BaseStatusBar::UpdateScreenGeometry`.
- Added `Bobbing`.
- Added `DMG_NO_ENHANCE`.
- Added `Decal::SpawnDecal`.
- Added `Destructible`.
- Added `DynamicLight::SetOffset`.
- Added `EChangeLevelFlags`.
- Added `EFinishLevelType`.
- Added `EPlayerGender`.
- Added `FLineTraceData::TRACE_HasHitSky`.
- Added `FRailParams`.
- Added `Font::GetBottomAlignOffset`.
- Added `GameInfoStruct::BerserkPic`.
- Added `GameInfoStruct::DefKickBack`.
- Added `GameInfoStruct::DefaultBloodColor`.
- Added `GameInfoStruct::DefaultDropStyle`.
- Added `GameInfoStruct::HealthPic`.
- Added `GameInfoStruct::TeleFogHeight`.
- Added `HealthGroup`.
- Added `IntermissionSequenceType`.
- Added `Inventory::PrevInv`.
- Added `Inventory::SetGiveAmount`.
- Added `Inventory::UseAll`.
- Added `Key::GetKeyTypeCount`.
- Added `Key::GetKeyType`.
- Added `LevelLocals::CLUSTER_HUB`.
- Added `LevelLocals::DeathSequence`.
- Added `LevelLocals::GetAutomapPosition`.
- Added `LevelLocals::IsPointInMap`.
- Added `LevelLocals::KeepFullInventory`.
- Added `LevelLocals::RemoveItems`.
- Added `LevelLocals::StartIntermission`.
- Added `Line::GetHealth`.
- Added `Line::HealthGroup`.
- Added `Line::Health`.
- Added `Line::SetHealth`.
- Added `MorphedMonster::FlagsSave`.
- Added `MorphedMonster::UndoMonsterMorph`.
- Added `NetGame`.
- Added `Object::MarkSound`.
- Added `PF_HITSKY`.
- Added `PSprite::ResetInterpolation`.
- Added `PlayerInfo::GetDeltaViewHeight`.
- Added `PlayerInfo::GetWBobSpeed`.
- Added `PlayerPawn::ActivateMorphWeapon`.
- Added `PlayerPawn::AutoUseHealth`.
- Added `PlayerPawn::AutoUseStrifeHealth`.
- Added `PlayerPawn::BobWeapon`.
- Added `PlayerPawn::BringUpWeapon`.
- Added `PlayerPawn::CheatMorph`.
- Added `PlayerPawn::CheatSetInv`.
- Added `PlayerPawn::CheatTakeWeaps`.
- Added `PlayerPawn::CurBob`.
- Added `PlayerPawn::DropWeapon`.
- Added `PlayerPawn::EndAllPowerupEffects`.
- Added `PlayerPawn::FilterCoopRespawnInventory`.
- Added `PlayerPawn::FindMostRecentWeapon`.
- Added `PlayerPawn::GetTeleportFreezeTime`.
- Added `PlayerPawn::GiveDefaultInventory`.
- Added `PlayerPawn::InitAllPowerupEffects`.
- Added `PlayerPawn::InvNext`.
- Added `PlayerPawn::InvPrev`.
- Added `PlayerPawn::MarkPlayerSounds`.
- Added `PlayerPawn::MorphPlayer`.
- Added `PlayerPawn::NUM_WEAPON_SLOTS`.
- Added `PlayerPawn::PickNewWeapon`.
- Added `PlayerPawn::PickNextWeapon`.
- Added `PlayerPawn::PickPrevWeapon`.
- Added `PlayerPawn::PickWeapon`.
- Added `PlayerPawn::PlayerFinishLevel`.
- Added `PlayerPawn::TeleportFreezeTime`.
- Added `PlayerPawn::UndoPlayerMorph`.
- Added `RadiusDamageFlags`.
- Added `SKILLP_KickBackFactor`.
- Added `ScriptUtil`.
- Added `SecActDamage3D`.
- Added `SecActDamageCeiling`.
- Added `SecActDamageFloor`.
- Added `SecActDeath3D`.
- Added `SecActDeathCeiling`.
- Added `SecActDeathFloor`.
- Added `Sector::AdditiveColors`.
- Added `Sector::GetHealth`.
- Added `Sector::HealthCeilingGroup`.
- Added `Sector::HealthCeiling`.
- Added `Sector::HealthFloorGroup`.
- Added `Sector::HealthFloor`.
- Added `Sector::SECF_NOATTACK`.
- Added `Sector::SetAdditiveColor`.
- Added `Sector::SetHealth`.
- Added `SectorAction::SECSPAC_Damage3D`.
- Added `SectorAction::SECSPAC_DamageCeiling`.
- Added `SectorAction::SECSPAC_DamageFloor`.
- Added `SectorAction::SECSPAC_Death3D`.
- Added `SectorAction::SECSPAC_DeathCeiling`.
- Added `SectorAction::SECSPAC_DeathFloor`.
- Added `SectorPart`.
- Added `Side::EnableAdditiveColor`.
- Added `Side::GetAdditiveColor`.
- Added `Side::SetAdditiveColor`.
- Added `Side::SetSpecialColor`.
- Added `Side::WallBottom`.
- Added `Side::WallTop`.
- Added `State::InStateSequence`.
- Added `StaticEventHandler::WorldLineDamaged`.
- Added `StaticEventHandler::WorldSectorDamaged`.
- Added `TRACE_HasHitSky`.
- Added `Vertex::Index`.
- Added `Weapon::CheckAddToSlots`.
- Added `Weapon::DoReadyWeaponDisableSwitch`.
- Added `Weapon::DoReadyWeaponToBob`.
- Added `Weapon::DoReadyWeaponToFire`.
- Added `Weapon::DoReadyWeaponToSwitch`.
- Added `Weapon::GetButtonStateFlags`.
- Added `Weapon::PlayUpSound`.
- Added `Weapon::PostMorphWeapon`.
- Added `Weapon::SlotPriority`.
- Added `WeaponSlots::GetWeapon`.
- Added `WeaponSlots::SetupWeaponSlots`.
- Added `WeaponSlots::SlotSize`.
- Added `WorldEvent::DamageIsRadius`.
- Added `WorldEvent::DamageLineSide`.
- Added `WorldEvent::DamageLine`.
- Added `WorldEvent::DamagePosition`.
- Added `WorldEvent::DamageSectorPart`.
- Added `WorldEvent::DamageSector`.
- Added `WorldEvent::NewDamage`.
- Changed `PlayerInfo::PremorphWeapon`'s type to `Weapon`.
- Deprecated `Actor::CheckClass`.
- Deprecated `Actor::GetAngle`.
- Deprecated `Actor::GetDistance`.
- Deprecated `Actor::GetSpriteAngle`.
- Deprecated `Actor::GetSpriteRotation`.
- Deprecated `PlayerInfo::BringUpWeapon`.
- Deprecated `PlayerInfo::DropWeapon`.
- Deprecated `PlayerInfo::MorphPlayer`.
- Deprecated `PlayerInfo::UndoPlayerMorph`.
- Deprecated `Weapon::MinAmmo1`.
- Deprecated `Weapon::MinAmmo2`.
- Deprecated `Weapon::WeaponFlags`.
- Made `Actor::A_PlaySound` be `clearscope`.
- Made `Actor::ClearInventory` be `virtual`.
- Made `Actor::GetPointer` be `clearscope`.
- Made `Actor::InStateSequence` be `static`.
- Made `Actor::MorphMonster` be `virtual`.
- Made `Actor::UseInventory` be `virtual`.
- Made `Ammo::GetParentAmmo` be `virtual`.
- Made `BaseStatusBar::ArtiFlashTick` be `clearscope`.
- Made `BaseStatusBar::FlashItem` be `clearscope`.
- Made `BaseStatusBar::ItemFlashFade` be `clearscope`.
- Made `Inventory::ModifyDropAmount` be `virtual`.
- Made `Object::ChangeStatNum` not be `virtual`.
- Made `Sector::PointInSector` be `clearscope`.
- Made `Weapon::SlotNumber` be `meta`.
- Made `WeaponSlots::LocateWeapon` be `const`.
<!-- EOF -->

46
tools/tocgen.rb Normal file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env ruby
## Distributed under the CC0 public domain license.
## Originally by Alison Sanderson.
## <https://creativecommons.org/publicdomain/zero/1.0/legalcode>
## TOCGen: Generates inter-file TOCs.
$d = Dir["*.md"]
def filter_emit r
res = []
for m in $d.map{|p| p.match r}.compact
res << "* [#{m[1]}](#{m[0]})"
end
res.join ?\n
end
def find_toc_areas f
f.to_enum(:scan, /^(<!-- toc (.+) -->)(?:.|\n)*?(<!-- toc end -->)/i).map{$~}
end
def filter_toc_areas f
o = String.new
lof = 0
for area in find_toc_areas f
of = area.offset 0
o << f[lof...of[0]]
o << area[1]
o << "\n\n"
o << filter_emit(yield area[2])
o << "\n\n"
o << area[3]
lof = of[1]
end
o << f[lof..-1]
o
end
def rewrite fnam
f = File.read fnam
o = yield f
File.write fnam, o
end
rewrite "2-api.md" do |f| filter_toc_areas f do |a| /api-#{a}-(\w+).md/ end end
## EOF