SetActorFlag

From ZDoom Wiki
Jump to: navigation, search

int SetActorFlag (int tid, str flagname, bool value);

Usage

Change the value of a flag on the actor(s) with the specified TID.

Parameters

  • tid: TID of the actor(s) to affect. Use 0 to refer to the activator.
  • flagname: Name of the flag to change.
  • value: The new flag value.

Return value

The number of actors affected. Actors that match the TID but don't have the flag are not counted (e.g. changing a player flag on a non-player).

Example

This script spawns a Soulsphere as a secret item.

 script "SpawnSecretSoulsphere" (int spottid)
 {
   int soulsphere_tid = 100;
   if (SpawnSpotForced("Soulsphere", spottid, soulsphere_tid))
   {
     SetActorFlag(soulsphere_tid, "COUNTSECRET", TRUE);
   }
 }

See also