GetSpawnableType

From ZDoom Wiki
Jump to navigation Jump to search


Actor

static class<Actor> GetSpawnableType (int spawnnum)

Usage

Retrieves the class of the actor that is associated with the specified spawn number.

Parameters

  • spawnnum: the spawn number by which to retrieve the actor class.

Return value

A class pointer to the actor class. If no actor class with the spawn number is found, null is returned.

Examples

Upon pickup, this item spawns a hell knight in front of the player.

class HellKnightSummoner : CustomInventory
{
    States
    {
    Spawn:
        SOUL ABCD 6 Bright;
        Loop;

    Pickup:
        TNT1 A 0
        {
            let kind = GetSpawnableType(113);

            if (kind)
            {
                A_SpawnItemEx(kind, 64);
                return true;
            }

            return false;
        }
    }
}