[How-To]Add Custom Music in THUG2 (PS2) (Revised 12/5/19)

Discuss thug2 modding, post your own, share your ideas, ask questions.
RazorHack5000
Posts: 4
Joined: Fri Mar 15, 2013 12:42 am
Location: Some place in Asia-Pacific
Contact:

[How-To]Add Custom Music in THUG2 (PS2) (Revised 12/5/19)

Postby RazorHack5000 » Fri Mar 15, 2013 1:55 am

12/5/19 Update:
After 6 years, I finally did it correctly! Silence/No next song is playing bug is no more! Here's the revised instructions how to put custom music on PS2 version of THUG2.

Here's what you need:
THUG2 ISO (Make it from your THUG2 Disc)
WadEdit v4: http://thmods.com/forum/viewtopic.php?f=8&t=28 (Requires Java Runtime Environment to be installed)
THawkPS2AudioConvert (Batch program created by me. Requires QuickBMS and SoX. Both of these programs available below, while the batch program download are available on the attachment below. See ReadMe.txt for a little bit of details)
QuickBMS: http://aluigi.altervista.org/papers/quickbms.zip (For running the MUSICP extraction scripts and also needed for script included in THawkPS2AudioConvert to convert the audio formats to the one the game understands.)
SoX: https://sourceforge.net/projects/sox/fi ... t/download (For the THawkPS2AudioConvert's audio conversion). Also for MP3 support: https://app.box.com/s/tzn5ohyh90viedu3u90w2l2pmp2bl41t
aluigi's THPS HED/WAD script: http://aluigi.altervista.org/bms/thps_hed_wad.bms (To ensure correct extraction of MUSICP.WAD)
hedwadext: http://aluigi.altervista.org/papers/hedwadext.zip (To repack the MUSICP.WAD with it's correct namecase and file alignments)
UltraISO or Xpert 2.0 (I use the latter personally)

First let's extract the MUSICP.WAD archives the correct way:

*Note: If you didn't want to add/remove any existing songs, rename your songs with the same name from the original ones. Otherwise, move on to the Additional steps.

1. Extract MUSICP.WAD and MUSICP.HED from MUSIC directory in THUG2 ISO (Or if you're using Xpert, Just go to where it extracts the contents of the ISO).
2. Edit the thps_hed_wad.bms script and change the ALIGN parameters to 1 and EXTRACTION_MODE to also 1.
3. After you've done editing, extract MUSICP.WAD using Quickbms and THPS HED/WAD Script with this command:

Code: Select all

quickbms thps_hed_wad.bms MUSICP.HED [Wherever you want to extract it]


If it asks you to create new directory, just type y then confirm.

3. Using THawkPS2AudioConvert, edit the Convert.bat accordingly and after you done, launch it to start conversion.

4. After the conversion was done, copy your converted audio inside the songs directory to [Where you extract MUSICP.WAD Contents]\music\vag\songs directory.

5. Repack the files again using hedwadext with this command:

Code: Select all

hedwadext b MUSICP.HED [WAD Folder you just extracted] 1


*Note: hedwadext will not repack the WAD if there's another same WAD existed so delete it first.

6.Replace the old MUSICP.WAD and MUSICP.HED in the MUSIC folder in THUG2 ISO with the new one you just created (Or rebuild the ISO if you're using Xpert).

7. Play it on PCSX2 or Burn the ISO to DVD-R or Play the ISO on your PS2 using HDLoader/USB Advance/Open PS2 Loader.

Additional steps:

Well, if you adding the new song instead of replacing the existing one, use this and WhoElseButMe steps:

1. Extract the DATAP.WAD and DATAP.HED from the THUG2 ISO (Again, If you're using Xpert, Just go to where it extracts the contents of the ISO).
2. Extract the DATAP.WAD using WadEdit with this command:

Code: Select all

java -jar WadEdit.jar DATAP.WAD DATAP.HED [everywhere you want to extract them]


3. After you've done with extracting, go to the [DATAP.WAD Folder you just extracted]\scripts\game\skater directories and follow this steps to decompile skater_sfx.qb file:

WhoElseButMe wrote:Why? Holy fuck man.

@LC-DDM, the reason the script doesn't decompile are the 61 instances of the RandomRange.
Open the FULL ORIGINAL script in a hex editor and do a HEX search for these 2 bytes 0730 change them to 0707.
Now the script will decompile and everywhere there was a RandomRange you'll see = = (0707) leave these as they are.
Make the changes you want to the Playlist_Tracks array and compile the script.
Before you can use this script you'll need to open the re-compiled script in a hex editor and do a hex search for 0707 and change it to 0730.
Example for adding an entry, just above the end array (:a}) copy that line

Code: Select all

   :i :s{$band$ = %s(1,"X")$track_title$ = %s(11,"Los Angeles")$genre$ = %i(2,00000002)$path$ = %s(19,"music\vag\songs\XLA"):s}
   :i :s{$band$ = %s(4,"ZEKE")$track_title$ = %s(18,"Long Train Runnin'")$genre$ = %i(2,00000002)$path$ = %s(20,"music\vag\songs\ZEKE"):s}
   :i :a}

paste that line and change it to match your values

Code: Select all

   :i :s{$band$ = %s(1,"X")$track_title$ = %s(11,"Los Angeles")$genre$ = %i(2,00000002)$path$ = %s(19,"music\vag\songs\XLA"):s}
   :i :s{$band$ = %s(4,"ZEKE")$track_title$ = %s(18,"Long Train Runnin'")$genre$ = %i(2,00000002)$path$ = %s(20,"music\vag\songs\ZEKE"):s}
   :i :s{$band$ = %s(4,"NOFX")$track_title$ = %s(22,"Idiots are Taking Over")$genre$ = %i(2,00000002)$path$ = %s(20,"music\vag\songs\NOFX"):s}
   :i :a}

And just to be clear you generate a QbKey for the short name only music\vag\songs\NOFX
NOFX = 2bb019e1, this becomes your track name, 2bb019e1.bik and goes into \Game\Data\streams\music\
Enjoy.


Note: you didn't need to generate a QBKey for the song names.
Attachments
THawkPS2AudioConvert.zip
(7.7 MiB) Downloaded 470 times
Last edited by RazorHack5000 on Sat Feb 06, 2021 9:58 am, edited 26 times in total.
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: [How-To]Add Custom Music in THUG2 (PS2)

Postby WhoElseButMe » Fri Mar 15, 2013 5:40 am

RazorHack5000 wrote:Note: you didn't need to generate a QBKey for this

You used a tool to repack your wad, that was written for manually editing of a wad, which means needing the qbkey.
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
RazorHack5000
Posts: 4
Joined: Fri Mar 15, 2013 12:42 am
Location: Some place in Asia-Pacific
Contact:

Re: [How-To]Add Custom Music in THUG2 (PS2)

Postby RazorHack5000 » Fri Mar 15, 2013 6:03 am

WhoElseButMe wrote:
RazorHack5000 wrote:Note: you didn't need to generate a QBKey for this

You used a tool to repack your hed/wad, that was written for manually editing of a hed and wad, which means needing the qbkey.


Well, I didn't knew that.
But, Have you tried these steps? (You need an ISO of THUG2 PS2)
WhoElseButMe
Posts: 419
Joined: Tue Aug 04, 2009 12:50 am
Location: FL - USA
Contact:

Re: [How-To]Add Custom Music in THUG2 (PS2)

Postby WhoElseButMe » Fri Mar 15, 2013 6:28 am

I've never tried doing it for a PS2
Can you upload one of the sound files
Image
WhoElseButMe on Nov 26, 2009 wrote:It's that lack of respect amongst their peers and ignorance towards modding etiquette that keeps us who know this stuff well from spreading it like wild fire. We do still enjoy playing the game and if you need to cheat to play a game PLAY SOMETHING ELSE YOU DON'T SUCK AT.
RazorHack5000
Posts: 4
Joined: Fri Mar 15, 2013 12:42 am
Location: Some place in Asia-Pacific
Contact:

Re: [How-To]Add Custom Music in THUG2 (PS2)

Postby RazorHack5000 » Fri Mar 15, 2013 6:55 am

WhoElseButMe wrote:I've never tried doing it for a PS2
Can you upload one of the sound files


I'm going to upload it now. Though it was very long time to wait as my internet connection very sucks (well Mobile USB modem with quota reaching the end making the connection only reaching the 64Kbps)

Edit: Well, here you go:
[LINK DEAD/REMOVED]
it was "Sweet Willy Rollbar" by Melvins (I renamed the extension to .raw so MFAudio will recognizes it)
Play the file with the parameter I just given on my first post
Last edited by RazorHack5000 on Sat Feb 06, 2021 1:44 am, edited 2 times in total.
RazorHack5000
Posts: 4
Joined: Fri Mar 15, 2013 12:42 am
Location: Some place in Asia-Pacific
Contact:

Re: [How-To]Add Custom Music in THUG2 (PS2)

Postby RazorHack5000 » Thu Dec 05, 2019 2:28 pm

Bumping after 6 years.
johnny86
Posts: 3
Joined: Fri Aug 11, 2017 5:26 pm
Contact:

Re: [How-To]Add Custom Music in THUG2 (PS2) (Revised 12/5/19)

Postby johnny86 » Thu Jun 18, 2020 7:25 pm

Thats awesome, thank you very much for the update! I always used your old method and was very annoyed when the songs stopped and i had to skip tracks manually. Never thought that i will ever play THUG2 on ps2 with my own music and dont have to skip :D . It took me some time but finally i got it to work. I had problems because some dlls were missing for Sox but i found them. Also there is an error in step 5:

5. Repack the files again using hedwadext with this command:

Code: Select all
hedwadext b MUSICP.WAD MUSICP.HED [WAD Folder you just extracted] 1


it must be:

Code: Select all

hedwadext b MUSICP.HED [WAD Folder you just extracted]


I was hoping that this also works for THAW, but unfortunately it doesnt :( . Did you ever try to replace music in THAW for ps2?

Return to “THUG2 modding”

Who is online

Users browsing this forum: No registered users and 5 guests