flags

Set of 'switches' that can be either set ('on') or reset ('off'). All flags are reset by default. Flags can be set in the definition, and set, reset, or read at run time.

Remarks:

Example (C-Script):

ENTITY* gun { ... flags = BRIGHT | PASSABLE; ... }
...
gun.ZNEAR = ON;  // set the ZNEAR flag of the gun object
gun.ZNEAR = OFF; // reset the ZNEAR flag of the gun object
if (gun.ZNEAR == ON) { ... } // read the ZNEAR flag of the my object

Example (lite-C):

ENTITY* gun { ... flags = BRIGHT | PASSABLE; ... }
...
gun.flags |= ZNEAR;  // set the ZNEAR flag of the my object
gun.flags &= ~ZNEAR; // reset the ZNEAR flag of the my object
if (gun.flags & ZNEAR) { ... } // read the ZNEAR flag of the my object
 LC  For convenience, some macros were defined in acknex.h for setting, resetting, toggling, or testing flags:
#define set(obj,flag) obj.flags |= (flag)
#define reset(obj,flag) obj.flags &= ~(flag)
#define toggle(obj,flag) obj.flags ^= (flag)
#define is(obj,flag) (obj.flags & (flag))
...
set(my,ZNEAR);
reset(my,ZNEAR);
toggle(my,ZNEAR);
if is(my,ZNEAR) { ... }
        
 LC  In lite-C several flags can be set an reset in one single statement:
mypanel.flags |= (SHOW | LIGHT | OVERLAY);
set(mypanel, SHOW | LIGHT | OVERLAY);
► latest version online