How to display negative numbers with the digital font: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Created page with '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...'
 
Mblackwell (talk | contribs)
mNo edit summary
Line 32: Line 32:
  texture 2469 { pal 0 { file "highres/screen/fonts/digital/2469.png" } }
  texture 2469 { pal 0 { file "highres/screen/fonts/digital/2469.png" } }


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


  gamevar [[PLR_MORALE]] -5 0
  gamevar [[PLR_MORALE]] -5 0

Revision as of 23:31, 21 January 2021

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.

Procedure

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

dynamicremap

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 digital_minus.zip (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" } }

Viola! 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.

Credits

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