SetIdle

From ZDoom Wiki
Jump to navigation Jump to search

Void SetIdle(bool nofunction)

Usage

Sets the calling actor to its' Idle state, if it doesn't have one, then the actor is set to its' Spawn state instead.

Parameters

  • nofunction - False by default. If true, the actor will not execute the action function in the frame of the first state it goes to.

Examples

This Cacodemon is lazy. And will stop chasing it's target after a few seconds.

Class LazyCaco : Cacodemon Replaces Cacodemon
{
	Int SearchTime;
	States
	{
		See:
			HEAD A 3
			{
				If (SearchTime >= 48)
				{
					A_ClearTarget();
					SetIdle();
				}
				SearchTime++;
				A_Chase();
			}
			Loop;
	}
}