A_RemoveFlags
From DoomWiki.org
A_RemoveFlags(flags, flags2) is a monster function that is part of the MBF21 specification. It allows flags to be removed from an actor in-game; the opposite of A_AddFlags. The function has two parameters, using the values provided in the "Args1" and "Args2" fields as arguments.
The first argument specifies the non-MBF21 flag(s) to be removed from the calling actor, using the decimal value of the flag (e.g., 512 to remove NOGRAVITY, 16384 to remove FLOAT), while the second argument does the same for MBF21-specific flags (e.g., 32 to remove HIGHERMPROB, 128 to remove NOTHRESHOLD). If more than one flag of either type is to be removed, the sum of the values has to be input instead (e.g., 16896 to input NOGRAVITY and FLOAT in the "Args1" field). Removing flags that are not set will have no effect.
Example[edit]
The following is an example of how to set the A_RemoveFlags
code pointer in a DeHackEd file using BEX syntax:
Frame 507 Args1 = 16896 Args2 = 0 [CODEPTR] FRAME 507 = RemoveFlags
Or using DECOHack syntax:
state 507 { HEAD E 3 A_RemoveFlags(NOGRAVITY+FLOAT, 0) }
The above example uses A_RemoveFlags
to remove the NOGRAVITY and FLOAT flags from the cacodemon when triggering its pain state, rendering it unable to fly.
External links[edit]
- A_RemoveFlags in the DSDA-Doom source code, hosted on GitHub.
- MBF21 specification, hosted on GitHub.