Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik

IL-2 Sturmovik The famous combat flight simulator.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-25-2013, 03:56 PM
mrburns mrburns is offline
Approved Member
 
Join Date: Mar 2008
Posts: 22
Default

I'll look into your suggestion, but this code works perfectly. Maybe its because I'm running an I7 processor, but it works fast and doesn't impact my game while its running. The runwait is used to be sure the process is finished before continuing.

You call this routine when you want the files randomized. The files that have been played can't be removed.
This procedure randomizes the source files, removes the files from the destination (except those that are locked) to avoid a buildup of unneeded files, then copies the files from the source to the destination, prepending a 3 digit number that is less than the one used the last time this procedure was called.

Since you can't do anything with the locked files until IL2 exits, its necessary to have a source that isn't locked. Otherwise you can't rename them. Hence the source folder which should never have its files removed as they are the master files.

Last edited by mrburns; 01-25-2013 at 04:09 PM.
Reply With Quote
  #2  
Old 01-26-2013, 12:31 AM
mrburns mrburns is offline
Approved Member
 
Join Date: Mar 2008
Posts: 22
Default

Here's a shorter version. It's self-contained, not relying on the vb script.
It still uses the RADIO_SOURCE folder to get the songs and COPIES them into their respective folders.

GAMEPATH = C:\Ubisoft\IL2_Current
prependCount := 999 ;for renaming radio wav files

RandomizeMusic()
{
global GAMEPATH, prependCount

Loop, %GAMEPATH%\samples\Music\Radio\*.*, 1, 0 ;non-recurse into subfolders
{
FileDelete, %A_LoopFileFullPath%\*.wav
}

Loop, %GAMEPATH%\samples\Music\Radio_Source\*.wav, , 1 ;recurse into subfolders
{
Filename = %A_LoopFileFullPath%
Random, num, 100,999
StringReplace, Name, Filename, Radio_Source, Radio
StringReplace, Filename, Name, %A_LoopFileName%, %prependCount%_%num%_%A_LoopFileName%
FileCopy, %A_LoopFileFullPath%, %Filename%
}

prependCount := prependCount - 1
}
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.