How to display negative numbers with the digital font

From EDukeWiki
Jump to navigation Jump to search

In the default game, there is no minus symbol for the digital numbers. When you try to display a negative number with the digital set, it displays the steroids icon instead of a minus symbol. With that knowledge, in this tutorial, we will take advantage of the dynamicremap command to move the steroids icon to a different slot, and the tilefromtexture to add in the new minus symbol and the steroids icon.


In GAME.CON/EDUKE.CON, put this at the top of the file:


Down in DEFS.CON where it says:

define STEROIDS_ICON 2469

Change to:

define STEROIDS_ICON 2459 // 2469

This will tell the game to display tile #2459 for the steroids icon, instead of #2469. Currently, tile #2459 is empty, so we will have to re-add the steroids icon, as well as the minus symbol.

Download (1.67 kb), and extract it to your base-level mod directory.

Finally, put this at the bottom of duke3d.def. It will add in the 8-bit art required for the steroids icon and minus symbol, as well as adding high resolution versions of the two tiles.

undefmodel 2459
undeftexture 2459
undefmodel 2469
undeftexture 2469

tilefromtexture 2459 { file "highres/8bit/2459.png" }
tilefromtexture 2469 { file "highres/8bit/2469.png" xoffset -4 yoffset -3 }

texture 2459 { pal 0 { file "highres/screen/hud/2469_steroids.png" } }
texture 2469 { pal 0 { file "highres/screen/fonts/digital/2469.png" } }

Violá! If you want to test it, put this at the top of GAME.CON:

gamevar PLR_MORALE -5 0

The large HUD should display "-5" under ARMOR.


Hendricks266: minus symbol art, both 8-bit and highres; tutorial