Detecting if a DMFLAG is off or on.
Detecting if a DMFLAG is off or on.
How would you go about detecting whether a particular DMFLAG (No Monsters for example) is off or on from the number outputted when you GetCvar DMFlags?
RE: Detecting if a DMFLAG is off or on.
Converting the number to binary might help.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

RE: Detecting if a DMFLAG is off or on.
Do you have access to an AND operator in your expressions? If so, find out the number for that DMFLAG and then take the GetCVar DMFlags number and AND it with the number for that particular DMFLAG. The result will be 0 if the flag is off and the DMFLAG's number if it is on.
"For the world is hollow, and I have touched the sky."
RE: Detecting if a DMFLAG is off or on.
Code: Select all
if (GetCVar ("sv_nomonsters"))
{
// ...
}-
TerminusEst13
- Retired Staff / Community Team Member
- Posts: 865
- Joined: Tue Jun 05, 2012 11:06 pm
RE: Detecting if a DMFLAG is off or on.
Every sum total of dmflags or dmflags2 or etc is the result of singular cvars being turned on and off. The question is just checking for that flag.
dmflags 4096, for example, means sv_nomonsters is 1. dmflags 16384 means sv_itemrespawn is 1. Etc.
dmflags 4096, for example, means sv_nomonsters is 1. dmflags 16384 means sv_itemrespawn is 1. Etc.
The Ranger - New class for HeXen.
ZDoom Wars - I drew some pictures.
Samsara - Some class-based mod I guess?
Metroid: Dreadnought - I am a dumb fanboy.
DemonSteele - ~come with me to anime world~
ZDoom Wars - I drew some pictures.
Samsara - Some class-based mod I guess?
Metroid: Dreadnought - I am a dumb fanboy.
DemonSteele - ~come with me to anime world~