Elvas Tower: Specific sound for AI trains - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Specific sound for AI trains Rate Topic: -----

#21 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 05 March 2023 - 04:17 PM

View PostWeter, on 05 March 2023 - 02:43 PM, said:

Hi, Scott.
As its night now here, try and read there, while Carlo is sleeping:
http://www.elvastowe...post__p__216060
Then, there:
http://www.elvastowe...post__p__243126
Numbers are increased from 16x to 32x, as since 2017 many new triggers were introduced, occupying 100-200 range.


Hi Weter,

Thanks - I'll take a gander.

Regards,
Scott

#22 User is offline   darwins 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,231
  • Joined: 25-September 17
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 05 March 2023 - 10:16 PM

So let me experiment with ORNYMG.
The problem was wanting AI trains in timetable mode to ignore Variable_2 see http://www.elvastowe...post__p__293270
Of course when one is selected as a player train then the relay sounds are wanted because they work correctly.


#23 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 06 March 2023 - 12:14 AM

Some replies:
Here an excerpt of an .sms file that uses some of the triggers:
					Stream (
				Skip (**** ORTS AI: bell entering station ***************************************)
		Priority ( 7 )
		Volume ( 1.1 )
		Triggers ( 7
				Initial_Trigger ( DisableTrigger ( 3 ) )
				Discrete_Trigger ( 320 EnableTrigger ( 3 ) )
				Discrete_Trigger ( 324	StartLoopRelease ( 1	
													File ( "x_hhp_bell1.wav" -1 )	
													SelectionMethod ( RandomSelection ) 
												)
								)

				Variable_Trigger ( Speed_Dec_Past 0.1 ReleaseLoopReleaseWithJump ( ) )
				Discrete_Trigger ( 321 DisableTrigger ( 3 ))
				Discrete_Trigger ( 322 DisableTrigger ( 3 ))
				Discrete_Trigger ( 323 DisableTrigger ( 3 ))				
		)
		VolumeCurve(
			SpeedControlled
			CurvePoints ( 5
				-100.0 1.0
				-2.0 1.0
				0 1.0
				2.0 1.0
				100.0 1.0
			)
			Granularity ( 0.1 )
			)
		)	
		
							Stream (
				Skip (**** ORTS AI: bell exiting station ***************************************)
		Priority ( 7 )
		Volume ( 1.1 )
		Triggers ( 9
				Initial_Trigger ( DisableTrigger ( 3 ) )
				Discrete_Trigger ( 320 EnableTrigger ( 3 ))
				Discrete_Trigger ( 325 EnableTrigger ( 4 ))
				Variable_Trigger ( Speed_Inc_Past 0.1	StartLoopRelease ( 1	
													File ( "x_hhp_bell1.wav" -1 )	
													SelectionMethod ( RandomSelection ) 
												)
								)

				Variable_Trigger ( Speed_Inc_Past 5.0 ReleaseLoopReleaseWithJump ( ) )
				Variable_Trigger ( Speed_Inc_Past 5.0 DisableTrigger ( 4 ))
				Discrete_Trigger ( 321 DisableTrigger ( 3 ))
				Discrete_Trigger ( 322 DisableTrigger ( 3 ))
				Discrete_Trigger ( 323 DisableTrigger ( 3 ))				
		)
		VolumeCurve(
			SpeedControlled
			CurvePoints ( 5
				-100.0 1.0
				-2.0 1.0
				0 1.0
				2.0 1.0
				100.0 1.0
			)
			Granularity ( 0.1 )
			)
		)	

First stream sound requires that the related locomotive is the AI train lead to enable trigger 324, which in turn is triggered when the locomotive is at 150 meters (hardcoded) from the station. In this case the bell starts playing. The sound stops when the loco reaches 0 speed. The last triggers disable trigger 324 when the locomotive becomes part of a player train, or is no more a lead locomotive.

Second stream sound again requires that related locomotive is the AI train lead to enable trigger 32, which in turn is triggered as soon the locomotive restarts from a station stop. In this case again the bell starts playing. The sound stops when the loco reaches a speed of meters per second (this can be modified in the .sms file). The last triggers disable trigger 325 when the locomotive becomes part of a player train, or is no more a lead locomotive.

Both streams might be modified to play the horn instead of the bell, or to play both.

The triggers may be used also to enable other sounds specific to AI trains, e.g. a horn blast or a bell sound at every restart from zero speed, as well as specific brake sounds and so on.

I'm sorry, but at the moment triggers 324 and 325 are not implemented for timetables. I haven't yet tested how the other triggers work with timetable mode. Maybe some adjustments are needed.

#24 User is online   Weter 

  • Member, Board of Directors
  • PipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 6,897
  • Joined: 01-June 20
  • Gender:Not Telling
  • Simulator:ORTS
  • Country:

