RedRaptor10
2017-08-25T06:52:42Z
Hello everyone. This tutorial is a bit more lengthy than my last one. Here I want to share how to play certain songs depending on what AI deck you play against. I admit I'm not too familiar with the coding languages, but I'll do my best to explain how everything works.

How it works:
Basically you will be checking the system.conf file for whenever it gets modified. Everytime you pick an AI deck to duel against, system.conf will update automatically and change the lastdeckai value. You will read lastdeckai and find the song for that deck, then replace song.mp3 with that deck's song.

Instructions:
1. First, open up Notepad and copy and paste this code in it. Then save it as ygopro_invis.vbs. This isn't exactly necessary, it just hides the cmd window whenever you launch YGOPRO.
Quote:

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False


2. Go to your sound folder and make a copy of song.mp3, song2.mp3, and song3.mp3 and name them as song_default.mp3, song2_default.mp3, and song3_default.mp3. This is important because you will constantly be renaming your song files so you need to make sure to keep the original files so you don't lose them.

3. Now let's add our custom deck music. Go back to your ygopro-percy folder and create a new folder called sound_deck. Place all of your custom deck music in this folder. Make sure that the name of your music matches the deck it will be used with (ie. If your deck is called AIdeck.ydk then your deck song will be called AIdeck.mp3).

4. Create a new Notepad and save it as ygopro_batch.bat. Then copy and paste this code:


Old code (use this if the above code does not work):

This is a bit long so bare with me. Replace yourpath/ygopro-percy with your YGOPRO directory. The next piece of code opens up YGOPRO.

After that is the Deck Music portion. This will constantly be checking if system.conf has changed (using a loop). If it did change, it will find the name of your AI Deck (lastdeckai). Then it will check if that same name is in your sound_deck folder. If so, it'll replace song.mp3, song2.mp3, and song3.mp3 with that deck music. Otherwise, it'll change your songs back to default. The last bit of code just breaks out of the loop once you exit out of YGOPRO.

5. Finally, right-click on your ygopro_vs.exe file and create a Shortcut. Then right-click on the Shortcut and click on Properties. Navigate to Shortcut and where it says Target, replace it with:
wscript.exe "yourpath\ygopro-percy\ygopro_invis.vbs" "yourpath\ygopro-percy\ygopro_batch.bat"

Now everytime you click on the Shortcut, it will run the batch file and change your music depending on what AI deck you face. Hope you guys like it.
Tea82
2017-08-25T09:27:05Z
Oh another very interesting and amazing trick!![:thumbu:] Good work!![:wink:] Mmm perhaps there is a way but I want to ask you if it's possible to someone with a bat file code to make the system.conf to select a random deck ydk file the deck folder already have on ''lastdeck = ...'' line so every time I open ygopro percy the bat file select me a random deck instead of the last deck I use-make!! On the very past someone make for me a program to simply for another folder to select a random ydk file and put it on deck folder automatically but this need first to use this program and after ygopro percy not to mention that everytime you need to use the program for a 2nd time you need to delete all the ydk files the deck folder have so far!! Now I interesting about a random deck feature when I need to open-use only ygopro percy and perhaps you can do it with a bat file code!!
RedRaptor10
2017-08-25T16:32:16Z
Originally Posted by: Tea82 

Oh another very interesting and amazing trick!![:thumbu:] Good work!![:wink:] Mmm perhaps there is a way but I want to ask you if it's possible to someone with a bat file code to make the system.conf to select a random deck ydk file the deck folder already have on ''lastdeck = ...'' line so every time I open ygopro percy the bat file select me a random deck instead of the last deck I use-make!! On the very past someone make for me a program to simply for another folder to select a random ydk file and put it on deck folder automatically but this need first to use this program and after ygopro percy not to mention that everytime you need to use the program for a 2nd time you need to delete all the ydk files the deck folder have so far!! Now I interesting about a random deck feature when I need to open-use only ygopro percy and perhaps you can do it with a bat file code!!



Hmm I don't exactly know how to do that but I'm sure it's possible with some google searching. You would have to read system.conf and find the lastdeckai value then change that line to lastdeckai = [Random deck] and write to a new system.conf file. Then replace the original system.conf with the new one.
Similar Topics
Users browsing this topic