|
Hi everyone.
Firstly, I apologise if a complete music list for 508 has been posted before, I couldn't find it when searching, so I've decided to write this post!
I am not going to post any real code (as most of the servers are using java, and I'm writing mine in C# .NET 5) however, I have compiled the full list of music configs for 508.
There are 20 different configs that set music in 508.
Spoiler for config numbers:
Each config can store the unlock state of up to 32 different songs.
How do you store the unlock state of up to 32 different songs in one value?
We do it by numbering each song.
Let's take config 20 as an example.
Config 20 has 32 different song configurations stored in it.
Song 1 in config 20 is Adventure.
Song 2 in config 20 is Al kharid.
Song 3 in config 20 is Alone.
If we set config 20 to value 1 - Adventure gets unlocked.
If we set config 20 to value 2 - Al kharid gets unlocked.
If we set config 20 to value 4 - Alone gets unlocked.
Why do we skip 3?
To work out whether both Song 1 and Song 2 are set, we need to add the values of Song 1 and Song 2 together.
As Song 1 has the value 1 and Song 2 has the value 2, if we set the value of config 20 to 3, both Adventure and Al kharid become unlocked.
Equally setting the value to 7 will unlock all three songs.
This means each song can only be a value that cannot be equal to the sum of any combination of other songs.
Most of the tutorials that I have seen online have listed these values to be
Spoiler for config values:
There are a few problems to solve here:
1) As you can see there are only 31 numbers, so that means we can only store 31 songs (and I mentioned that configs can hold 32 songs)
2) The maximum value that can be set is the same as the maximum 32-bit integer (as this is the value type used) - this is 2147483647.
This value cannot be used as the 32nd number, because when you add all 31 of the above numbers together, you get 2147483647, and therefore this value could not be used to flag a single song.
So how do we get the last song?
We use a negative number!
The minimum 32-bit integer is -2147483648
What's more, this number does not conflict with any other number in our number list.
If we sum up all the 32 numbers, we get the value that can be used to flag all of the songs for the config.
This number is -1.
Simply setting the config value of all of the configs listed above to -1 will unlock all of the songs.
As we know, each one of these numbers inside a config correlates to a song.
I wrote a script to flag each of the songs in turn.
So I can give you the full list of mapped songs in 508.
Please note, if there is a "---" next to a number, this means that no song will be unlocked when setting this number in a config.
Spoiler for Config 20:
Spoiler for Config 21:
Spoiler for Config 22:
Spoiler for Config 23:
Spoiler for Config 24:
Spoiler for Config 25:
Spoiler for Config 298:
Spoiler for Config 311:
Spoiler for Config 346:
Spoiler for Config 414:
Spoiler for Config 464:
Spoiler for Config 598:
Spoiler for Config 662:
Spoiler for Config 721:
Spoiler for Config 906:
Spoiler for Config 1009:
Spoiler for Config 1104:
Spoiler for Config 1136:
Spoiler for Config 1180:
Spoiler for Config 1202:
Hope this helps someone!
Great to see people contributing
Just a few things to add:
Incase people are using other revisions those configs can be found in cs2 837
The music names can be found in enum 1345 (index 17)
Rather than list all the values, you can just calculate the config and value based on the musics index
e.g sea shanty 2 is index 107 in the total music list.
107 / 32 tracks per config = config index 3 (aka config 23)
107 % 32 = index 11 ^2 = 2048
1 << 11 also works instead of 11^2
Thanks, Greg!
So if musicConfig was a 0 based array of all the different music configs,
and musicNumber was a number from a 0 based array of all the different music,
we could work out the configNumber and the musicFlag from a neat little bit of code...
Awesome, thanks for the info!Code:int[] musicConfigs = {20, 21, 22, 23, 24, 25, 298, 311, 346, 414, 464, 598, 662, 721, 906, 1009, 1104, 1136, 1180, 1202}; int musicNumber = 107; int configNumber = musicConfigs[musicNumber / 32]; int musicFlag = 1 << musicNumber % 32;
Yep exactly, "musicNumber" is the 0 based index for the track, it's used as they key in enum 1345 (also 1346 - groups, 1347 - lower case names & 1349 - unlock descriptions) which looks like: {0=Adventure, 1=Al Kharid, 2=Alone, 3=Ambient Jungle, 4=Arabian, 5=Arabian2, ... , 615=Shining Spirit, 616=Troubled Spirit}
or calculated on click from the interface packet index divided by 2
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |
Tags for this Thread |