MBF21
Availability
ZandroX only among Zandronum versions. A DeHackEd patch written for MBF21 (and DSDHacked) loads as written, as in UZDoom and DSDA-Doom. The DECORATE names below are UZDoom's, except the codepointers, which UZDoom keeps for DeHackEd alone: a DECORATE mod that calls them loads here and in no other port.
Works in netgames. The server decides every MBF21 attack, death and flag change, and clients receive it.
Usage
MBF21 extends DeHackEd so a patch can give things and weapons new behaviour without DECORATE: new thing and weapon flags, infighting and projectile groups, codepointers that take arguments, and more states, sprites, sounds and things than vanilla had (DEHEXTRA and DSDHacked). ZandroX reads all of it and turns it into the same actor flags and functions DECORATE uses, so a patch and a DECORATE mod can work on the same actors.
How to host an MBF21 mapset (COMPLVL, UMAPINFO, the compatibility modes and sv_autocompat) is on
Boom and MBF mapsets.
DeHackEd
Thing fields
| Field | Effect |
|---|---|
MBF21 Bits |
The flags below, by name or number. |
Infighting group |
Monsters in the same group never fight each other. |
Projectile group |
Projectiles from a monster in the group do not hurt others in it; -1 takes away all immunity, so they hurt even the shooter's own species. |
Splash group |
Splash damage from a monster in the group does not hurt others in it. |
Rip sound |
The sound a ripper makes on each thing it passes through. |
Fast speed |
The speed used when fast monsters are on. |
Melee range |
How far the thing's melee attack reaches. |
Dropped item |
The thing number dropped on death; 0 drops nothing. |
Thing flags (MBF21 Bits)
Each flag becomes the DECORATE flag or property beside it, so A_JumpIfFlagsSet and the DECORATE checks read
the same state.
| MBF21 bit | Effect | DECORATE equivalent |
|---|---|---|
LOGRAV |
One eighth gravity. | Gravity 0.125 |
SHORTMRANGE |
Missile attacks only within 896 units. | MaxTargetRange 896 |
DMGIGNORED |
Other monsters ignore its attacks. | +NOTARGET |
NORADIUSDMG |
Takes no splash damage. | +NORADIUSDMG |
FORCERADIUSDMG |
Its splash damage hurts NORADIUSDMG things too. |
+FORCERADIUSDMG |
HIGHERMPROB |
Attacks with missiles more often. | +MISSILEEVENMORE |
RANGEHALF |
Counts targets as half as far away when deciding to attack. | +MISSILEMORE |
NOTHRESHOLD |
Switches target at once when hurt. | +QUICKTORETALIATE |
LONGMELEE |
Melee reach of 196 units. | MeleeThreshold 196 |
BOSS |
Full-volume sounds, and no splash damage unless the patch says otherwise. | +BOSS +NORADIUSDMG |
MAP07BOSS1, MAP07BOSS2 |
Counts as MAP07's Mancubus or Arachnotron. | +MAP07BOSS1, +MAP07BOSS2 |
E1M8BOSS, E2M8BOSS, E3M8BOSS, E4M6BOSS, E4M8BOSS |
Counts as that map's boss. | +E1M8BOSS and so on |
RIP |
A ripper projectile. | +RIPPER |
FULLVOLSOUNDS |
See and death sounds at full volume. | +FULLVOLSEE +FULLVOLDEATH |
Weapon fields
| Field | Effect |
|---|---|
MBF21 Bits |
NOTHRUST (no knockback), SILENT (does not wake monsters), NOAUTOFIRE (holding fire after switching does not shoot), FLEEMELEE (monsters treat it as melee), AUTOSWITCHFROM (switch away when out of ammo), NOAUTOSWITCHTO (never switched to on pickup). |
Ammo per shot |
Ammo each shot uses. |
Frame fields
| Field | Effect |
|---|---|
MBF21 Bits |
SKILL5FAST: the frame runs at half length when fast monsters are on. |
Args1 to Args8 |
The codepointer's arguments, in the frame's own units (fixed point for distances and angles). |
Codepointers
| Codepointer | What it does | Runs as |
|---|---|---|
A_SpawnObject |
Spawns a thing at an offset, with a velocity. | A_SpawnObject |
A_MonsterProjectile |
Fires a projectile at the target, with an angle, pitch and offsets. | A_MonsterProjectile |
A_MonsterBulletAttack |
Fires bullets at the target. | A_MonsterBulletAttack |
A_MonsterMeleeAttack |
Hits the target if within melee range. | A_MonsterMeleeAttack |
A_RadiusDamage |
Splash damage around the thing. | A_Explode |
A_NoiseAlert |
Wakes monsters that can hear. | A_AlertMonsters |
A_HealChase |
Chases, and raises a corpse it finds, like the Arch-vile. | A_HealChase |
A_SeekTracer, A_FindTracer, A_ClearTracer |
Homing on, finding and dropping a tracer. | same names |
A_JumpIfHealthBelow |
Jumps when health is below a value. | A_JumpIfHealthLower |
A_JumpIfTargetInSight, A_JumpIfTracerInSight |
Jumps when the target or tracer is in view. | A_JumpIfTargetInLOS, A_JumpIfTracerInSight |
A_JumpIfTargetCloser, A_JumpIfTracerCloser |
Jumps when the target or tracer is near. | A_JumpIfCloser, A_JumpIfTracerCloser |
A_JumpIfFlagsSet, A_AddFlags, A_RemoveFlags |
Tests, sets and clears Bits and MBF21 Bits flags. |
same names |
A_WeaponProjectile, A_WeaponBulletAttack, A_WeaponMeleeAttack |
The player's weapon attacks. | same names |
A_WeaponSound, A_WeaponAlert |
Plays a sound; wakes monsters. | A_PlaySound, A_AlertMonsters |
A_WeaponJump, A_CheckAmmo, A_RefireTo, A_GunFlashTo |
Weapon jumps: by chance, on low ammo, on refire, and to a flash state. | same names |
A_ConsumeAmmo |
Uses ammo. | A_ConsumeAmmo |
DEHEXTRA and DSDHacked
Things, states, sprites and sounds past vanilla's are numbered without limit. A thing past the stock ones is a
DECORATE class named Deh_Actor_<N>, so DECORATE can replace or inherit from it.
DECORATE
Flags
| Flag | Effect |
|---|---|
+FULLVOLSEE |
The see sound plays at full volume, everywhere on the map. |
+MAP07BOSS1, +MAP07BOSS2 |
Counts as MAP07's Mancubus (lowers tag 666) or Arachnotron (raises tag 667). |
+E1M8BOSS, +E2M8BOSS, +E3M8BOSS, +E4M6BOSS, +E4M8BOSS |
Counts as that map's boss. |
A boss flag acts through A_BossDeath in the actor's death state, on maps whose MAPINFO has the matching special
(map07special, baronspecial, cyberdemonspecial, spidermastermindspecial, or e1m8special and its kin).
When every monster that counts is dead, the map's special runs.
The groups are the properties InfightingGroup, ProjectileGroup and SplashGroup
(UZDoom's DECORATE features).
Codepointers
Every codepointer above can also be called from DECORATE under the name in the Runs as column. In DECORATE, angles and pitches are in degrees and offsets in map units, and every argument is optional.
An Imp that throws three fireballs, 10 degrees apart:
actor ZxFireball : DoomImp replaces DoomImp
{
States
{
Missile:
TROO EF 8 A_FaceTarget
TROO G 6 A_MonsterProjectile("DoomImpBall", -10)
TROO G 0 A_MonsterProjectile("DoomImpBall", 0)
TROO G 0 A_MonsterProjectile("DoomImpBall", 10)
Goto See
}
}
ZandroX only: UZDoom names these MBF21_* and gives them to DeHackEd alone, so DECORATE that calls them
does not load in UZDoom. A mod meant for both should use DeHackEd for them, or UZDoom's own functions.
Online
The server runs the monsters' codepointers and decides every death, and clients receive the results.
Implementation notes
- features/mbf21: the DeHackEd fields, flag tables, groups and the conformance patch that uses every MBF21 field and codepointer.