SetIdle

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 (SearchTimer >= 48)
				{
					A_ClearTarget();
					SetIdle();
				}
				SearchTime++;
				A_Chase();
			}
			Loop;
	}
}

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.