Resource icon

[Open Assets] Encore Mode Music

This content may be freely modified and/or maintained by anyone.

SteelT

Developer
Sonic Team Junior
Kart Krew™️
NO LONGER SUPPORTED

Still gonna be here for historical purposes thiugh.

Original post:
So I bet you're wondering... "What the heck is this? How do I use it?" well I'm going to tell you now

It's a framework which lets you use per-map encore specific level theme. In order to keep the file size to a reasonable size, only two tracks are supported, Daytona Speedwway and Plesure Castle, but you can support for other maps if you want.

Original post:
Lua Functions:
EMM_MapIsSupported(int mapnum) - Checks if the map specified already exists within the table containing all the supported maps.
EMM_AddMusic(int mapnum) - Adds the specified map number to the table containing all the supported maps. It's important you know the extended map number of your map before using this. So you'd use 183 instead of CB. For a list of extended map numbers, see https://wiki.srb2.org/wiki/List_of_extended_map_numbers.

===Adding support for your map===
This framework was designed so adding support for your map is easy to understand. For both of the example songs in the wad, I used Audacity to lower the speed by -10%. But you can use a different song entirely if you want.

Prerequisites:
Make sure your music lump is named correctly and imported to your WAD file. The music lump should be named O_KR**EM, ** being your map number.

Coding support for the map:
Code:
if emm_maps // first check to see if its added at the time of this wads addition
end
addHook("MapLoad", function() // else check whenever the map loads
     if not emm_maps then return end
end)
From there it's as simple as using the function listed above to add your map to the list of supported maps.

Code:
// Support for KL_EncoreModeMusic
if emm_maps // First check to see if its added at the time of this wads addition
     EMM_AddMusic(gamemap)
end

addHook("MapLoad", function() // Else check whenever the map loads
     if not emm_maps then return end
     EMM_AddMusic(gamemap)
end)
But for map packs you could use a for loop and add maps in a range:
Code:
// support for KL_EncoreModeMusic
if emm_maps // first check to see if its added at the time of this wads addition
     for i = 1, 5
         EMM_AddMusic(i)
     end
end

addHook("MapLoad", function() //else check whenever the map loads
     if not emm_maps then return end

     for i = 1, 5
         EMM_AddMusic(i)
     end
end)
Just be sure to remember to use map numbers for the function, this is important or things will go horribly wrong.
Also there should be the first code block example included as a Lua file below as well, if you cant copypaste for whatever reason.

Once that's done, give yourself a pat on the back, as your map is now supported. If there's any questions you are free to contact me here on the MB or Discord.

Supporters / Co-Authors:
 

Attachments

  • LUA_EMM.lua
    225 bytes · Views: 351
  • KL_EncoreModeMusic_v1.1.zip
    2.3 MB · Views: 440
Last edited by a moderator:
Man, just... slowing down the music? Not even like, picking one of the many possible Daytona USA tunes, or an Initial D track or something? That's disappointing. Oh well, the focus of the wad is clearly on Encore Mode music support for custom levels, and as a resource for that, it does the job right. Welcome to releases!
 
Version 1.1

Updated the script to fix an small issue found.
 
Well d00d, slowing down music is actually a genre of music Called Vaporwave.

Funny how it has its own genre :S
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top