GetMapRotationSize: Difference between revisions

From Zandronum Wiki
(Forgot to indicate that this is only available in 3.1-alpha right now.)
(Add example)
Tag: Source edit
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{ACSWarning}}
{{ACSWarning}}


int '''GetMapRotationSize''' (void) {{Devfeature|3.1|alpha}}
int '''GetMapRotationSize''' (void)


==Usage==
== Usage ==
=== Return value ===
Returns the number of map entries that are currently in the map rotation.
 
== Examples ==
<syntaxhighlight lang="c" line="1">
// This script prints the indices and names of the maps in the rotation when the map loads.
Script 1 OPEN {
int size = GetMapRotationSize();
Log(d: size, s: " maps are in the rotation.");
 
// Note: the list starts at 1; position 0 is the current map.
for (int i = 1; i <= size; i++)
{
Log(
d: i, s: ". ",
s: GetMapRotationInfo(i, MAPROTATION_LumpName), s: " - ",
s: GetMapRotationInfo(i, MAPROTATION_Name)
);
}
}
</syntaxhighlight>


Returns the number of map entries that are currently in the map rotation.
== See also ==
* [[GetMapRotationInfo]]


[[category:ACS Functions]]
[[category:ACS functions]]

Latest revision as of 22:16, 21 August 2022

This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.

int GetMapRotationSize (void)

Usage

Return value

Returns the number of map entries that are currently in the map rotation.

Examples

// This script prints the indices and names of the maps in the rotation when the map loads.
Script 1 OPEN {
	int size = GetMapRotationSize();
	Log(d: size, s: " maps are in the rotation.");

	// Note: the list starts at 1; position 0 is the current map.
	for (int i = 1; i <= size; i++)
	{
		Log(
			d: i, s: ". ",
			s: GetMapRotationInfo(i, MAPROTATION_LumpName), s: " - ",
			s: GetMapRotationInfo(i, MAPROTATION_Name)
		);
	}
}

See also