Train-Sim.Com
MSTS Route Design

How do I generate a BAT file (A question for Sniper or

Notice to all visitors and members of the Train-Sim.Com message forums:
If you plan on using a signature banner in your posts, we would like to remind you that there is a maximum size for banners. That maximum is 450 pixels wide by 120 pixels high, and not to exceed 25k. Your compliance is appreciated. FORUM RULES Problems? There are two common reasons for problems with logging in and posting messages. The first is that you are running a firewall that prevents your messages from being sent to the server. The other is that you have cookies disabled; the DCForum software requires cookies to work properly.

Previous Topic | Next Topic

Printer-friendly copy Email this topic to a friend

Reading Topic #11635

Charter Member · 146 posts

I am modeling two eras, specifically one set in the present and another in the 1940s, for an unreleased route. For modern activities, this route will feature actual dragging/hotbox recordings placed at the same locations as in the prototype. Would a bat file accomplish the objective of turning the DED sounds off and on? Ideally, I would like to give the user the option of selecting these sounds. How would I go about creating a bat file similar to Sniper’s Weeds program. I must warn you that I have little knowledge when it comes to programming. Thanks for the help. Sincerely,
Walter Conklin

Howells, NY
MP 71 "Jct of the NS Southern Tier and Old ER mainline"
Washington, DC
Old B&O Metropolitan Devision

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

RE: How do I generate a BAT file (A question for Sniper, Richard, Mar-21-04, 11:42 PM, (1) RE: How do I generate a BAT file (A question for Sniper, OTTODAD, Mar-22-04, 08:34 AM, (2) RE: How do I generate a BAT file (A question for Sniper, Richard, Mar-22-04, 02:01 PM, (4) RE: How do I generate a BAT file (A question for Sniper, OTTODAD, Mar-22-04, 03:34 PM, (5) RE: How do I generate a BAT file (A question for Sniper, Richard, Mar-22-04, 08:30 PM, (6) RE: How do I generate a BAT file (A question for Sniper, dvdhoven, Mar-22-04, 01:07 PM, (3) RE: How do I generate a BAT file (A question for Sniper, erielackawanna, Apr-24-04, 03:11 PM, (9) RE: How do I generate a BAT file (A question for Sniper, mdeming, Mar-22-04, 09:59 PM, (7) RE: How do I generate a BAT file (A question for Sniper, OTTODAD, Mar-23-04, 10:01 AM, (8)

Conferences | Topics | Previous Topic | Next Topic

Charter Member · 674 posts

RE: How do I generate a BAT file (A question for Sniper

LAST EDITED ON Mar-21-04 AT 11:56 PM (EST)

Walter,
I haven't seen any post from sniper in quite some time, I'm not sure what happened to him? I'll take a shot at your question, since I'm from the days of DOS. Let's say you have two sounds, the first is the DED.wav and the second is a zero file length wav file called dummy.wav. You would want to place this batch file in the route folder.setsound.bat
@echo off
cls
cd sound
if "%1" == "1" goto modernera
if "%1" == "2" goto steamera
goto error:modernera
copy /y ded.bak ded.wav > nul
echo.
echo "Modern Era Enabled"
echo.
goto end
:steamera
copy /y dummy.bak ded.wav > nul
echo.
echo "Steam Era Enabled"
echo.
goto end:error
echo.
echo "You did not specify an era, 1 - for modern, 2 - steam"
echo.:end
cd ..You would name ded.wav to ded.bak and name dummy.wav to dummy.bak when you shipped the route. You could then add two more batch files called:turnon.bat
call setsound.bat 1turnoff.bat
call setsound.bat 2
I hope this helps.Take care,
Rich S.

Attachments
http://www.train-sim.com/dcforum/User_files/405e71ef327c452f.txt
http://www.train-sim.com/dcforum/User_files/405e7200329ac630.txt
http://www.train-sim.com/dcforum/User_files/405e720e32b250cb.txt

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 4740 posts

RE: How do I generate a BAT file (A question for Sniper

Yes, I kept reading this question too, scratching my head to come up with a useful answer to cover all angles.I too am an old DOSser like Jim, in his case less OLD than in mine and have been using Batch Files right up to WIN-XP to take the Drudgery out of many boring, time consuming and repeating processes. They are one of the most powerful tools in Computing still.But to create a Multi-Function Batch File like the one you are after is more work than to ALIAS the few Sounds you may want to change from time to time. New Locos and Sounds versions are coming up all the time and to accommodate them the BATCH File would have to be edited frequently.Easier to ALIAS Sounds as and when ! O t t o

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 674 posts

RE: How do I generate a BAT file (A question for Sniper

LAST EDITED ON Mar-22-04 AT 02:07 PM (EST)

OTTO,
I do not understand your answer? explain to me why my batch file would not work in Walters case. The way I'm understanding Walters question, he wants to add sound objects like the ones found in 3D Train Stuff Tehachapi II route, for talking hotbox detectors. But does not want these sounds to play, if the route is being operated as if it were 1940. Why wouldn't my batch file work?Take care,
Rich S.

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 4740 posts

RE: How do I generate a BAT file (A question for Sniper

Rich,I did not refer to your Batch File at all. It's doing the job is has been created for by you ! I am talking about Batch Files in general and all the various requirements they may have to cater for, casting their nets as far as possible to accommodate them all. Providing of course that the writer of such Batch Files knows what the Input Parameter options are and what the required Output should be.I prefer to deal with one thing at a time when it comes to changing the way MSTS does things. O t t o

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 674 posts

RE: How do I generate a BAT file (A question for Sniper

OTTO,
It's been awhile since I've done any batch file programming, I thought you might have seen something I missed.
Take care,
Rich S.

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 146 posts

RE: How do I generate a BAT file (A question for Sniper

LAST EDITED ON Apr-24-04 AT 03:28 PM (EDT)

Richard,
I am finally getting around to replying. Thank you for the files. After saving the first file as a bat, I proceed to open it up and get the error command. Is the bat menu where I select the sound formats by typing #1 or #2? I saved the associated sound files as specified in your directions.
In all fairness, I am not the developerof the route, just working on some activitites as a project. Sincerely,
Walter Conklin

Howells, NY
MP 71 "Jct of the NS Southern Tier and Old ER mainline"
Washington, DC
Old B&O Metropolitan Devision

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 410 posts

RE: How do I generate a BAT file (A question for Sniper

The basic task of replacing files of one name with another can easily be handled by almost any programming language. VB could handle it easily and use a windows interface, depends on what you are comfortable with. For example you could toggle different carspawners for differing eras with a few lines of code, the user runs the program, clicks a button for the era they want and all cars are of that era. It could happen with sound also just depends on what you want to do.

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 4740 posts

RE: How do I generate a BAT file (A question for Sniper

Stuff like this could be built into the next version of MSTS, allowing users to change all sorts of things at will, like KOSMOS does with the Environment.What's it going to cost if M$ does it ? O t t o

Alert | IP


[ Home | MSTS Forum | MSTS FAQ | File Library ] Copyright © 2004 by Nels Anderson. All Rights Reserved.

Restored from the Train-Sim.Com archive, captured May 28, 2004. About this archive.