CheckClass (ACS)

From ZDoom Wiki
Jump to navigation Jump to search

bool CheckClass (str classname);

Usage

Checks to see if the specified actor class is a valid class or not.

Parameters

  • classname: The name of the actor class to check.

Return value

The function returns true if the specified actor class is valid, otherwise it returns false.

Examples

The following checks to see if the actor class "CoolThing" exists and, if it does, it prints a message to confirm as much. If "CoolThing" does not exist, then a message is printed confirming that instead.

Script 100 OPEN
{
    if (CheckClass("CoolThing"))
    {
        Print(s:"The Cool Thing exists.");
    }
    else
    {
        Print(s:"The Cool Thing does not exist.");
    }
}