- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Tutorials >
- Modding - General - TS3 Music Selector and Randomizing Menu Batch File
- > Tutorials for creating content for the Sims 3 should be posted here. No discussion threads, only tutorials!
Replies: 2 (Who?), Viewed: 2738 times.
#1
31st Dec 2019 at 2:41 PM
Last edited by nitromon : 14th Jan 2020 at 2:23 AM.

Posts: 7,731
Thanks: 929 in 31 Posts

Quote:
![]() Also, if you are already junction linking your mods or TS3 folder, then it is recommended you do the copy method. Otherwise you will be double linking the audio mod and it creates a latency that makes the game run less smooth. |
omg, I can't believe there are now 3 TS3 music replacement mods in the download section. One for TS1, TS2, and TS3.
Anyways, if you are crazy like me, you want all 3. So, I wrote a short batch file random generator to load a different one each time the game runs. Thought I share it b/c someone might want it. What this does is generate a random number 1-3 and then create a junction link to the custom music you want.
What you need:
1) Do not put the music files into your mods folder, well at least not in the package folder or override folder. Put them somewhere else and label the folders TS1Music, TS2Music, TS3Music (or whatever, I'm just using an example.)
2) Using notepad, copy and paste the codes below. Then modify the codes to fit your system. "Save as" and choose "all files" under "document type." Name the file - TS3Shuffle.bat (or whatever you want, just make sure it is .bat)
echo off
cls
rmdir "destination"
SET /A num=%RANDOM%%%3+1
if "%num%" EQU "1" (goto sims1)
if "%num%" EQU "2" (goto sims2)
if "%num%" EQU "3" (goto sims3)
goto next
:sims1
mklink /j "destination" "source of TS1Music"
goto next
:sims2
mklink /j "destination" "source of TS2Music"
goto next
:sims3
mklink /j "destination" "source of TS3Music"
:next
cls
"gamelink"
echo on
3) Modifications
destination - where you want the music folder. Typically it is in your package folder. Give it a name like "altmusic" so this would be something like "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" etc... (make sure you don't actually have a folder with this name in there)
source of TS1Music - where you put the TS1Music. So example: "G:\TS1Music\"
source of TS2Music - where you put the TS2Music. So example: "G:\TS2Music\"
source of TS3Music - where you put the TS3Music. So example: "G:\TS3Music\"
Gamelink - Where your game executable is. Right click on TS3 icon, goto properties, look for "target" and copy that down. Then paste it here.
4) Sample
echo off
cls
rmdir "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\"
SET /A num=%RANDOM%%%3+1
if "%num%" EQU "1" (goto sims1)
if "%num%" EQU "2" (goto sims2)
if "%num%" EQU "3" (goto sims3)
goto next
:sims1
mklink /j "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" "G:\TS1Music\"
goto next
:sims2
mklink /j "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" "G:\TS2Music\"
goto next
:sims3
mklink /j "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" "G:\TS3Music\"
:next
cls
"c:\program files (x86)\electronic arts\the sims3\game\bin\TS3W.EXE"
echo on
5) You're done! If you want to give it a nice icon, create a shortcut to this batch file then give the shortcut an icon.

Sanity is overrated.
Nitromon is a type of Pokemon encountered in the Pokemon Nitrome Version series.
There. Mystery solved.
Advertisement
#2
8th Jan 2020 at 2:57 AM
Last edited by nitromon : 8th Jan 2020 at 7:54 AM.

Posts: 7,731
Thanks: 929 in 31 Posts


This is actually not a bump. I'm inputting a 2nd tutorial on a more comprehensive BAT file to help you sort your custom music themes. As the music replacement mods are becoming more popular, I think more people would want something like this. Please read the 1st tutorial above to learn how to write a random music selector before continuing.
What is this tutorial will include:
1) Menu selector
2) Manual selection
3) Random selection
Synopsis:
This tutorial will teach you how to write a batch file with just notepad to create a menu prompt asking you which custom music theme you want to run. It will also include a choice to random. If completed it will show a menu looking like this:
Quote:
Press "1" for Sims 1 Press "2" for Sims 2 Press "3" for Sims 3 Press "enter" for Random Press "4" to Exit What Is Your Music Choice? |
Directions:
1) Open notepad and copy the sample codes below. Please have reviewed the 1st post above to know what areas to modify.
echo off
cls
rmdir "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\"
:ask
echo Press "1" for Sims 1
echo Press "2" for Sims 2
echo Press "3" for Sims 3
echo Press "enter" for Random
echo .
echo .
echo Press "4" to Exit
echo .
echo .
SET /A num=0
set /P num="What Is Your Music Choice? "
:selected
if "%num%" GTR "4" (
cls
echo Please enter selection only!
goto ask)
if "%num%" LSS "0" (
cls
echo Please enter selection only!
goto ask)
if "%num%" EQU "1" (goto sims1)
if "%num%" EQU "2" (goto sims2)
if "%num%" EQU "3" (goto sims3)
if "%num%" EQU "4" (goto EOF)
:random
SET /A num=%RANDOM%%%3+1
goto selected
:sims1
mklink /j "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" "G:\TS1Music\"
goto next
:sims2
mklink /j "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" "G:\TS2Music\"
goto next
:sims3
mklink /j "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" "G:\TS3Music\"
:next
cls
"c:\program files (x86)\electronic arts\the sims3\game\bin\TS3W.EXE"
echo on
2) The above sample allows you to select from 3 different custom music themes and random. To add to the list you just need to add a few extra code entry.
Quote:
echo Press "1" for Sims 1 echo Press "2" for Sims 2 echo Press "3" for Sims 3 echo Press "4" for Korean Drama Theme echo Press "enter" for Random echo . echo . echo Press "5" to Exit |
Simply enter a new entry and increase the exit number by 1.
Quote:
:selected if "%num%" GTR "5" ( |
Under selected, increase the number by 1.
Quote:
if "%num%" EQU "1" (goto sims1) if "%num%" EQU "2" (goto sims2) if "%num%" EQU "3" (goto sims3) if "%num%" EQU "4" (goto KDR) if "%num%" EQU "5" (goto EOF) |
Add an entry to your new selection and shift exit number up by 1. Give your new variable a short name. In this case, I called it KDR.
Quote:
:KDR mklink /j "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" "G:\KDRMusic\" goto next :sims1 mklink /j "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" "G:\TS1Music\" goto next |
Now enter the data for KDR by copying and modifying sims1 coding. Notice I put it above Sims1. The reason is the sims3 coding doesn't require "goto next" and so this is much easier and less troublesome if you forget to include that 1 line.
And that's it! Notice that this doesn't modify the "Random" selector. So you can have a list of entries, but still limit how many you want to random.
3) Random selector. To modify the random selector, you just increase the number by 1. However, some people may not want certain themes to be randomized. You need to have all the themes you want to randomize together in sequence like 1-3 or 1-4 etc.. or 2-4 so it will random the range.
Quote:
:random SET /A num=%RANDOM%%%4+1 goto selected |
And you are done! Save the bat file, create a short cut link, give the link a nice TS3 icon and enjoy all the musical themes for this game!!

Sanity is overrated.
Nitromon is a type of Pokemon encountered in the Pokemon Nitrome Version series.
There. Mystery solved.
#3
8th Jan 2020 at 8:23 AM
Last edited by nitromon : 8th Jan 2020 at 8:47 AM.

Posts: 7,731
Thanks: 929 in 31 Posts

Once again, I'm not bumping the thread, but adding a 3rd tutorial. I hope the mods don't mind. I didn't want to combine it with the previous b/c it modifies both at the same time it is exclusive in itself. The above methods will work 99% of the time. However, custom music mod is new and there are still some issues of instability that need to be examined.
Under extreme stress such as playing a huge world in a blizzard snowstorm while simultaneously opening several Chrome pages could cause the game with a custom music to crash. Junction link may increase the risk of instability, especially if double linking is involved. Single link may still be ok, which is why the above methods will work for 99% of the users. However, I also overlook the fact people run different mods, different systems, etc... so a weaker system or one overburdened with mods/ccs may still have a higher risk of crash.
What is Double Linking?
Again, the chance of crash is minimal unless you actually meet the above criteria, most notable for double linking. Double linking is when you link a folder to a drive and then link a subfolder in the folder into another drive. Each link creates a latency. Double linking folders such as the save folder, library folder, is fine b/c they're static folders that only operate during saving and loading. However, double linking dynamic files creates a latency and in the case of custom music, could crash.
Example:
You link the whole TS3 folder to a ramdisk. Then you link the save folder from the TS3 folder on the ramdisk back to the HDD. This is acceptable. However, if you link the cache files back to the HDD, that creates a latency from double linking a dynamic file which is read and written during gameplay.
Bottom Line: The junction link methods above will work for 99% of the people. It is the preferred method b/c it is fast, all you are doing is creating a junction link each time you choose. After selecting, it loads the game instantaneously. Using "copy" is slower as it needs to copy the files, so you may have to wait a few seconds. So if you are experiencing random crashes while using a custom music theme with the above method, you might want to switch over to use the "copy" method.
How to modify the above coding to use "Copy" instead:
Quote:
rmdir "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" |
Remove this line from above as you will no longer need it. Instead, actually create the folder in the location desired.
Quote:
:sims1 mklink /j "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" "G:\TS1Music\" goto next |
Modify this coding for each entry. Replace "mklink /j" with "copy" and switch the destination and source. Also add the line to empty the altmusic folder. Your new code should look like this:
Quote:
:sims1 del "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" /q copy "G:\TS1Music\" "c:\users\nitromon\documents\electronic arts\the sims 3\mods\packages\altmusic\" goto next |
And that's it. You are done. Now whenever you pick a choice, it will empty the altmusic folder and then copy your selection into it.
For both the junction link and copy, if you do not want it to run TS3 afterward and just exit, then simply replace this line:
Quote:
:next cls "c:\program files (x86)\electronic arts\the sims3\game\bin\TS3W.EXE" echo on |
with:
Quote:
:next cls echo You have chosen Music Number %num%! pause echo on |
Sanity is overrated.
Nitromon is a type of Pokemon encountered in the Pokemon Nitrome Version series.
There. Mystery solved.
Who Posted
|