News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: [Help] How to change theme songs ?  (Read 1757 times)

0 Members and 1 Guest are viewing this topic.

Offline feliiperh

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
[Help] How to change theme songs ?
« on: July 30, 2022, 11:13:35 AM »
Hey Guys!
I'm a newbie trying to make some simple mods.
Searching in the forum I managed to get a lot of lists of IDs and functions from the DaBOSS tutorial and the list of the songs that d0c posted.

I want to change the theme songs from fighting cliques, and the normal running song when it's free roam.

I know this command in lua: SoundPlayStream("song.rsm", volume)
But how do I code to identify i'm in a fight with a certain clique and change the song? And how to code to make the game understand i'm in free roam and change the song?

Thank you!

Edit: Found this post https://bully-board.com/index.php?topic=22578.0 and use the recommended command but the game is completely silent.. I'm modding STimecycle btw
« Last Edit: July 30, 2022, 11:52:34 AM by feliiperh »

Offline feliiperh

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: [Help] How to change theme songs ?
« Reply #1 on: July 30, 2022, 02:50:14 PM »
I managed to add Free roam and bike theme songs with the following code, however, when getting chased by authority, it keeps playing my added song... When in fighting too. Any help?

Code: [Select]
function musicmod()
    while true do
Wait(0)
if PlayerIsInAnyVehicle() then
SoundPlayStream("MS_TenementsMid.rsm", 1)
elseif not PlayerIsInAnyVehicle() then
SoundPlayStream("MS_TenementsLow.rsm", 1)
end
    end
end

Offline SimonBestia

  • Full Member
  • ***
  • Posts: 294
  • Gender: Male
  • Bully-Board's Best Weeb
    • View Profile
    • Youtube Channel
Re: [Help] How to change theme songs ?
« Reply #2 on: July 30, 2022, 05:23:32 PM »
SoundPlayStream overrides everything.
There are various functions controlling the music. For example:
Code: [Select]
SoundPlayInteractiveStream("MS_FootStealthLow.rsm", MUSIC_DEFAULT_VOLUME) -- Only plays when walking
SoundSetMidIntensityStream("MS_FootStealthMid.rsm", MUSIC_DEFAULT_VOLUME) -- Only plays when on a vehicle
SoundSetHighIntensityStream("MS_FootStealthHigh.rsm", MUSIC_DEFAULT_VOLUME) -- Only plays when fighting
« Last Edit: July 31, 2022, 01:56:16 AM by SimonBestia »

Offline feliiperh

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: [Help] How to change theme songs ?
« Reply #3 on: July 30, 2022, 05:40:24 PM »
Thanks for your response!

I tried these 3 commands but my game is silent. Doesn't trigger or play any song whatsoever.
Any advice?

I tried in this fuction purely, and in the main function loop.

Offline feliiperh

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: [Help] How to change theme songs ?
« Reply #4 on: July 31, 2022, 01:36:38 AM »
Well, made it work!
Just had to put those 3 commands before the repeat line in the main function.
And being chased by prefects/cops plays their respective song normally!

Thanks for your help.