GetClassName

From ZDoom Wiki
Jump to navigation Jump to search

Name GetClassName ()

Usage

Returns the class name of the calling class. This can be called on any ZScript class and isn't limited to actors.

Return value

Returns the name of the calling class as a name data type.

Examples

This replacement of the Revenant's missiles will print out the class name of the actor it is locked on to roughly every second.

class AnnouncingRevenantTracer : RevenantTracer replaces RevenantTracer
{
	States
	{
		Spawn:
			FATB ABABABABABABABAB 2 BRIGHT A_Tracer();
			FATB A 0
			{
				if (tracer) //Make sure the projectile actually has a valid tracer pointer.
				{
					Console.PrintF ("I spy a %s with my little eye.", tracer.GetClassName());
				}
			}
			Loop;
	}
}