Page 1 of 1

Scripting a level crossing flagman?

Unread postPosted: Sat Sep 15, 2018 2:24 pm
by brucedell
Hello. This is my first post on Railworks America, and I've come seeking assistance for the creation of my first asset.
Image
I'm building a turn of the century interurban/streetcar route, and i felt the need to make driving on the route more challenging by minimizing the amount of visual signals for the player to see.
at a certain part of the route the mainline, and the interurban interchanges at a diamond crossover. I felt that having a flagman serve as a visual warning device for the interurban would be a far more immersive way to signify that i need to stop, and wait for a mainline train to pass.
so after 5 days of trial, and error i managed to make a working asset that has 2 animations. one for standing still "open", and one for waving the flag "warn"
Image
However when it comes down to the scripting part i am truly stumped. Mostly because I never worked on the LUA code format before. I'm using the Woodhead Levelcrossing script as a base, but i'm still struggling to make it work even after i dabbled in the code a tiny bit.
however what i basically want to do is this. I have 2 animations i want to loop "open", and "warn". I want the open animation to loop while the level crossing is in the open state, and the warn flag animation to loop while the animation is in the Closed state.
If anyone could assist me on this issue it would be great.

Re: Scripting a level crossing flagman?

Unread postPosted: Sat Sep 15, 2018 3:58 pm
by harryadkins
Hope you are able to work it out. I'm sure there are those on this forum who are up to the task.

Harry

Re: Scripting a level crossing flagman?

Unread postPosted: Mon Sep 17, 2018 6:48 pm
by brucedell
Well when it comes down to the coding part. i wasn't able to really get what i wanted, however i was able to get a similar effect, by just extending the animation by 3 minutes, now the asset is functional when triggered by a mainline train.

https://www.youtube.com/watch?v=0PRlcZR_pJg

Re: Scripting a level crossing flagman?

Unread postPosted: Mon Sep 17, 2018 9:33 pm
by BoostedFridge
Thats pretty impressive.

Re: Scripting a level crossing flagman?

Unread postPosted: Tue Sep 18, 2018 7:54 am
by ET44C4
Impressive indeed! Great work, sir.

Re: Scripting a level crossing flagman?

Unread postPosted: Tue Sep 18, 2018 6:17 pm
by CArailroader
That is excellent! Once done do you think you will release this ahead of your route? This would be awesome to have on some routes.

Re: Scripting a level crossing flagman?

Unread postPosted: Tue Sep 18, 2018 9:22 pm
by brucedell
CArailroader wrote:That is excellent! Once done do you think you will release this ahead of your route? This would be awesome to have on some routes.

I plan to release it along with the route because phase 1 of it is just about complete. I also need to clean up the Asset Directory, to make it easy to share. This should take at least a week or so. I'm going to be posting more details about this route In the Route design section. The route name is southern corridor, and the details post should be uploaded sometime tonight.