Posted 16 April 2023 - 12:14 PM

So, no more trigger 161, but 320 and so on instead?

#25 User is offline   darwins 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,231
  • Joined: 25-September 17
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 16 April 2023 - 08:38 PM

Thanks Carlo,
                        case 322: return Event.PlayerTrainLeadLoco;
                        case 323: return Event.PlayerTrainHelperLoco;
Would certainly solve my problems with electric train relay sounds going wild. For trains with multiple unit control then I could include 322 and 323 with all motor cars.

Even better, using 322 only then I can make a sound set for a "Direct Control" multiple unit - where all the contactors are in the driving compartment and power is taken to the other end of the train by bus cables.


#26 User is offline   Laci1959 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 939
  • Joined: 01-March 15
  • Gender:Male
  • Simulator:Alföld
  • Country:

Posted 17 April 2023 - 06:31 AM

Hello.

I broke up years ago using the 14, 53, 54 triggers. There is a well-functioning OR trigger for this. I found it years ago in a Slovakian car. I really liked the solution and it was included in every vehicle.

Stream (
	Priority ( 5 )
	Triggers ( 2
		Variable_Trigger ( BrakeCyl_Inc_Past 2 PlayOneShot ( 1 File ( "../../common.snd/fek/k_fek_fekez.wav" -1 ) SelectionMethod ( SequentialSelection ) ) )
		Variable_Trigger ( BrakeCyl_Dec_Past 2 PlayOneShot ( 1 File ( "../../common.snd/fek/k_fek_old.wav" -1 ) SelectionMethod ( SequentialSelection ) ) )
	)
	VolumeCurve (
		DistanceControlled
		CurvePoints ( 2
			 30	  	1.0
			100		0.0
		)
	Granularity ( 0.05 )
	)
)


When the air pressure in the brake master cylinder increases, it plays the air hissing sound once. When air enters the working cylinder.
When the air pressure in the brake master cylinder drops, it plays the air hissing sound once. When the air escapes from the working cylinder.
It doesn't matter if it's a driven locomotive, a second locomotive pulling a car, or a complete AI train.
Although not so long ago I noticed that it was also broken. It used to be good, but now it doesn't work. Not sure, but I'll give it a try.

Sincerely, Laci1959

#27 User is offline   darwins 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,231
  • Joined: 25-September 17
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 17 April 2023 - 11:10 AM

I think they were still working last time I tried. I have been using something similar.
 Stream ( Skip ( **** 4 - brakes **** )
  Priority ( 5 )
  Triggers ( 2
  Variable_Trigger ( Speed_Dec_Past 0.5 PlayOneShot ( 3 File ( "squeal01.wav" -1 ) File ( "squeal02.wav" -1 ) File ( "squeal03.wav" -1 ) SelectionMethod ( RandomSelection ) ) )
  Variable_Trigger ( BrakeCyl_Dec_Past 4.0 PlayOneShot ( 1 File ( "air_release.wav" -1 ) SelectionMethod ( SequentialSelection ) ) )
	)
   )



#28 User is offline   Niknak 

  • Conductor
  • Group: Status: First Class
  • Posts: 271
  • Joined: 19-July 20
  • Gender:Male
  • Location:Kent UK
  • Simulator:OR NewYear MG
  • Country:

Posted 19 December 2023 - 03:27 AM

Attached File  sd40eng.zip (4.66K)
Number of downloads: 34Regarding the AI train horn playing when approaching the player train and on startup - Can someone please confirm whether trigger 320 is still correct? Had it working on my old setup but can't get the AI's horn to sound now on my new installation. I'm assuming I don't need to download the 2 app files and the dll that were mentioned back in the 2017 post. Many thanks. No errors on OR log

#29 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 19 December 2023 - 10:46 AM

Nick, sorry, my fault. When I ported this feature to the official OR version, trigger 320 was being used for something else, so I had to increment all AI sound trigger numbers by 10. So what first was 320 is now 330 and so on. But I forgot to mention this here.
Here the actualized trigger list, valid both for ORNYMG and for the Unstable release
                        // AI train related events
                        case 330: return Event.AITrainLeadLoco;
                        case 331: return Event.AITrainHelperLoco;
                        case 332: return Event.PlayerTrainLeadLoco;
                        case 333: return Event.PlayerTrainHelperLoco;
                        case 334: return Event.AITrainApproachingStation;
                        case 335: return Event.AITrainLeavingStation;


#30 User is offline   Niknak 

  • Conductor
  • Group: Status: First Class
  • Posts: 271
  • Joined: 19-July 20
  • Gender:Male
  • Location:Kent UK
  • Simulator:OR NewYear MG
  • Country:

Posted 19 December 2023 - 11:27 AM

Carlo you do so much for us all here that I'm happy to forgive you, and after all it is Christmas.... :sign_thanks:

  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users