AWS Alarm Script

Discuss almost anything about RailWorks.

AWS Alarm Script

Unread postby LoneWolfDon » Thu May 05, 2011 9:35 am

** 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.
Last edited by LoneWolfDon on Tue Oct 11, 2011 10:19 am, edited 1 time in total.
RailWorks Route & Scenario addons, video tutorials and other resources at http://www.RRYard.com
User avatar
LoneWolfDon
 
Posts: 279
Joined: Wed Dec 16, 2009 1:41 am
Location: Canada

Re: AWS Alarm Script

Unread postby johnmckenzie » Thu May 05, 2011 12:52 pm

I'll give it a go, Don! I'll let you know how I get on. Thanks very much!!
User avatar
johnmckenzie
 
Posts: 642
Joined: Sat Mar 12, 2011 8:17 am
Location: Lancashire, England

Re: AWS Alarm Script

Unread postby Samwolf » Sun May 15, 2011 10:22 am

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!*
If God had intended for man to fly, He wouldn't have given us the railroads.
User avatar
Samwolf
 
Posts: 762
Joined: Mon Aug 30, 2010 6:57 pm
Location: South Carolina, CSA

Re: AWS Alarm Script

Unread postby LoneWolfDon » Sun May 15, 2011 7:52 pm

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.
RailWorks Route & Scenario addons, video tutorials and other resources at http://www.RRYard.com
User avatar
LoneWolfDon
 
Posts: 279
Joined: Wed Dec 16, 2009 1:41 am
Location: Canada

Re: AWS Alarm Script

Unread postby Samwolf » Sun May 15, 2011 8:37 pm

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.
If God had intended for man to fly, He wouldn't have given us the railroads.
User avatar
Samwolf
 
Posts: 762
Joined: Mon Aug 30, 2010 6:57 pm
Location: South Carolina, CSA

Re: AWS Alarm Script

Unread postby LoneWolfDon » Tue Jul 12, 2011 6:20 pm

*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).
Last edited by LoneWolfDon on Wed Jul 13, 2011 9:17 pm, edited 1 time in total.
RailWorks Route & Scenario addons, video tutorials and other resources at http://www.RRYard.com
User avatar
LoneWolfDon
 
Posts: 279
Joined: Wed Dec 16, 2009 1:41 am
Location: Canada

Re: AWS Alarm Script

Unread postby arizonachris » Tue Jul 12, 2011 11:33 pm

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?
Ryzen 7 2700K, Asus Prime X570P, 32Gb DDR4, 2x 1Tb M.2 SSD's, RTX2060 6Gb, Occulus Rift
Win 10 Pro 64bit, keyboard/ mouse/ wheel/ pedals/ baseball bat
Security Coordinator on the Battleship Iowa
User avatar
arizonachris
 
Posts: 3955
Joined: Sun Mar 21, 2010 10:36 am
Location: Southern California

Re: AWS Alarm Script

Unread postby LoneWolfDon » Wed Jul 13, 2011 12:00 am

Ok. Cool. Maybe somehow with RailWorks it automatically readjusts the to proper co-ordinates I look for in my script.
RailWorks Route & Scenario addons, video tutorials and other resources at http://www.RRYard.com
User avatar
LoneWolfDon
 
Posts: 279
Joined: Wed Dec 16, 2009 1:41 am
Location: Canada

Re: AWS Alarm Script

Unread postby LoneWolfDon » Tue Oct 11, 2011 10:06 am

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
RailWorks Route & Scenario addons, video tutorials and other resources at http://www.RRYard.com
User avatar
LoneWolfDon
 
Posts: 279
Joined: Wed Dec 16, 2009 1:41 am
Location: Canada


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest