[Lua] Additional Unlocks

  • Download count 5
  • Pageviews 73
  • Unique foldername
  • Skin for
  • Track Mod for
  • Based on
  • Release date 2026-05-02
  • Version from
  • Version
  • RVW-ID 46966
  • Category
  • Score
    100/100 (2 votes)
  • Unconventional car?
  • Construction
  • Engine
  • Transmission
  • Top speed mph
  • Total weight kg
  • Acceleration m/s²
  • Construction
  • Track difficulty
  • Track length m
  • Reverse version available?
  • Time trial times available?
  • Practice mode star available?
  • Online multiplayer compatible?

    NOTE: You need lua modloader for this modification
    link: https://www.revoltworld.net/dl/rvgl-lua-modloader/

    Also you need Custom gui utility library
    link: https://www.revoltworld.net/dl/lua-utility-custom-gui-utility/

    This modification adds the following things:
    1) new ways to define unlock rules for cars and new unlock methods!
    2) automatic track unlocks by track difficulty (you can disable this by opening the script and turning enable_custom_tracks_unlock to false if you don't want it):

    • easy and unknown difficulty tracks are unlocked by default
    • medium difficulty tracks are unlocked by winning the bronze cup
    • hard tracks are unlocked by winning the silver cup
    • extreme tracks are unlocked by winning the platinum cup

    3) new custom window showcasing a preview picture of the newly unlocked car(s)! (you can disable this by opening the script and turning enable_unlock_previews to false if you don't want it)

    _________________________________
    How the new unlock rules works and how you can make your own custom unlock rules:
    1) new unlock rules can be defined in any .txt file in mods/additional_unlocks_data (you are allowed to have multiple files defining unlock rules, it doesn't have to be only 1. The script will automatically read rules from any .txt files that follows the correct formatting explained below)
    2) custom unlock rules defined in these files will always override stock unlock rules (for example if you make a custom unlock rule for Toyeca, the original stock unlock rule of picking up practice stars in platinum cup tracks will be replaced with your new defined rule)
    3) each unlock rule is defined in this way:
    cars=car1, car2     target=track1, track2     objective=type
    where:
    cars is a list of car folder names of the cars to unlock
    target is a list of the track folder names of the tracks where the objective needs to be achieved to unlock the cars
    objective is the objective type that needs to be achieved on the target tracks, which can be:

    • time_trial
    • time_trial_reverse
    • time_trial_mirror
    • single_race
    • star_found
    • stunt_arena
    • championship
    • signal

    NOTE: championship and signal are special cases, in these cases the meaning of target isn't "a list of tracks" anymore.
    for championship objective, target becomes a list of cup names that the player needs to win
    for signal, target becomes a list of specific variable names that need to be set with lua scripting (this is an advanced feature used to define even more customizable unlock rules)
    3) the download also includes an example unlock rule file i made called unlock_rules.txt that adds a lot of new unlock rules to some of my favourite cars. Feel free to use it as a base to make your own unlock rules.

    _________________________________
    Some unlock rule definitions examples:
    Example 1:
    cars=reddlum   target=fdt17airport2, fdt19junk1, fdt3stad1, home1   objective=single_race

    unlocks "Reddlum" by winning single race in the following tracks: Airport 2, Junkyard 1, RC Stadium 1 and Home 1.

    _________________________________
    Example 2:
    cars=bus   target=schoolstunt   objective=stunt_arena

    unlocks "Shcoolvolt II" by collecting all the stars in the School’s Stunts! stunt arena.

    _________________________________
    Example 3:
    cars=tcp_soccer, camelia   target=Silver3   objective=championship

    unlocks "Hat Trick" and "Camelia" by winning Silver Cup #3 championship

    _________________________________
    Example 4:
    cars=jg6rc   target=nhood1, market2, muse2, garden1   objective=time_trial
    cars=tc12   target=nhood1, market2, muse2, garden1   objective=time_trial_reverse
    cars=tc10   target=nhood1, market2, muse2, garden1   objective=time_trial_mirror

    normally in the original game you would unlock RC Phink, LA 54 and Matra XL by winning the normal time trials on the bronze cup tracks, but with these rules we make so that we will unlock 1 car per time trial objective instead!
    normal time trials will unlock RC Phink, time trials in reverse mode tracks will unlock LA 54 and time trials in mirror mode tracks will unlock Matra XL!

    _________________________________
    Example 5:
    cars=errand_rs   target=test_signal   objective=signal

    unlocks "Errand RS" as soon as ml.set_shared_var("unlock_signal=test_signal", true) is called in any lua script.
    for example we can make it unlock when the user presses the 0 key while in a race, let's say we have a test.lua script that looks like this:

    ----------------------------------------------------------------------
    local KEY_0 = 48 -- Keycode for 0

    function on_key_pressed(key, action, player_id)
    if key == KEY_0 and ml.is_in_race() then
    ml.set_shared_var("unlock_signal=test_signal", true)
    end
    end
    ----------------------------------------------------------------------

    when the user presse 0 while in a race, Errand RS will be unlocked and the user will be notified about that when he goes back to the frontend by quitting the race!
    this is just an example, as you can see with signals it is possible to define any kind of complex unlock methods you want.


Leave a comment