Elvas Tower: ORTS ai horns - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

ORTS ai horns Rate Topic: -----

#1 User is offline   देव 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 84
  • Joined: 06-December 20
  • Gender:Male
  • Simulator:msts
  • Country:

Posted 29 June 2024 - 09:38 AM

Hello, I am trying to make sms for AI horns. As seen in the below picture:
Attached Image: Clipboard Image.jpg

I want that Variable trigger which plays the horn only once with "PlayoneShot", to keep re-activating, after random time intervals, The "Startloop" can be used here, but that will keep playing the horn on repeat, which is kind of irritating and unrealistic, So tried this way, but whatever I tried, the Variable trigger of the horn gets activated only once. Any ideas on how to keep re-activating/re-triggering it in random time-intervals with the "Delay_Min_Max" command?

#2 User is offline   देव 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 84
  • Joined: 06-December 20
  • Gender:Male
  • Simulator:msts
  • Country:

Posted 29 June 2024 - 11:02 AM

View PostWeter, on 29 June 2024 - 10:27 AM, said:

Hello.
What I see now:
trigger 3 is being enabled after 0 to 1 seconds
when speed increases over 16m/s, one of thre files is being played once

Is it what currently is and whad do You need to happen actually?


I want that trigger 3 to keep re-enabling by any possible mechanism after random time intervals, so the Horn repetition will be realistic, As I said StartLoop can be used here in trigger 3 instead of PlayOneShot for repeated honking, but that appears to be irritating and unrealistic, the horn files are played continuously with no time gap in between. With PlayOneShot the files only gets played once, but if this 3rd trigger with "Playoneshot" is re-enabled multiple times after random time intervals, say 3 seconds, 6 seconds, 9 seconds etc. then the honking will appear to be realistic, repeated honking with some time gap in between, Which is not the case if in trigger 3 Startloop is used where there are no time gaps, continuous repeated honking takes place, which I don't want.

#3 User is online   Weter 

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

Posted 29 June 2024 - 11:12 AM

Aha.
So, no reaction is needed, but only random time gaps between honking?
I find this kind of behavior interesting.
All I did see before was blowing horn reaction as a reaction to certain conditions, or, in other words, meeting some rules.

#4 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Posts: Elite Member
  • Posts: 7,450
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 29 June 2024 - 12:49 PM

You could try inserting your PlayOneShot lines in the RandomTrigger line, in place of EnableTrigger (3). If you want to keep the condition that the horn is heard only if the speed is > 0, you can add a SpeedControlled VolumeCurve.

#5 User is offline   देव 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 84
  • Joined: 06-December 20
  • Gender:Male
  • Simulator:msts
  • Country:

Posted 29 June 2024 - 08:59 PM

View PostCsantucci, on 29 June 2024 - 12:49 PM, said:

You could try inserting your PlayOneShot lines in the RandomTrigger line, in place of EnableTrigger (3). If you want to keep the condition that the horn is heard only if the speed is > 0, you can add a SpeedControlled VolumeCurve.


Stream (

			Skip (**** ORTS AI: horn at train crossing***************************************)
			Priority ( 7 )
			Triggers ( 1
				Random_Trigger ( Delay_Min_Max ( 0 1 ) Speed_Inc_Past 16.6667 PlayOneShot ( 3
					File ( "D1.wav" -1 ) 
					File ( "D2.wav" -1 ) 
					File ( "D3.wav" -1 ) 
					SelectionMethod ( RandomSelection ) )   )		 
			)
	)





Tried this but the Speed_Inc_Past is ignored and the horns are played at lower speeds less than 60kmh. :wtf01:
***
Done it, added this way :


Stream (

			Skip (**** ORTS AI: horn at train crossing***************************************)
			Priority ( 7 )
			Triggers (  4

				Initial_Trigger ( DisableTrigger(4) )
				
				Variable_Trigger ( Speed_Inc_Past 16.6667 EnableTrigger(4) )

				Variable_Trigger ( Speed_Dec_Past 16.6667 DisableTrigger(4) )

				Random_Trigger ( Delay_Min_Max ( 0 1 )  PlayOneShot ( 3
					File ( "D1.wav" -1 ) 
					File ( "D2.wav" -1 ) 
					File ( "D3.wav" -1 ) 
					SelectionMethod ( RandomSelection ) )   )		 
			)
	)


Time interval can be increased, by altering the Delay_Min_Max ( 0 1 ) values. :fiesta:

#6 User is offline   देव 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 84
  • Joined: 06-December 20
  • Gender:Male
  • Simulator:msts
  • Country:

Posted 29 June 2024 - 11:01 PM

View PostWeter, on 29 June 2024 - 10:26 PM, said:

Great, that You've managed, how to achieve that.
But how AI train knows, when to blow horn, in crossing only?
Or it blows constantly, between random time gaps?

This Stream is specifically for blowing horns between random time intervals only, For Crossings another stream is there, that I also got from one post from here itself, I don't remember which was the post/topic:

here is the stream for horn blow at crossings: [Actually its based on Camera Distance]

	Stream (
								    Skip (**** ORTS AI: horn at train crossing***************************************)
                Priority ( 7 ) 
				Volume (6.6)
                Triggers ( 2
                           
                                Variable_Trigger ( Distance_Dec_Past 90.0 PlayOneShot ( 3
        
                                                File ( "D1.wav" -1 ) 
												File ( "D2.wav" -1 ) 
												File ( "D3.wav" -1 ) 
                                                SelectionMethod ( RandomSelection ) ) )
                           Variable_Trigger ( Distance_Dec_Past 36.0  ReleaseLoopRelease () )
                                                
                )
    
			)      




#7 User is online   Weter 

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

Posted 29 June 2024 - 11:50 PM

Yes. This is one of "old tricks".
Also, Carlo have introduced some special triggers, 300-series, for AI trains to use.
There was a thread here indeed.
I believe, they would help in Your work as well.
http://www.elvastowe...post__p__216060
There was a function, when AI trains blow horn automatically, when approaching real crossings, but the honk sequence is hard-coded as American: "- - . -"

Page 1 of 1
  • 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