GetLevelInfo
From ZDoom Wiki
int GetLevelInfo (int levelinfo)
Usage
This function provides you with properties of the current map. If you want to find out the level time, use Timer.
Parameters
- levelinfo
- The level information to get:
- LEVELINFO_PAR_TIME
- Par time of the map.
- LEVELINFO_CLUSTERNUM
- Number of the current cluster.
- LEVELINFO_LEVELNUM
- Number of the map.
- LEVELINFO_TOTAL_SECRETS
- Number of secrets in the map.
- LEVELINFO_FOUND_SECRETS
- Number of already revealed secrets.
- LEVELINFO_TOTAL_ITEMS
- Number of items (health/armor bonuses etc.).
- LEVELINFO_FOUND_ITEMS
- Number of picked up items.
- LEVELINFO_TOTAL_MONSTERS
- Number of monsters.
- LEVELINFO_KILLED_MONSTERS
- Number of killed monsters.
Return value
Returns value of the specified level property or 0 when the property is unknown.
Examples
This script reports on the player's progress on killing monsters. Similar to the killcount on the automap.
script 2 (void)
{
int mtotal = GetLevelInfo (LEVELINFO_TOTAL_MONSTERS),
mkilled = GetLevelInfo (LEVELINFO_KILLED_MONSTERS);
if (mkilled == mtotal)
PrintBold (s:"You have killed all the monsters!");
else
PrintBold (s:"You have killed ", d:mkilled, s:" monsters!\n",
d:mtotal-mkilled, s:" left to go!");
}

