Triggering Messages

Discussion about RailWorks scenario creation.

Triggering Messages

Unread postby PolyesterMafia » Mon Jan 13, 2014 7:40 pm

I know how to trigger an on screen message using the "Stopping Point" instructions, but I don't want to use the SP, because I don't need to stop or give away what is going to happen next in the instructions list. What I want to do is trigger a message using a Waypoint and a Trigger Instructions (the icon that looks like paper with a gear on it). If you place the TI after a Waypoint, put a time in it, say +01:00, does it generate the message one minute after you pass the Waypoint, or one minute after the actual Scenario beginning?
PolyesterMafia
 

Re: Triggering Messages

Unread postby artimrj » Mon Jan 13, 2014 8:05 pm

It is one minute after the last event. A drop off, a pick up, a stop at/go via, a previous trigger, the start of the scenario. The timer starts at the end of the last event.
Bob Artim - Generation X²
I don't have a PHD, I have a DD214... Freedom carries sacrifice
I'm crawling in the dark looking for the answer
User avatar
artimrj
 
Posts: 4721
Joined: Sun Jan 31, 2010 3:07 pm
Location: Beaver, Pennsylvania

Re: Triggering Messages

Unread postby PolyesterMafia » Tue Jan 14, 2014 9:18 pm

And now for Part 2: Can an AI train be used to trigger a message that the player can see? Say, you want to simulate radio chatter, such as an AI train passing a nearby signal and announcing the signal indication, or triggering an instructional message after it passes by?
PolyesterMafia
 

Re: Triggering Messages

Unread postby artimrj » Tue Jan 14, 2014 10:12 pm

As far I know, no you can not program a trigger for the AI for the player to see. I do not think you can even program a trigger for the AI period. What your saying is what we have wanted for a long time. A trigger event triggered by a location. There are still too many thins we do not know how to use in the new enhancements. You could have a go via event and a trigger to fire 1 second after that. But what will you make the trigger do? It would have to come from a script I imagine much like the extended dialog windows.
Bob Artim - Generation X²
I don't have a PHD, I have a DD214... Freedom carries sacrifice
I'm crawling in the dark looking for the answer
User avatar
artimrj
 
Posts: 4721
Joined: Sun Jan 31, 2010 3:07 pm
Location: Beaver, Pennsylvania

Re: Triggering Messages

Unread postby PolyesterMafia » Wed Jan 15, 2014 12:51 am

Interesting. I thought that since you can use a Destination Marker in conjunction with a timed Stop-At instruction to slow down an AI, you might be able to trigger a message with it.
PolyesterMafia
 

Re: Triggering Messages

Unread postby Chacal » Wed Jan 15, 2014 2:30 am

Maybe the AI driver gets the pop-up on HIS screen.
But we'll never know.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6522
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Triggering Messages

Unread postby PolyesterMafia » Wed Jan 15, 2014 3:38 am

Ok, for what it's worth...

PapaXpress pointed me in the direction of a LUA code for generating onscreen messages. Well, I'm no good with LUA, so I did a little further searching and came up with the LUA code for various scenarios on the HSC. If you go to the folder that contains the Helper on the Curve scenario, you will see a Scenario Script LUA file. Most interesting are the Timed Triggers. The name in quotations after the "if event ==" refers to a name which is placed in the Succesful Event field at the bottom of a Triggered Stop in your scenario. When you hit the TE that contains the name "start", the LUA triggers an .html file (contained in the En folder) that has a folder and a message. Quite simple, if you know LUA.

Unfortunately, I don't, but I'm like the Chinese: not worth a dern at inventing anything, but real good at "adapting" what has already been done. So, I copied the files over to my Scenario folder, changed the references within the LUA file to my Scenario folder, and within a few minutes had nice picture messages. Now there are still a few things I need to do, like remove the references that lock the locomotive controls, but its a start.
PolyesterMafia
 

Re: Triggering Messages

Unread postby OldProf » Wed Jan 15, 2014 10:44 am

PolyesterMafia wrote:And now for Part 2: Can an AI train be used to trigger a message that the player can see? Say, you want to simulate radio chatter, such as an AI train passing a nearby signal and announcing the signal indication, or triggering an instructional message after it passes by?


