Page 1 of 1

AWS Alarm Script

Unread postPosted: Thu May 05, 2011 9:35 am
by LoneWolfDon
** Update: For the newest version of my script and info about running it properly, which works with Windows 7, view my post here:
viewtopic.php?f=6&t=2181#p33539

If driving trains in RailWorks using the Expert-controls, and if using other views other than the interior cab-view, while watching the scenery and such it can be easy to miss the AWS warning-light coming on the HUD, and in views outside the cab, then you can't hear the AWS alarm sound.

So, I've wrote a little script that will detect when the AWS warning-light comes on and then will play an alarm sound, and guess what, it works for all camera views.

Here's what you need to do if you want to try it;
Download my the beta version of this script at:
http://www.rryard.com/files/AWS_Alarm_1 ... ta_v01.zip

Un-zip the downloaded file, and you should have a folder, named "AWS_Alarm_1680x1050_beta_v01", containing two files:
"AWS_Alarm_1680x1050.exe" and "Alarm01.wav".
Keep both files together in the same folder, and have folder in a place at your convenience (such as your Desktop or other easy to find location).

Next, from that folder, double click the "AWS_Alarm_1680x1050.exe" to run the self-contained executable script.
An icon should appear in your Windows system-try to indicate it's running. This script uses very little memory and resources to run, so it should not cause any problems in that regards.

Now, have RailWorks set to run in Fullscreen mode and with a Resolution setting of 1680x1050 (currently that's what I'm using).
When you have those settings in place, Start RailWorks normally.

Next, use Expert-Controls (Uncheck the "Simple Controls" Option from within RailWorks).

For this script to work, it requires that the default F4 Driver's HUD be on. If that HUD is off, it won't detect when the AWS warning-light comes on.
Now, choose to drive a route / scenario / train of your choice that you expect the AWS warning to come on sometimes.

Drive the train as normal, (but remember to leave the default F4 Driver's HUD on for the script to detect the AWS warning light), and you can choose an external camera view now if you like.

When the AWS warning-light comes on, regardless of what camera-view you have selected, you should now hear a "ringing" alarm-sound to alert you that the AWS warning light has come on. Acknowledge the AWS warning as you normally would (example; a click on the AWS button), and the ringing alarm-sound should shut-off as well.

Once you finish playing RailWorks, right-click on the script-icon in your system-tray and select "Exit".
And, that's it folks! :D

So, who wants to help me test this? So far, I've tested this script with good success.
If it works for other people and if there's interest, I can then adjust the script (or make a different version of the script), to work for other screen-resolution size formats.

Feedback welcome.
Cheers! --- Don.

Re: AWS Alarm Script

Unread postPosted: Thu May 05, 2011 12:52 pm
by johnmckenzie
I'll give it a go, Don! I'll let you know how I get on. Thanks very much!!

Re: AWS Alarm Script

Unread postPosted: Sun May 15, 2011 10:22 am
by Samwolf
Love the idea behind this but was not able to get it to work.

Full screen mode on
Screen resolution 1680 x 1050
Expert mode on
F4 Hud On
EAX on

No audible sound in Headout view or external view. *!sad!*

Re: AWS Alarm Script

Unread postPosted: Sun May 15, 2011 7:52 pm
by LoneWolfDon
Hmmm.. Strange. It works for me and some other people that have tried it says it works for them as well.
It was a bit of an experiment anyways. The script detects a specific color-change from the area of the screen where the alarm-warning button is on the HUD.

It could be that it just doesn't work with some people's graphic-cards / resolutions? Or it could be the script is not compatible with your version of Windows (I'm still using Windows XP home edition, 32-bit) or is not able to automatically play a "wav" sound file via that method.
What resolution do you normally play RailWorks in and what version of Windows? 1680x1050 is the highest resolution I'm able to use with my current hardware.

PS: It could be due to the most recent update to RailWorks. I haven't tested this script with it yet, so I'll try it out and see if it still works or not (looks like one of the updates was about the AWS on the HUD, so they could have slightly "moved" that position and/or color for the specific part my scripts looks for, which would then make the script not detect it properly).

*Update: I just tried it, and the script still works fine for me on my computer. So, it looks like it might be a hit-or-miss depending on some people's computer, Windows version, software settings and such perhaps. I'm not sure.

Re: AWS Alarm Script

Unread postPosted: Sun May 15, 2011 8:37 pm
by Samwolf
I use 1680 X 1050, but I'm running Win7 64 bit and have a Radeon Graphics card. Thought I'd give your app a try.

Re: AWS Alarm Script

Unread postPosted: Tue Jul 12, 2011 6:20 pm
by LoneWolfDon
*Edit: Newest version of my script removed for now as people who have tried it have reported that it's not working as it should. So, until I can figure it out for the higher screen-resolutions, it's best I removed that version.
You can still try my original version, which does work for me and some other people too (but it may not work for everyone or on all computers).

Re: AWS Alarm Script

Unread postPosted: Tue Jul 12, 2011 11:33 pm
by arizonachris
All I did with the original script was to change 1680x1050 to 1920x1080 where ever it called the resolution, and it worked fine. !*don-know!* (Cause I run 1920x1080) maybe I just got lucky and it decided to work?

Re: AWS Alarm Script

Unread postPosted: Wed Jul 13, 2011 12:00 am
by LoneWolfDon
Ok. Cool. Maybe somehow with RailWorks it automatically readjusts the to proper co-ordinates I look for in my script.

Re: AWS Alarm Script

Unread postPosted: Tue Oct 11, 2011 10:06 am
by LoneWolfDon
Newest version of my script here:
http://www.rryard.com/files/AWS_script_beta14.zip

I've tested it on my computer now running Windows 7, 64 bit. It works fine for me on my computer but a couple of things you have to do to get it working properly.
Like before, I've made this for a resolution of 1680x1050 in full-screen mode.

Windows 7 does something strange (I guess it's a part of the Aero), where even if you're running a full-screen game, it seems to keep some kind of focus on the Windows Desktop (if you ever tried to take a screen-shot of a game playing Windows 7 using your PrtScr key, then wondered why when you go to paste the image into some graphic editing program why you see an image of the Windows Desktop instead of the game). This was also messing up my little script.

But, there's a work-around for that.
Go to your folder where you have your RailWorks (RW3 / Train-Simulator 2012) installed.
Right-click on the "RailWorksProc2.exe" file there, Compatibility tab, and check the "Disable Desktop composition" option there, Apply and OK.

Now when you go to use my script with RailWorks on Windows 7, hopefully it should work as intended now. (You'll also be able to use your PrtScr key to take an in-game screen-shot now too).
Hope this script finally works for some of you.
Cheers! :)

**Update: Another version for 1366x768 resolution:
www.rryard.com/files/AWS_1366x768_beta015.zip