Post Reply 
 
Thread Rating:
  • 1 Votes - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anyway to add or remove certain music?
Author Message
whybuybeta Offline
Member
***

Posts: 131
Joined: Feb 2008
Post: #31
RE: Anyway to add or remove certain music?
here's a batch to generate/compile the playlist. just paste this into luag.bat, and copy it over to your music directory with the luac compiler, then you can run it whenever you make changes to your playlist. full guide here.

Code:
::
:: Tropico3 playlist generator batch:
:: - run this batch to generate and compile custom lua playlists from music directory.
::
:: directions:
:: -1. create .\music folder in root directory of your game install
:: -2. add/remove your ogg tracks there
:: -3. copy luac.exe and this luag.bat batch to your music folder
:: -4. run this whenever you add/change any music to generate a new playlist and enable it in game
:: -5. thanks to slserpent for the lua compiler, enjoy your new soundtrack!
::
:: IMPORTANT:
:: - this batch must be named luag.bat, and run in your music folder named .\music,
::   the folder should also be placed in the same directory as tropico3.exe in the root
::   of your game install, to prevent from creating/messing with any unwanted files.
::
@echo off
title=LUA Playlist Generator

:: look for tropico/music/compiler
echo.
echo ::
cd ..
if not exist tropico3.exe echo :: tropico3 not found! aborting. & goto end
if not exist .\music\luag.bat echo :: halp I'm lost! & echo :: make sure you have properly named and copied this batch to the music directory. & goto end
if exist .\music\luac.exe (echo :: looking for ogg files...) else (echo :: lua compiler not found! & echo :: This batch is to be run with luac.exe in your music directory. & goto end)
cd music
echo ::

:: generate playlist
set _txt=playlists.txt
set _anum=0
echo namespace("Playlists") > %_txt%
echo DefaultSilenceChance = 25 >> %_txt%
echo DefaultSilenceDuration = 15000 >> %_txt%
echo DefaultCrossfadeTime = 3000 >> %_txt%
echo BattleMusicTimeout = 60000 >> %_txt%
echo AllTracks = {} >> %_txt%
for /f "tokens=*" %%g in ('dir /b *.ogg') do (call :trackn "%%g")
echo ::
if %_anum% equ 0 (echo :: no tracks found! let's make some music. & goto end) else (echo :: %_anum% tracks found! & goto luac)

:: fill array elements - format:
:: AllTracks[N] = {path="Music/<filename>", frequency=100, SilenceDuration=DefaultSilenceDuration, SilenceChance=DefaultSilenceChance}
:trackn
set /a _anum+=1
echo :: found: %~1 & echo AllTracks[%_anum%] = {path="music/%~1", frequency=100, SilenceDuration=DefaultSilenceDuration, SilenceChance=DefaultSilenceChance} >> %_txt%
goto :eof

:: compile playlist
:luac
echo ::
echo :: compiling playlist...
if not exist ..\data\sounds\playlists md ..\data\sounds\playlists
luac -o ..\data\sounds\playlists\playlists.lua %_txt%
if errorlevel 1 (echo :: lua error! & goto end) else (echo :: playlist complete.)
echo ::
echo :: thanks to slserpent for the lua compiler!
echo ::

:: viva el presidente
:end
echo :: press a key to quit...
echo ::
echo.
pause >nul
::
(This post was last modified: 23-02-2010 10:57 AM by whybuybeta.)
23-02-2010 10:50 AM
Find all posts by this user Quote this message in a reply
avatarserg Offline
Newbie
*

Posts: 1
Joined: Jan 2012
Post: #32
Help! No Music in main menu!
Please, help me with the problem I faced.

I created my own playlist for Tropico 4(tracks from 3rd and 4th parts), but it works only in game. There is no music in main menu and campaign when you choose characters.

Anyone knows how to resolve this?
16-01-2012 08:35 PM
Find all posts by this user Quote this message in a reply
slserpent Offline
Junior Member
**

Posts: 11
Joined: Feb 2010
Post: #33
RE: Anyway to add or remove certain music?
The format of the playlist in Tropico 4 is slightly different. why? i'm not really sure, but it does allow you to change the menu music.

see this thread: http://forum.kalypsomedia.com/showthread...#pid109254
16-01-2012 11:53 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | kalypso media :: website | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication