MEDALDEF: Difference between revisions

Added an example.
(Clarified that a "text colour" should be the name used for the colour in the TEXTCOLO lump.)
Tag: Source edit
(Added an example.)
Tag: Source edit
 
Line 42: Line 42:
*<code>'''Sound'''</code>
*<code>'''Sound'''</code>
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.
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 <code>MyCustomFloatyIcon</code> actor over their head and use the <code>SingleKill</code> state to show it.


[[Category:Special lumps]]
[[Category:Special lumps]]
[[Category: Zandronum-specific lumps]]
[[Category: Zandronum-specific lumps]]