Try this: instead of using a trigger instruction, use a Drive To / Go Via. For example, look at the AI driver's route in the editor and select an intermediate marker, then create a Go Via (a Drive To with the speed set at 1 or more mph/kph) and place a message in the appropriate box. In some cases (but this is not consistent and I haven't tried it since TS2014 made its appearance), the message will display on screen when the AI engine passes through the marker. Both I and another scenario writer I know have used this successfully in the past. Be aware, however, that the editor may not allow a Go Via to be placed at a particular marker, even though the editor clearly shows the train passing through it -- another of those "go figure" moments we all enjoy so much in this sim).

Just one added note about turning a Drive To instruction into a Go Via: any speed may be assigned to an AI train, thus controlling that train's velocity through the marker, but assigning anything more than 1 to the player train may result in failure (i.e., no check mark in the F1 list and possibly no green check at the end) if the train does not pass through the marker at that precise speed. I've never tried using this as a way to penalize a player for speeding, but that can be done through the use of a LUA script, as demonstrated in some of the scenarios included with the Stevens Pass route.

As already mentioned, having an AI train take a designated action when the player train reached a particular marker is a much desired goal for scenario writers.
Tom Pallen (Old Prof)

{Win 10 Home 64-bit; Intel Core i7 6700 @ 3.40GHz; 16.0GB Single-Channel @ 1063 MHz (15-15-15-364); 2047MB NVIDIA GeForce GTX 960}
User avatar
OldProf
 
Posts: 2743
Joined: Wed Sep 09, 2009 10:09 am

Re: Triggering Messages

Unread postby PolyesterMafia » Wed Jan 15, 2014 5:04 pm

I did try the method you suggested for the "Drive To/Go Via", basically turning the instruction into a Waypoint. It's great for making the AI trains slow down, since they seem to run at top speed no matter what the speed limit actually is. But I have not been able to get the AI to trigger a message that I can read.

I've had hit or miss using the DTGV for my player train. In 95% of the cases, it works flawlessly, but there is one particularly frustrating instance where trying to use a zero-time and 1mph instruction causes the player train to conflict with an oncoming AI, even though the AI has priority and i'm at a signal that will not clear until the AI passes. If I change the zero-time to one second, then all is resolved, but that makes it a stop point, which means it will show up in the task list and ruin the surprises in store down the road.

Now though that i've been pointed to the Scenario LUA files, I can pretty much display a message at any time, provided there is a marker that the train can interact with. It can also do so much more. Pretty much any control name that is located in the Engine Blueprint can be controlled from the Scenario LUA. If the players don't want to go through the trouble of starting the locomotive, or if you want the locomotive to be moving when the scenario starts, or even if you want the locomotive to fail during the scenario, it can be controlled from that script. I've already created a "Drone" with it, starting the loco by remote, having it blow it's horn at a certain point, and then shutting it down. I haven't tested it yet, but I think i've seen code that will allow for control of an AI train as well.
PolyesterMafia
 

Re: Triggering Messages

Unread postby OldProf » Thu Jan 16, 2014 11:22 am

Two quick comments:

1) It would be very helpful to know the player engine's priority in relation to all of the others that are available. Usually, the PT seems to trump all other trains, but this is not always true.

2) Using LUA scripting to have an AI train sound its horn strikes me as a useful tool, even though I have yet to figure out how to write LUA code ... I really must get around to experimenting.
Tom Pallen (Old Prof)

{Win 10 Home 64-bit; Intel Core i7 6700 @ 3.40GHz; 16.0GB Single-Channel @ 1063 MHz (15-15-15-364); 2047MB NVIDIA GeForce GTX 960}
User avatar
OldProf
 
Posts: 2743
Joined: Wed Sep 09, 2009 10:09 am

Re: Triggering Messages

Unread postby awaken1977 » Fri Jan 31, 2014 3:21 am

PolyesterMafia wrote:I know how to trigger an on screen message using the "Stopping Point" instructions, but I don't want to use the SP, because I don't need to stop or give away what is going to happen next in the instructions list.


I use Stopping point with 1MPH threshold, so it doesn't require mandatory stop. Instruction triggered either by stop, or by passing by with any speed above the threshold.
awaken1977
 
Posts: 335
Joined: Mon Nov 25, 2013 2:40 am

Re: Triggering Messages

Unread postby Chacal » Fri Jan 31, 2014 5:19 pm

Use a waypoint if you don't want it to show up in the task list.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6522
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada


Return to Scenario Creation

Who is online

Users browsing this forum: No registered users and 1 guest