Warrior Medals

A plugin by Ezio(Trusted developer)

Warrior Medals
Downloads 2,029
Updated 10 days ago
Released 2 months ago
Created 3 months ago
Numeric ID 590
Min. Openplanet 1.26.17
Signed
Game Trackmania
Seasonal campaign
Seasonal campaign (live)
Track of the Day
Club campaign
Training

Warrior Medals

Are author medals too easy for you, but Champion medals still seem out of reach? Do you need something in-between?

This is of course inspired by the Champion Medals plugin. Warrior medals are available for every official campaign (including training and the TMO discoveries) and every Track of the Day. Warrior medals may also be added for custom campaigns by request from the campaign's author/maintainer. Message me on Discord to request Warrior medals for your campaign.

Medals may be manually adjusted due to physics changes or for being more difficult than they should be. Message me on Discord or create a GitHub issue if you feel like a Warrior medal does not make sense in some way. Do not ask for Warrior medals to be harder - grind for the Champion medal instead.

There are currently no plans to add any other medals, though I'm not necessarily opposed to the idea. With enough user requests I may add another medal, but you must also suggest a good name for it, and the change will not happen quickly.

This plugin does not collect any of your personal information. This is solely for your own personal use. Please feel free to look through the source code on GitHub to verify this for yourself.

This plugin, like all of mine, is licensed under MIT, which is one of the most lenient. You may also use Warrior medal data in whichever way you like without permission, though if you want to get it directly from my API, please at least discuss it with me first so we can work out a good solution for your needs.

Seasonal campaign:

  • 2 weeks after the season starts
  • 1/4 of the way between author and world record
  • example (Summer 2024 - 01 and 25):
Author World Record Warrior
23.923 22.325 23.524
1:10.347 1:07.943 1:09.746

Track of the Day:

  • 2 hours after the track releases (21:00 CET)
  • if someone has author by at least 8ms:
    • 1/8 of the way between author and world record
    • otherwise 1ms faster than author
  • does not account for Champion medal times, so it may be equal or faster
  • example (arbitrary numbers):
Author World Record Warrior
45.678 44.926 45.584
40.000 40.069 39.999

Club Campaigns:

  • At any time requested by a campaign author/maintainer
  • 1/2 way between author and world record (tell me if you want it different)

Function used for calculation:

def get_warrior_time(author_time: int, world_record: int, factor: float | None = 0.25) -> int:
    '''
    - `factor` is offset from AT
        - between `0.0` and `1.0`
        - examples, given AT is `10.000` and WR is `8.000`:
            - `0.000` - AT (`10.000`)
            - `0.125` - 1/8 of the way between AT and WR (`9.750`) (default for TOTDs)
            - `0.250` - 1/4 of the way between AT and WR (`9.500`) (default, default for campaigns)
            - `0.750` - 3/4 of the way between AT and WR (`8.500`)
            - `1.000` - WR (`8.000`)
    '''

    return author_time - max(
        int((author_time - world_record) * (factor if factor is not None else 0.25)),
        1
    )

Exports:

Please use this plugin as a dependency! While it's useful on its own, I would love to see integration in some more popular plugins. Include this in your info.toml: optional_dependencies = [ "WarriorMedals" ]

string GetColorStr()
vec3 GetColorVec()
Returns the plugin's main color as a string or a vec3.

const UI::Texture@ GetIcon32()
const UI::Texture@ GetIcon512()
Returns the Warrior medal icon with a size of 32x32 or 512x512.

const dictionary@ GetMaps()
Returns all cached map data.
Keys are map UIDs and values are of type WarriorMedals::Map@.

uint GetWMTime()
uint GetWMTime(const string &in uid)
Returns the Warrior medal time for the current map or given map UID. If there is an error or the map does not have a Warrior medal, returns 0. Does not query the API for a time, so the plugin must already have it cached for this to return a time. Only use this if you need a synchronous function.

uint GetWMTimeAsync()
uint GetWMTimeAsync(const string &in uid)
Returns the Warrior medal time for the current map or given map UID. If there is an error or the map does not have a Warrior medal, returns 0. Queries the API for a medal time if the plugin does not have it cached. Use this instead of the synchronous version if possible.

There exist more exports, however they are very basic, are only shared to make the compiler happy, and are not documented here.

Changelog

1.3.2 - 10 days ago

  • fixed club and campaign format code handling

1.3.1 - 12 days ago

  • added proper support for club campaigns
  • fixed case where medal is not given when tied
  • fixed many cases where medal icon would show when it shouldn't and vice versa
  • updated to use new API endpoints
  • fixed issue where API would be queried for non-race maps
  • added Trackmania.io links to campaigns
  • added hover text for TOTDs and club campaigns
  • minor optimizations

Now with proper club campaign support, please let me know if you'd like Warrior medals for your own campaign!

Also, because of some API changes, version 1.2.1 will be deprecated at some point in the near future. Don't be like big streamer guy, update!

View all changelogs