MEDALDEF

Revision as of 14:59, 27 May 2024 by AKMDM (talk | contribs) (Added an example.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This article documents a Zandronum-specific special lump which may not be supported by ZDoom and its other child ports.
This article documents a special lump which is only available in development builds of Zandronum 3.2 and newer.

(development version 3.2-alpha and above only) MEDALDEF is a special lump that allows mods to create their own medals, similar to the built-in Skulltag medals. Custom medals can be awarded to players using either GivePlayerMedal or A_GivePlayerMedal.

To create or edit a medal, the following syntax can be used:

MedalName
{
   AddFlag <flag>
   RemoveFlag <flag>

   Property = "<value>";
}

All values for properties must be enclosed in quotation marks.

Flags

  • KEEPBETWEENLEVELS

Players are allowed to keep the medal when the level changes.

  • ALWAYSSHOWQUANTITY

When a player receives the medal, the quantity and only one copy of the medal's icon will always appear on the screen.

Properties

  • Icon

The name of the graphic that appears on the screen when the medal is awarded to a player.

  • ScoreboardIcon

The name of the graphic used to show the medal on the scoreboard via the DrawMedals margin command. If left unspecified, or if the graphic doesn't exist, then the Icon is used instead.

  • Class

Which FloatyIcon actor class to spawn over the player's head when they receive the medal. This must be specified.

  • State

Which state in the FloatyIcon actor class to show over the player's head when they receive the medal. This must be specified.

  • Text

The text that appears on the screen when the medal is awarded to a player.

  • TextColor

The text colour (as defined in the   TEXTCOLO lump) used to draw the text on the screen.

  • QuantityColor

The text colour used to draw how much of the medal a player has earned, if there's too many to fit all of them on the screen, or if the ALWAYSSHOWQUANTITY flag is enabled.

  • AnnouncerEntry

The announcer entry to play when a player receives the medal.

  • LowerMedal

If a player previously earned the specified "lower" medal and it's currently being shown over their head, then receiving this medal will instantly replace it.

  • Sound

The name of the sound to play when a player receives the medal. This sound only plays when the user isn't looking through the player's eyes.

Example

Ideally, you should define your own FloatyIcon class to use for your set of medals, rather than replace the native FloatyIcon class. Doing it this way ensures that your medals won't interfere with another mod's, and vice versa. For example, if we want to create a new "Single kill" medal, then we should add a DECORATE file with something like this in it:

Actor MyCustomFloatyIcon : FloatyIcon
{
   States
   {
       SingleKill:
           SING A -1
           Stop
   }
}

Our MEDALDEF lump would then have this in it:

SingleKill
{
   Icon = "SINGA0"
   Class = "MyCustomFloatyIcon"
   State = "SingleKill"
   Text = "Single kill!"
   TextColor = "Gold"
   QuantityColor = "Grey"
   AnnouncerEntry = "SingleKill"
}

When a player receives the "Single kill" medal, it will spawn a MyCustomFloatyIcon actor over their head and use the SingleKill state to show it.