@@ -651,4 +651,51 @@ where the number in parenthesis may be anyone from 0 (nothing heard )
651651to 100 (internal track sound reproduced at volume as defined in .sms file).
652652
653653If the parameter is not present, the internal track sound is
654- reproduced at the volume as defined in .sms file.
654+ reproduced at the volume as defined in .sms file.
655+
656+ Conditional sound
657+ =================
658+
659+ In the real world some sounds are present only at a specific time (season and/or
660+ time of day) and/or with a specific weather.
661+
662+ OR provides the parameters to actuate that for any set of sound streams. Consider the
663+ sound stream here below::
664+
665+ Stream (
666+ Priority ( 6 )
667+ ORTSSeason ( Spring () winter () )
668+ ORTSWeather ( rain () )
669+ ORTSTimeOfDay ( 7 12 )
670+ ORTSTimeOfDay ( 13 20 )
671+ Triggers ( 2
672+ Variable_Trigger ( Distance_Dec_Past 400.0
673+ StartLoop ( 1
674+ File ( "Somma_annunci_loud.wav" -1 )
675+ SelectionMethod ( SequentialSelection )
676+ )
677+ )
678+ Variable_Trigger ( Distance_Inc_Past 400.0 ReleaseLoopRelease ())
679+ )
680+
681+ VolumeCurve(
682+ DistanceControlled
683+ CurvePoints ( 4
684+ 0.0 1.0
685+ 230.0 1.0
686+ 260.0 0.0
687+ 2000.0 0.0
688+ )
689+ Granularity (0.01)
690+ )
691+ )
692+
693+
694+ As can be seen, there are three keywords, that are ORTSSeason, ORTSWeather and
695+ ORTSTimeOfDay. If one or more of the three keywords is not present in the stream,
696+ the sound does not depend from that keyword.
697+
698+ In the example shown, the sound is played if all conditions are met, that is season
699+ is spring or winter and weather is rain and time of day is within one of the two
700+ intervals 7-12 or 13-20. There may be as many TimeOfDay lines as wanted,
701+ but the granularity is one hour.
0 commit comments