I will speak using an example.
Here is a test activity for route USA2 (.apk compressed zip)
TestEventAI.zip (2.81K)
Number of downloads: 465
And here is the extension activity file, to be placed in an OpenRails subfolder within the Activities subfolder of route USA2
SIMISA@@@@@@@@@@JINX0a0t______ Tr_Activity ( Tr_Activity_File ( Events ( EventCategoryLocation ( ID ( 1 ) ORTSTrainService ( "TestEventAI" ) ORTSTrainStartTime ( 43230 ) ORTSContinue ( 3 ) ) EventCategoryLocation ( ID ( 2 ) ORTSTrainService ( "TestEventAI" ) ORTSContinue ( 3 ) Outcomes ( ORTSActivitySound ( ORTSActSoundFile ( "milanogrecopirelli.wav" "Ground" ) ) ) ) EventCategoryLocation ( ID ( 4 ) ORTSContinue ( 3 ) Outcomes ( ORTSActivitySound ( ORTSActSoundFile ( "abbadialariana.wav" "Location" ) ORTSSoundLocation ( -12506 14779 -939.019 1159.00 394.96 ) ) ) ) EventCategoryLocation ( ID ( 5 ) ORTSTrainService ( "TestEventAI" ) ORTSContinue ( 3 ) Outcomes ( ORTSRestartWaitingTrain ( ORTSWaitingTrainToRestart ( "TesteventAI_Wait" ) ORTSDelayToRestart ( 5 ) ORTSMatchingWPDelay ( 31230 ) ) ) ) EventCategoryLocation ( ID ( 6 ) ORTSTrainService ( "TestEventAI" ) ORTSTrainStartTime ( 43230 ) ORTSContinue ( 3 ) Outcomes ( ORTSActivitySound ( ORTSActSoundFile ( "leccomaggianico.wav" "Location" ) ORTSSoundLocation ( -12506 14779 -939.019 1159.00 394.96 ) ) ) ) EventCategoryLocation ( ID ( 7 ) ORTSContinue ( 0 ) ) ) ) )
This file is shown in detail to describe syntax and operation of the features.
It must be also said that the data contained in the extension activity file may also alternatively be embedded in the base activity file, with the usual disadvantage that editing of such base activity file with the MSTS AE deletes the additional data.
To link a location event to an AI train either only the train service name can be provided
ORTSTrainService ( "TestEventAI" )
or additionally also the train start time may be provided
ORTSTrainStartTime ( 43230 )
This second parameter is useful when one service is present more than once in an activity.
The rest of the event syntax is the one already known for the activity extensions, with two improvements:
- the first one is that now, like Goku suggested, data about outcomes like activity related sounds and weather changes are inserted in the Outcomes subblock, therefore providing a cleaner structure (the old format however is still supported for weather change and activity sound, with the exclusion of the new feature described in the second point here).
- the second one is that now, as can be seen, activity sounds provide a new feature, which is recalled by following format
ORTSActivitySound ( ORTSActSoundFile ( "leccomaggianico.wav" "Location" ) ORTSSoundLocation ( -12506 14779 -939.019 1159.00 394.96 ) )
meaning that when the AI train (or also the player train) passes over the location event, a sound is played at the location indicated in ORTSSoundLocation. This way e.g. an announcement for a train arriving or passing by can be heard in the station a reasonable time before the train effectively passes or arrives.
The other events above show also the possibility of an AI train commanding the restart of another AI train waiting at a signal, or simply displaying a message, or playing a sound at ground near of the AI train. The other (not used in this example) available activity sound types allow e.g. to play a sound in the cab of the player train when an AI train passes over a location event, allowing to simulate vocal communication exchange from the AI train engineer to the player train engineer.
An absolutely preliminary development (not runtime) patch may be found here
When the feature will be a bit more consolidated I foresee to insert it in the OR MG version, waiting also for eventual approval for insertion in the official OR version.
And I hope that Goku will have time to add this to his OR-oriented activity editor, simplifying creation of these data structures.
12/1/2019: patch file deleted because new release available