Csantucci, 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: