dhelogo2.gif (5079 bytes)

Code pointers.

Code pointers are entered in the frame table.  They make a frame call a particular set of instructions and execute them for the thing using the frame.  This can be a simple wait to wake up (look and listen for the player) or it could be the instruction to fire a weapon or let out a death scream.

The table below lays out the code pointer to be entered when asked for a codepointer in the frame table editor, a description of the function associated with that code pointer and the BEX alias that can be used in a bex file to get the same result.  Additional BEX and Zdoom code pointers are listed at the bottom.   The first table just lists the player weapon code pointers.  These can only be used for player weapon frames.  Similarly, monster code pointers can not be used for player weapon frames.  Pointers 3 and 4 have a description in the document I used to generate this table which seems to contradict the team TNT bex documentation.   Personally I would trust the TNT version.

Player Weapon Codepointers

Code pointer Description BEX Alias
1 Light restore (after flash) Light0
2 Weapon bobbing pointer WeaponReady
3 Weapon select pointer Lower
4 Weapon deselect pointer Raise
6 Payer Punch Punch
9 button still held, jump back to first shooting frame instead of frame with this pointer) ReFire
14 Player Pistol shot FirePistol
17 Light flash (dim) Light1
22 Player Shotgun blast FireShotgun
31 Light flash (bright) Light2
36 Player Double-Barrel Shotgun blast FireShotgun2
38 Check ammo (If 1 or 0 shells left, skip reloading frames and select different weapon) CheckReload
39 Play sound "dbopn" OpenShotgun2
41 Play sound "dbload" LoadShotgun2
43 Play sound "dbcls" CloseShotgun2
52 Player Chaingun shot (check ammo; don't go to -1 ammo, change weapon) FireCGun
60 Display firing frame GunFlash
61 Player launch rocket FireMissile
71 Player use chainsaw Saw
77 Player fire plasma bullet FirePlasma
84 Play sound "bfg" BFGsound
86 Player fire BFG shot FireBFG
NA Player fires Railgun centrally (Zdoom) FireRailgun
NA Player fires Railgun from the left (Zdoom) FireRailgunLeft
NA Player fires Railgun from the right (Zdoom) FireRailgunRight
NA Effectively a null pointer for player weapons (Zdoom) RailWait

Monster / thing code pointers

Code Pointer Description BEX Alias
119 BFG blast effect BFGSpray
127 Radius explosion Explode
157 Play pain sound Pain
159 Plays "PLDETH" PlayerScream
160 Dead body mode Fall
166 Play sound "slop" XScream
174 Wait to wake up Look
176 Standard walking code pointer Chase
184 Turn to face the player's direction FaceTarget
185 Trooper pistol shot PosAttack
190 Play death sound Scream
243 Archvile walking code pointer (check to resurrect monster) VileChase
255 Play sound "vilatk" VileStart
257 Create archvile flame at target, enable radius explosion for #264 VileTarget
264 Target jumps in air, takes 10% -20% damage VileAttack
281 Play sound "flamest" StartFire
282 Reposition an object continuously on a target (such as Archvile flames) Fire
285 Play sound "flame" FireCrackle
316 Revenant fireball homing (and smoke trail) code pointer Tracer
336 Play sound "skeswg" SkelWhoosh
338 Revenant punch - play sound "skepch" if hit SkelFist
341 Launch revenant fireball with possible homing (and smoke trail) effect SkelMissile
376 Play sound "manatk" FatRaise
377 Mancubus shoot 2 fireballs: one straight, one left FatAttack1
380 Mancubus shoot 2 fireballs: one straight, one right FatAttack2
383 Mancubus shoot 2 fireballs: one left, one right FatAttack3
397 Check for special sector lowering (666/667) BossDeath
417 Chaingun guy or SS nazi shoot chaingun CPosAttack
419 Check line of sight to stop firing CPosRefire
454 Imp shoot fireball or scratch at close range TroopAttack
487 Demon bite SargAttack
506 Cacodemon shoot fireball or bite at close range HeadAttack
539 Baron of Hell or Hell Knight shoot fireball or scratch at close range BruisAttack
590 Lost soul attack - attack sound REQUIRED or game will crash SkullAttack
603 Play sound "metal" + standard walking pointer Metal
616 Spiderdemon shoot chaingun SPosAttack - Same as shotgun guy attack
618 Check line of sight to stop firing SpidRefire - same function as CPosRefire
635 Play sound "bspwlk" + standard walking pointer BabyMetal
648 Arachnotron shoot plasma bullet BspiAttack
676 Play sound "hoof" + standard walking pointer Hoof
685 Cyberdemon launch rocket CyberAttack
711 Spawn lost soul PainAttack
718 Spawn 3 or 4 lost souls + set body to dead PainDie
774 Check for special sector lowering (666/667) and Dead Body mode KeenDie
779 Play sound "bospn" BrainPain
780 Play sound "bosdth" and make explosions (frames 799 - 801) about 320 units south of object BrainScream
783 End level BrainDie
785 Play sound "bossit" BrainAwake
786 Fire spawn cube - Landing REQUIRED on level or game will crash BrainSpit
787 Play sound "boscub" SpawnSound
788 Check for spawn point (spawn monster) SpawnFly
801 Create explosion (frames 127 - 129) BrainExplode
NA Cancel an existing pointer (BEX) Null
NA Monster fire rail gun (set thing's missile damage to railgun damage required). (Zdoom) MonsterRail

Credits: DEH code pointers from a document by Andy Shawaluk who also gives credit to Francesco Orsenigo, "Shadow Lord"  and Jjukil.  The BEX stuff is taken from BOOMDEH.TXT, a text file distributed with most BOOM compatible source ports (including boom).  The Zdoom stuff comes from the Zdoom editing docs.